TomDwelly.com
Astro-software engineer for hire
Coding

What's this all about then?

I'm going to use this space to publish some source code for various programs and scripts that I've written. Most of these programs are written in C or csh, and most relate to various astronomy tasks.


Quickly plot an X-ray spectrum: plot_xspectrum.csh

Here is a csh script for Linux/UNIX/OSX systems that is a very quick command line interface to XSPEC. The script allows the user to produce a postscript or pdf plot in E*F(E) units, (equivalent to νFν) from one or more input X-ray spectra in pha format (with corresponding response matricies).

INSTRUCTIONS:

Download the script from here: plot_xspectrum.csh (Right-click and save-as).
Make sure that it is excecutable (chmod u+x plot_xspectrum.csh) and in your $PATH.
Normal useage is:
plot_xspectrum.csh spectrum_filename.pha
But for a listing of input parameters, run:
plot_xspectrum.csh -help
NOTE: You will need to have XSPEC already installed and in your path for this script to work.
Temporary files will be written to the directory /tmp/${USER}/plot_xspectrum/
Input PHA files must include sensible RESPFILE, ANCRFILE and BACKFILE header keywords.