Cosmology Calculator OS X Widget

As an extragalactic astronomer, I’ve lost track of the number of times I’ve needed a cosmological calculator. Usually I use the routines built into (or that I’ve written for) the analysis packages I use. Obviously those are best for large calculations; for a more casual query with just a few redshifts, online web-based calculators are faster.

Then again, I’m not always online when I have a casual query. And the online tool that I (and most people I know) use, Ned Wright’s Javascript Cosmology Calculator, can only take one redshift at a time. So if I need parameters for half a dozen redshifts/cosmologies, I might as well write a script in, say, IDL. But that feels a bit like bringing an industrial fire hose to a pool party. More effective than a wimpy water pistol, but not a great use of resources.

My hack day proposal was to create the Super Soaker of cosmology calculators. Specifically, I suggested that we adapt Ned’s calculator to take a list of redshifts and package it as a Dashboard widget for OS X.

Stuart Lowe immediately offered to participate in the hack, and spent most of the day updating the original Javascript code, which was written in 1999. I set about figuring out exactly how to make a widget: turns out it’s a folder containing an adapted website with a few extra files. Kevin Schawinski and Julie Steele helped with the visualization, and by the demonstration session the next day, the widget was working and installed on several laptops.

You can enter multiple redshifts and (one or) multiple cosmologies. Just enter/paste the values into the boxes, and press “Go”. The result comes up as a table in the widget:

(If you’ve entered multiple cosmologies, they will appear as columns in the table too.)

You can then click to copy the table to your clipboard in tab-delimited form, for easy pasting into the document/application of your choice. The units are as shown (and are the same as Ned’s original calculator, though we’ve dropped the explicit conversion to light-years for each column). If you input a big enough list, the table becomes scrollable. Even though it is not optimized for large datasets, I tried it with a list of 1,000 redshifts and it only took a second or so to compute. So I’m not suggesting it become your main cosmology-calculator workhorse, but it will do in a pinch.

The widget is available for download at http://tinyurl.com/cosmocalc-widget as a .zip file. In OS X, just double-click to install after you’ve uncompressed it. Users of other platforms may not be able to install this as a widget, but you can still download it, open the folder and load the webpage therein.

A final note: I had spoken to Ned about this months before .Astro and was re-granted his blessing via e-mail once the hack was finished, so all is well concerning copyright/use issues. If you do use the widget in preparation of a paper, please cite him.

About Brooke Simmons

Researcher in Oxford Astrophysics, studying galaxies and supermassive black holes.

1 Comment

  1. Excellent widget Brooke! Really valuable tool even for us rookie cosmologists (a.k.a astronomers) to use when we need a quick and reliable tool to understand certain parameters at different epochs. Very well done to all of those involved, us Mac users are very, very appreciative.