SAS Requirements - XMM-Newton
Software Requirements
Software and Tools required to work with SAS
Table 2 shows the software and tools required to work with SAS 21.0. Column Version shows the versions used in the build of SAS 21.0, column Web page includes the URL to get the specific software or tool and column Comments provides specific hints or links to addtional information you should consider to work with the software or tool.
Name | Version | Web page | Comments |
---|---|---|---|
X11 | Provided by building OS |
|
|
Python | 3.10.6 |
Binaries ready to install for Linux, macOS, Windows, etc. |
Detailed description on the SAS 21.0 Python environment can be found below. |
Perl | 5.34.1 | perlbrew will help you to download and install it. | Detailed description on the SAS 21.0 Perl environment can be found below |
ds9 | 8.4.1 or later | SAOImage ds9 download site. |
|
Grace | 5.1.25 | The Grace web site provides only the source code. |
Installation from source code is difficult. However, both CentOS and Ubuntu provide binary packages which are easily installed. On macOS we recommend to install Qt Grace 0.2.6. Instructions on how to do it are provided below. |
Heasoft | 6.30 | Binaries and source code available from Heasoft web site. | Details on how to build Heasoft from source code to be compatible with SAS 21.0 can be found below. |
WCSTools | 3.9.7 | The WCSTools web site provides only the source code. | Easy to build from source code. Please do not install WCStools v3.9.5 because its scat tool does not work when going to download data from internet, e.g. by setting the UB1_PATH environment variable to query the USNO Catalogue. |
Perl environment
Some SAS tasks are Perl scripts, e.g emchain, epchain, omichain, etc. In order to run, they require that a proper Perl be installed in your system and be available through the PATH environment variable.
Before installing SAS 21.0, please install Perl 5.34.1 using the perlbrew tool. Then, before running the SAS 21.0 install.sh script, define the environment variable SAS_PERL to point to the Perl 5.34.1 binary provided by such installation.
All SAS 21.0 Perl tasks search for the perl binary using /usr/bin/env in the first line of the script (she-bang). The SAS installation script configure_install ensures that all SAS 21.0 Perl task's she-bangs use that mechanism to find in PATH, the right Perl binary.
Given that Heasoft includes also Perl tasks, please ensure that the installation of this software, either from source code or from pre-built binaries, uses the same Perl 5.30.1 used for SAS 21.0. That is accomplished by defining the PERL environment variable to point to such binary, before building or installing Heasoft.
The following Perl modules are also required:
- Switch.pm
- Shell.pm
- CGI.pm
The installation of these modules can be done using the CPAN module included with perl 5.34.1, as follows
perl -MCPAN -eshell
where perl should be the same binary used to work with SAS 21.0.
The SAS 21.0 initialisation scripts created during the installation take care of the proper initialization of the standard Perl environment variables PERL5LIB and PERLLIB.
Python requirements
Besides Python 3.10.X or later, the following Python packages are required to work with SAS 21.0
- astropy
- numpy
- matplotlib
- requests
- pyds9
- PyQt5
- beautifultable
- scipy
- pypdf
- notebook
- astroquery>=0.4.3 (v0.4.3 is mandatory !)
All these packages can be installed by means of pip, the Python package installer, one by one or at once by means of file sas_21.0.0_python_packages.txt, which is included in the SAS 21.0 root installation directory. To perform the installation of all these packages, you can use the following command
pip install -r sas_21.0.0_python_packages.txt
Before doing it, please ensure that Python 3.10.6 (or later) is available through the PATH.
At difference with Perl, for Python it is not necessary to define a SAS_PYTHON environment variable. However, like perl, python must be available through the PATH, to be used from any SAS 19 Python task's she-bang.
SAS initialisation scripts created during installation take care of the proper definition of the standard Python environment variable PYTHONPATH.
Although we recommend installing the required Python packages listed earlier using pip, there are other tools like miniconda, anaconda, etc, which can be used as well to create a proper Python environment.
Make a build of Heasoft from source code compatible with SAS 21.0
Although a binary installation of Heasoft is sufficient to work with SAS, if you build it from source code --e.g. because you want to compile new Xspec models-- to make such build fully compatible with SAS 21.0, please do not forget to define both, the PERL and the PYTHON environment variables, to point to the Perl 5.34.1 and the Python 3.10.6 (or later) binaries used to work with SAS 21.0.
Installing QtGrace on macOS
The installation of Grace from source code on macOS can be done using different software tools. Good examples are Macports and homebrew. However, we have found that Qt Grace 0.2.6 binaries provide an excellent quick and easy alternative to these methods, while getting the same functionality.
Once downloaded from the web site indicated in Table 2, please install the dmg package as usual on macOS. The qtgrace.app will be available as an standard application in the /Applications folder. However, SAS is not prepared to work with it but with something named xmgrace, available from the command line. Then you must create the xmgrace command line application by executing the following commands from a standard terminal:
cd /Applications/qtgrace.app/Contents/MacOS
sudo ln -s qtgrace xmgrace
To complete the installation you must add the /Applications/qtgrace.app/Contents/MacOS directory to your PATH.
Qt Grace is not an X11 application, therefore you will not get its GUI when running it remotely through ssh.