Come analyze HEASARC, IRSA, and MAST data in the cloud! The Fornax Initiative is now welcoming all interested beta users.
This page describes a future change to how spectral model data will be distributed in HEASoft.
Spectral Model Data Files
Some Xspec models require an auxiliary model data file to calculate results. The spectral model data files are available from the HEASARC. These models require auxiliary model data file(s). To see specifically which models require which files, reference modelDataFiles.csv.
Users and administrators download the requested files after installing the HEASoft software package.
To download the files used in those models, users can run the task ftgetmodeldata, or download the files manually and install them in the desired directory.
History
The spectral model files, necessary for loading some of the Xspec models, were previously included in HEASoft distributions. They were stored in:
heasoft/Xspec/src/spectral/modelData
and installed in:
heasoft/spectral/modelData
which is often written as:
$HEADAS/../spectral/modelData
Some installations, such as conda and docker, installed the spectral files in $HEADAS/spectral/modelData.
Starting with HEASoft version 6.xx (Xspec version 12.xx.xx), the spectral model data files are no longer distributed with the HEASoft software package. In normal installations, certain models in Xspec still expect the model data files to be found in $HEADAS/../spectral/modelData, so downloaded files should be placed there.
ftgetmodeldata
The ftgetmodeldata tool, anticipated in HEASoft version 6.37, downloads the desired spectral data files from the HEASARC to a local computer.
cURL library
HEASoft uses the curl library in order to download files. Specifically, it looks for the curl.h file, which is available from the development version of the curl library.
The CFITSIO user manual ("Notes about HTTPS and FTPS file access") contains more details about HEASoft curl requirements. The ftgetmodeldata tool does not use CFISIO in order to download files, but it does use the same curl mechanisms.
To determine if the development library of curl is installed on a machine, run:
which curl-config
If that points to a valid path, then curl-devel is installed.
One common way to install the development version of curl on a linux is:
yum install libcurl-devel
See also the "everything curl" website for installation instructions.
If curl is not available on the user's machine, see the "Manually Downloading" or "Alternatives" section below for other ways to get the spectral model data.
The HEASoft conda packages include the built ftgetmodeldata tool, and do not require the user to have the curl development library installed on their machine.
Manually Downloading
Users may manually download the desired file(s) as described here, and place the file(s) in their desired destination directory.
Tarballs
Compressed tar balls of the current and older model data files:
- Files for current Xspec version, v12.15.1: xspec-v12.15.1-model-data.tar.gz (3.1GB / 4.2GB unpacked) (file list)
- Older Xspec model data: xspec-older-model-data.tar.gz (1.9GB / 6.9GB unpacked) (file list)
To place into the default location, after installing and initializing HEASoft, unpack this tar file in the directory above $HEADAS:
cd $HEADAS/.. tar zxf xspec-older-model-data.tar.gz
Individually
The entire collection of model data files is hosted at: https://heasarc.gsfc.nasa.gov/FTP/software/xspec/spectral/, in the modelData directory. Users may click on any of the files to download a single file.
wget
The directory as a whole can be downloaded using wget:
wget --no-host-directories --no-check-certificate --cut-dirs=4 \
--recursive --level=0 --wait=1 --continue --timestamping \
--no-parent --reject 'index*' -erobots=off \
https://heasarc.gsfc.nasa.gov/FTP/software/xspec/spectral/modelData
Alternatives
Users who don't have the cURL development library installed on their machines but still wish to use ftgetmodeldata to download their desired model data files can use a conda installation of HEASoft or Xspec. The conda package has the tool already built.
An alternative to using a locally-installed Xspec is to use SciServer or Fornax. The files are already installed on those platforms. This avoids the need to download the spectral model files to your local machine.
Xspec models in other programs
Users who want to link Xspec models into their own program need both the libraries and files.
- Download HEASoft (either full or just check Xspec in the Download page)
- Configure with "
--enable-xs-models-only" ; make ; make install - Retrieve the desired model data files using one of the methods described above
- Place files into
$HEADAS/../spectral/modelDatadirectory, or set MDATADIR to desired location
Shared HEASoft Installations
For organizations such as universities and labs, it's typical for the system administrators to create a shared installation of HEASoft. The users will then source (either explicitly or in a file like ~/.bashrc) that installation. We offer two recommended options for those administrators and users:
- The administrator can install the entire model data collection with HEASoft, so that all users have access to all files:
ftgetmodeldata modelname=all modelversion=all
The default 'localdir' parameter will install the files into$HEADAS/../spectral/modelData. - Users can instead use their own directory for downloading any needed spectral model data files using the MDATADIR variable, described below.
Xspec.init
Various settings relevant to the spectral model data files are listed in the installed ~/.xspec/Xspec.init file. See "Customizing Xspec" in the Xspec Overview for more details.
A copy of this file is placed in the $HOME/.xspec directory upon Xspec's first start-up or when it is not found. Note that this file is not automatically replaced upon subsequent HEASoft installations or updates, so it's possible for older values of variables to persist through newer Xspec installations.
To use a different directory for your model files, different from the historical $HEADAS/../spectral/modelData directory, the MDATADIR variable can be set to the directory where the downloaded model data files reside.
See also the section about apec models below to learn about getting the latest versions of those files.
Using xset
The xset command may be used to specify the path to the model directory.
XSPEC12> xset mdatadir /path/to/model/data/files/
Apec models
To ensure that Xspec uses the most up-to-date versions of these database files, starting with Xspec version 12.15.1, change your Xspec.init settings for ATOMDB_VERSION, SPEX_VERSION, NEI_VERSION to:
ATOMDB_VERSION: latest SPEX_VERSION: latest NEI_VERSION: latest
Xspec will then look in the latest.txt file in the distribution, which sets the version numbers for the latest versions of ATOMDB, NEI, and SPEX.
If these aren't set to latest and instead ask for an older version which is not downloaded, an error may pop up when calling the model.
Questions?
Please refer to the "Getting Help in Xspec" page if you have further questions.