I highly recommend reading the wiki page on pressure before doing ANYTHING with water. Far too many overseers inadvertantly permaflood their fortresses without realizing that pressure is not to be underestimated, and to be planned for properly.
The safest way to fill your onsen project is to have a properly isolated, and computed size cistern, that drains into the onsen.
Say you have a 5x5 area you want to be your onsen. The ideal depth is 3/7 for each tile, or, 75 units of water.
If you build a nearby cistern that is 1x1x11z tiles (assume your magma is deep inside your fortress, and your water source is on the surface), and fill it all the way to the top, that is 77 units of water, with pressure. That sounds bad, because it is more than the 75 you want, but the 1x1 room at the bottom of the cistern does not empty completely, and will hold 3/7 water after it empties into the 5x5 room beside it. That means 74 units of water will enter the onsen. Very close to your ideal.
To safely fill the cistern, you use two floodgates with two levers. The first lever opens the floodgate that fills the cistern from the top. The second lever opens the floodgate that opens into your onsen, at the bottom of the cistern shaft. You only throw one at a time, and
by no means have both gates open at the same time. Bad juju *will* happen if you do.It would look a little like this:
O-----O
|XXXXX|
O-OXXXXX|
|XGXXXXX|
O-OXXXXX|
|XXXXX|
O-----O
Where Xs are floor tiles, O, -, and | are walls, and G is a floodgate.
Since this uses a lot of pressure, 7 units of water at a time will blast into the onsen when you open this lower gate. The cistern holds less than the ideal amount, when its own added tile is considered, so will never pose a flooding risk unless you open both gates at the same time. never do that. ever. In this case, the pressure is beneficial, because we have fully accounted for the full content of the cistern, (so no fortress flooding), and it will fill your onsen in under 3 game ticks. Trying to fill it to 3/7 depth without pressure will take substantially longer.
As I and GirlInHat mentioned, a means of purging the system so you can decontaminate it is just good medicine.
A nice trick to dispose of unwanted fluid (water OR magma) is to put a carved fortification at the edge of the map, and use it like a drain behind another floodgate. If you do this, BE SURE ALL FLOODGATES IN THE ONSEN ARE MAGMA SAFE!! That means magmasafe primary AND secondary materials! (The gate itself, AND the mechanisms!)
That gives a prototype onsen a little like this:
________This is a magmasafe pump, which you can use to pump magma into the room to cleanse it.
| (I suggest manually operating it on dwarf power.)
V
O-O|
|P||
O---OpOO
|XXXXX||
O-OXXXXXO|
|XGXXXXXG# <-this is the fortification slit on the very edge of the map. Magma and water are drained into oblivion from here.
O-OXXXXXO| As you can see, it is behind a floodgate, and the walls are double thick.
|XXXXX||
O-----O|
You dont have to design it that way, but this would work very nicely I think. Naturally, the area below this room is all channeled out and filled with magma. That pool of magma is what the magma pump draws from.