Free Software for Professional Astronomers
| Program | Last Updated |
|---|---|
| cosmic | 27 Nov, 2007 |
| libcosmo | 27 Nov, 2007 |
| spec_decon | 10 Feb, 2007 |
| slopt | 24 Jul, 2006 |
| mk_wgt_resp | 7 Jun, 2005 |
| f-test | 18 Jul, 2003 |
As with most astronomers, I've written many useful little programs to help me in my work over the years. Since it seems silly to me that we should all constantly be reinventing the wheel, I've posted some of the more useful ones here. All the programs here are licensed as free software under version 2 of the GPL.
The C++ programs here have all been tested using gcc/g++, but should work under any compiler that fully supports the current C++ standard (including STL). Note that this may exclude versions of gcc/g++ older than v3.0, which did not have full STL support. The Perl scripts have been tested under Perl 5.8 but will probably work in 5.6 as well. S-Lang scripts have been tested using S-Lang 1.4.x unless otherwise indicated. If you find any bugs in any of this please let me know, and include as many details as you can. I'm also open to reasonable requests for feature enhancements.
While this software is freely available, it has taken a lot of time and effort on my part to write and support it. Consequently, if you use any of these tools in published work, please acknowledge their use.
Chandra Data Analysis Tools
- mk_wgt_resp (Perl script)
- version 2.2.2; June 7, 2005 (changelog)
- requires CIAO 3.x
This Perl script is extremely useful for doing spectral analysis of extended sources with Chandra. The script extracts source and background spectra from Chandra data and generates the appropriate emission-weighted response matrices for each region in a user-supplied region file. An example application is a radial temperature profile. The user may group the spectra using any grouping algorithm available in the CIAO task dmgroup. Functionality similar to mk_wgt_resp is now available using the CXC-provided acisspec script provided with CIAO, but acisspec does only one region at a time.
As of the Jan 3, 2005 update, the script is fully compatible with CIAO 3.2, including mkacisrmf. With this release, mkacisrmf becomes the default tool used for generating response matrices under CIAO 3.2. mkrmf can still be invoked using a command-line option and remains the default if the script is used with CIAO 3.0.x or 3.1.
Important notes The script is designed for use with CIAO 3.x and CALDB 2.26 or later, although it will work with earlier versions of the CALDB. The CIAO 2.3 version is still available but not maintained. Please note that the CIAO 2.3 version will not work under CIAO 2.2.x without modification of the infile parameter of mkrmf.
- spec_decon (S-Lang script)
- version 1.4.12; February 10, 2007 (changelog)
- requires CIAO 3.x (3.3 or later on OS X)
This S-Lang script performs an onion skin deprojection of a set of Chandra spectra from concentric elliptical annuli using an absorbed MEKAL, VMEKAL, APEC, or VAPEC model for each annulus. The spectra of the outer annuli are added to the inner ones using normalizations that are fixed by the volume-weighted contribution of the outer annuli to the spectrum of each inner one. The dimensions of the annuli are defined using the same FITS header keywords as are required for the XSPEC projct model. The script outputs two files: an ASCII table of the best-fit values and errors and a plot of these values with their associated errors. The script consists of two components: spec_decon.sl and do_spec_decon.sl. The first of these should be placed in a directory in your slang_load_path. The second is the actual executable script, and should be customized for your dataset. Documentation for this customization is contained within do_spec_decon.sl.
Beginning with the Jan 5, 2004 update, the script can simultaneously deproject spectra from multiple detectors. For example, this allows the script to deproject data from all three XMM cameras at once. The March 23, 2004 release added the ability to specify an additional foreground or background component. This can be used, for example, to model excess Galactic soft emission. See the changelog for details and other new features.
Important note Sherpa does not save abundance table information to its save files, so if you use abundances other than the default and set init.save_sessions=1, the fits will appear incorrect when your saved sessions are loaded into Sherpa. You can manually set the abundances to work around this known Sherpa bug.
General Astronomy Tools
This short program calculates the cosmological distances and timescales to an astronomical source using a user-defined cosmology at a given redshift. It has both an interactive mode and a batch mode to calculate distances for a large list of redshifts. The program is described in more detail in the accompanying README file. You can test-drive cosmic using the kempner.net cosmology calculator.
The required library, libcosmo, is included.
Performs an F-Test to distinguish between the quality of two fits using the chi-squared values of those fits and their number of degrees of freedom.
This library is intended for use in doing quick calculations of use for observational astronomers. It implements a C++ class that defines the basic cosmological parameters Ho, Ωm, ΩΛ and Ωκ. An instantiation of the class also has a redshift, from which the standard distance measures and timescales are calculated. An angular scale (kpc/arcsec) is also calculated. A description of the public interface to the class is included in the README file. The current version of the Makefile compiles the class into a static library. Includes the demo program "cosmic."
Other Tools & Libraries
This code provides a S-Lang module for processing command line user input to slsh scripts. It includes support for the obvious data types and has extensive, but probably not complete, error checking of input. The module is written entirely in S-Lang, so nothing needs to be compiled. Since the module is quite small, the performance hit from using interpreted code rather than compiled code should also be quite small. Includes auto-help, an auto-version function, and argument aliasing (e.g. "-h" for "--help").
Despite the version number, this is essentially beta software. It is more or less feature-complete, but the public interface to the library and some of the library's internals are still evolving.
All contents © 20032008 Joshua Kempner, except where otherwise noted.