Rhys Taylor's home page
Science, Art and Data Visualisation

Online scripts

Not so long ago I discovered the wonderful Streamlit, which lets you run Python code directly on a web page. There are some simple astronomical tasks I do so often it's just helpful to be able to call up a web page, enter the values and have the answer pop out. So far these are all very simple tasks (except one) that could easily be done on a calculator, but this just saves a bit of time. The exception is the source visibility calculator. I'm not a fan of any of the other tools available online to do this. They're either annoying to learn, have an ugly interface, or don't give sufficiently precise results. So I wrote my own, and now I'm happy.

EDIT : I recently found this one, however, which I like very much.

Total HI mass calculator

A simple project to learn the basics. You give it the total flux and distance to the source, specify the units, and it spits out the total HI mass. Optionally can also calculate the integrated S/N, which is more useful since this is a more complex parameter.

Tophat HI mass calculator

Another simple calculator to examine how changing the parameters of a source changes its total HI mass, i.e. you know the line width, noise level and S/N but not the total flux (for some reason, presumably because you're an idiot or something).  Assumes a flat profile of the spectrum. Also lets you calculate the integrated S/N.

Column density calculator

A slightly more sophisticated calculator. Given the parameters of an HI source and the telescope, calculates the column density. It can also simply convert between units, but exploring the telescope parameter is more interesting – this is quite a nice way to explore how sensitivity changes. It isn't as straightforward as lower rms = better, because lower rms often comes at the expense of a larger beam size.

Travel time calculator

Super simple. Just lets you calculate speed, travel time or velocity using astronomer-friendly units.

HI deficiency calculator

A little bit more advanced. Here you can calculate how much gas your galaxy has lost, given its observed HI mass, optical diameter and morphological type, for a variety of calibration parameters. Also provides some useful reference information.

I can see my source from here !

Suppose you need to observe some source from some random location at some random date. This lets you find out what time your source will rise, when it's close to the horizon, and when it's close to the Sun, colour-coding the output data so you can see at a glance when it's good to observe. Comes with a source name resolver so you don't have to input the coordinates, as well as a pre-set list of observatory locations (or you can enter latitude and longitude). Prints out directly to the screen but also lets you download a higher-precision text file.

Whose Spectral Line Is It Anyway ?

Something that's a very occasional irritation : the need to calculate the exact frequency of a spectral line when planning new observations. It isn't a difficult calculation but there are enough stages that it's easy to slip up, especially as different observatories still use different conventions. For example the radio community developed a different velocity convention from the optical astronomers, neither of which is really correct, but both of which are actually used ! So this GUI-based calculator relieves all of that. You provide the rest wavelength or frequency (in cm or m, or Hz, kHz, MHz, GHz, or THz) and it will output the frequency, wavelength, redshift, and optical/radio/relativistic velocities at whatever parameter you specify.