Software installation

Alternative: Renkulab

We also have a Jupyterlab environment with SPEX at Renkulab.io. Unfortuntately, HEASOFT is not (yet) working well in Jupyter Lab on Renkulab. The XRISM hands-on session is best done on Sciserver.

Laptop setup (advanced)

It is also possible to install the needed software on your own laptop. This takes a bit more work and problems can occur. Therefore, we recommend to use the Sciserver environment if you do not have a lot of experience with installing software.

Warning

There will NOT be a lot of time to help people with installation problems at the school. Make sure that you have at least the Sciserver option running (see above). If you want to run the software on your own laptop, then make sure that you do the installation and solve the problems in the week before the school starts!

During the school, we will use the following software packages:

  • HEASOFT (version >=6.31), with Hitomi and Xspec packages.

  • SPEX (version 3.07.03).

Install HEASOFT

For the school, you need a recent version of HEASOFT (preferably >=6.31) with at least the Hitomi software and Xspec installed. See the HEASOFT download page for download and install instructions for your machine. Make sure that you check at least the boxes for Hitomi and Xspec when you install (downloading more packages is recommended).

Install the HITOMI CALDB

In addition, you would need to download the HITOMI SXS calibration files and make sure that your CALDB and CALDB_CONFIG environment variables point to the path where you installed the CALDB files. See the CALDB install page for more information.

Install SPEX through Anaconda

If you do not have conda yet, please install it using these instructions.

Once your conda installation is set up, you can create a spex environment:

(base) user@unix:~> conda create -n spex python=3.9 numpy scipy astropy pytest jupyterlab matplotlib pip mkl=2021.4
(base) user@unix:~> conda activate spex

Now that we have a spex conda environment, you can install SPEX through conda:

(spex) user@unix:~> conda install -c spexxray spex pyspextools

And create a ipykernel for the (spex) environment to work in Jupyter:

(spex) user@unix:~> python -m ipykernel install --user --name spex --display-name "(spex)"

Troubleshooting

Importing SPEX in Jupyter fails

When you have Jupyter installed in multiple places, it sometimes happens that the wrong Jupyter executable is called. If you have trouble importing SPEX, then try to run Jupyterlab like this to force it to use Jupyter from the SPEX environment:

(spex) user@unix:~> $CONDA_PREFIX/bin/jupyter-lab &

See also this discussion for more hints.