The recommended software for using UVOTPY¶
At the time of this writing, May 2013, the best way to install “UVOTPY” is - in my opinion - to have a dedicated Python installation that fits the requirements. What I mean by that is, that in most cases adding a new Python installation on your computer likely is going to save a lot of hassles due to incompatibilities. I have the impression that troubles with an existing Python installation is a common problem which likely will be solved in the near future. The problems I saw have ranged from incompatible versions of “Numpy”, “Scipy” or “Matplotlib”, to binary installations which failed to properly install the “STScI Python”. So I will briefly describe the ‘Mac OSX’ installation and how I did the installation on a ‘Linux Debian’ system. Note that different Python installations can exist in parallel on one machine and that some simple steps will get you setup for using either the new or your already existing Python installation.
Software for the Mac OSX¶
Basic tools¶
You will need to have installed a copy of the Xcode tools. Download from the App Store for free.
You also need a copy of the gfortran compiler. I use gfortran-4.2.3.dmg. http://code.obs.carnegiescience.edu/carnegie-python-distribution/downloads/gfortran-4.2.3.dmg/view
STScI Python¶
Although there are packages like “MacPorts” and “Fink” which allow you full control over your installation, I recommend installing the STScI Python distribution which needs very little setup. I installed it several times, sometimes with, sometimes without ‘IRAF’ and ‘STSDAS’, which are not needed for running “UVOTPY”. One thing must be noted: the software runs under the c-shell, not BASH, so you either need to start by typing ‘csh’, or change your default shell. Personally, I use what my old collegue Archie Warnock called the taco-shell: ‘tcsh’. (If you didn’t know, Archie set up the original NASA web site).
Heasoft¶
You will also need to install the HEASOFT software available from NASA’s HEASARC. Make sure to install the package with Swift support. I usually build my installation from source, but the binary distribution is less hassle to install. Also make sure to check if there are any updates or known problems with unapplied patches.
Calibration Database¶
The calibration files for the Swift mission need to be installed as well. This is done after first generating a basic installation.
WCStools¶
An installation of WCStools from Doug Tody at Harvard-CfA is also needed.
DS9¶
If you are an astronomer you’re bound to have it, but if not, get it. Recommended.
CDSclient¶
The Strassbourg Observatory has a long history of excellent management of astronomical data. They are the origin of the CDS which not only includes the World Data Center, but also has excellent astronomers and programmers. The cdsclient tool is just an easy way to get access to the name resolver and catalogs. Recommended.
Astropy¶
Where there was a great number of astronomical python tools at first, a lot of collaboration is putting them all together under the cloak of “Astropy”. In the future “UVOTPY” will use this package for FITS support, for example. Recommended.
Configuration¶
The following setup works for me:
#
# Paul's setup for c-shell
#
# I installed the HEASARC Headas and CALDB in a root directory
# which I called /sciencesoft.
#
# set up the HEASARC software
#
setenv SPEC $HOME/specfiles/
setenv LMODDIR /sciencesoft/lmoddir
setenv HEADAS /sciencesoft/heasoft/heasoft-6.13/i386-apple-darwin10.8.0/
alias heainit "source $HEADAS/headas-init.csh"
heainit
#
# define the working directory for ftools on my data disk
# make sure this is an area which has always space available
#
setenv FVTMP /Volumes/data/tmp
#
# define the location of the calibration database and set up the environment
#
setenv CALDB /sciencesoft/CALDB
source $CALDB/software/tools/caldbinit.csh
setenv CALDBCONFIG $CALDB/software/tools/caldb.config
#
# The headas setup must define LD_LIBRARY_PATH
# I have some libraries that I include at the end of my library path.
setenv LD_LIBRARY_PATH {$LD_LIBRARY_PATH}:/usr/local/lib
#
# I add the location of some executables to the end of my PATH
setenv PATH {$PATH}:{/usr/local/bin}:{/sciencesoft/bin}:{$HOME/bin}
#
# Some manual stuff is added too, (that is for the 'man' command)
setenv MANPATH {$MANPATH}:{/sciencesoft/man}
#
# Here I define the extra items to be added first in searched that
# python makes for programs. I have my programs loaded and some
# extra python web package, that I keep separate from the main python
# installation
#
setenv PYTHONPATH $HOME/uvotpy:/sciencesoft/PYWEB/lib/python
# variables for catalog search with WCStools' scat
setenv UB1_PATH http://tdc-www.harvard.edu/cgi-bin/scat
setenv GSC_PATH http://tdc-www.harvard.edu/cgi-bin/scat
alias graspcorr "uvotgraspcorr catspec=$HOME/uvotpy/calfiles/usnob1.spec\
distfile=$CALDB/data/swift/uvota/bcf/grism/swugrdist20041120v103.fits"
#
# STScI Python / aka iraf
# Even if you don't have iraf installed, you need to call this script
# called 'iraf' to get going.
if ( -f /usr/stsci/envconfig.mac/cshrc ) source /usr/stsci/envconfig.mac/cshrc
iraf
#
# define so the program can find the new calibration files
# This assumes that the file was unpacked from $HOME in a directory
# called simply 'uvotpy'
#
setenv UVOTPY $HOME/uvotpy
This is basically my $HOME/.cshrc file. You can adapt it as needed.
Software for Linux Debian¶
I made my first install of Python on a Redhat system some years ago, when I got upset by the restrictions on IDL use at home and looked for a non-commercial product. Since I did not have system priveliges it was a local install. The most difficult part was the ATLAS libraries supporting the Scipy installation. So I have been trying to avoid that part.
Unfortunately, both Redhat and Debian run several years behind the current release of Matplotlib and Scipy, and sometimes even the versions of Python and Numpy are too dated to use. My strategy has been to install the python, numpy from the distribution, and the ATLAS libraries as well, so that they are already on the system. I installed on my own Debian system, so could easily do that with my system privileges. However, when trying to install scipy and matplotlob I ran into problems having dated versions. In order to get control, I started a parallel installation from scratch. I decided to install in a subdirectory of /usr/local, so I created that and set the privileges so that I can install there as a user. Of course, it can also be done in your own user directories, for example, create $HOME/mypython.
“UVOTPY” depends on the HEAsoft tools, so they need to be in the path with their supporting libraries. Occasionally there are conflicts where the tool will address a similar library or program from somewhere else on the system. The order of the “path” will then need to be adjusted, or the tool renamed.