26 | 06 | 2019
HEASOFT and ISIS Installation Guide [building xspec local models] PDF Print E-mail
[Ubuntu] [Apple OS X] [xspec local models] [installation test I & II]


by M. Nowak


This is a completely optional step, and is not required to run any of the standard HEASOFT or ISIS routines. This step can be performed at any time after the above steps. It is listed for more advanced users. If things work properly, then these procedures should only take a few minutes.

The following instructions are for creating a local model library that can be run in either ISIS or XSPEC 12. They are specifically for use with the local models that I have packaged at:


if built exactly as described below. Note that a few of these models require editing of the code if they are placed in different locations (specifically absem.f, swind1.f, xseqpair.f - search for lines that contain '/usr/local/xspec_lmodels/src'). Also note that not all of these models have been fully vetted, and they may contain bugs. (In fact, several do.) Furthermore, these bugs can behave differently whether the models are run from XSPEC 12, or through ISIS. (The former is more likely to "complete" a run of the code; however, just because a code runs to completion does not mean that it is bug free!). With the above caveats in mind, these represent a number of local models that are commonly used here at MIT.

First we create a directory:

unix%> mkdir /usr/local/xspec_lmodels

Download xspec_lmodels.tar.gz to this directory, and unpack:

unix%> cd /usr/local/xspec_lmodels
unix%> tar zxvf xspec_lmodels.tar.gz
unix%> rm xspec_lmodels.tar.gz

Create a build directory called i686, give it global write permission (XSPEC 12 will need to write to it during the local models build) move to it, and soft-link the contents of the /src directory.

unix%> mkdir i686
unix%> chmod a+w i686
unix%> cd i686
unix%> ln -s ../src/* .

We then need to start XSPEC 12, and use its "initpackage" command to create the local models library (which we give the name xspec_lmodels).

unix%> setenv HEADAS /usr/local/heasoft-6.6.2/i686-pc-linux-gnu-libc2.9
unix%> source $HEADAS/headas-init.csh
unix%> xspec

XSPEC12> initpackage xspec_lmodels lmodel.dat /usr/local/xspec_lmodels/i686/

The XSPEC local models are now ready to be used, and will be picked up by ISIS if one sets the "LMODDIR" environment variable to the location of these newly built libraries. Additionally, some of the local models require that specific environment variables be set, either before starting ISIS/XSPEC, or via an "xset" call during running of ISIS or XSPEC. For these purposes, one can create an initialization script, which can be run as:

unix%> source setxspec.csh

The contents of this setxspec.csh file are:

setenv HEADAS /usr/local/heasoft-6.6.2/i686-pc-linux-gnu-libc2.9
source $HEADAS/headas-init.csh
setenv LMODDIR /usr/local/xspec_lmodels/i686
setenv WARMABS_DATA /usr/local/xspec_lmodels/i686
setenv WARMABS_POP pops.fits.n4
setenv KYDIR ${LMODDIR}/kydirf
echo ' Use isis>xspec_xset("PHOTOION_DIR","'${LMODDIR}'") to use photoion models \n'