Warning

Before reading further, if you do not wish to install PandExo,there is an online version of the code here at STScI’s ExoCTK.

Pre-installation Data Download

PandExo requires: JWST instrument info and stellar SEDs. Users must set up these two environment variables before proceeding.

JWST Reference Data

For JWST, the link to access the required reference data is located here. It is important to make sure that the version number of PandExo matches the version number of your reference data (currently V1.3).

Then, create environment variable:

echo 'export pandeia_refdata="$USRDIR/pandeia_data"' >>~/.bash_profile

Stellar SEDs

Likewise, the user may wish to install specific data for use with the PySynPhot package Pandeia uses. We will only be using the Phoenix stellar atlas, which can be downloaded here.

More reference files can be downloaded via ftp:

  • ftp archive.stsci.edu
  • username “anonymous”
  • password is your e-mail address
  • cd pub/hst/pysynphot
  • download desired files.

Note that the tar.gz files downloaded from the STScI anonymous FTP site will untar into the directory structure “grp/hst/cdbs”, with the actual data files in an assortment of directories under “cdbs”. pysynphot (and pandeia) expect that the “PYSYN_CDBS” environment variable will point to the “cdbs” directory. As such, you can either move the files out of “grp/hst/” to wherever you would like to store them, or point “PYSYN_CDBS” to “/path/to/data/files/grp/hst/cdbs” in order to allow pysynphot and pandeia to properly detect the reference files.

Finally, create your environment variable:

echo 'export PYSYN_CDBS="$USRDIR/path/to/data/files/grp/hst/cdbs"' >>~/.bash_profile

Installation with Pip or Git

Install STScI specific packages

conda config --add channels http://ssb.stsci.edu/astroconda
conda install pyfftw

Now, install pandexo.

pip install pandexo.engine

OR Download PandExo’s repository via Github. The Github also has helpful notebooks for getting started!

git clone --recursive https://github.com/natashabatalha/pandexo
cd pandexo
python setup.py install

Final Test for Success

There is a run_test.py in the github. Test that you’re code is working:

python run_test.py
Starting TEST run
Running Single Case for: NIRSpec G140H
Optimization Reqested: Computing Duty Cycle
Finished Duty Cycle Calc
Starting Out of Transit Simulation
End out of Transit
Starting In Transit Simulation
End In Transit
SUCCESS

Troubleshooting-Common Errors

PyFFTW

PyFFTW is needed to run PandExo. In order to run PyFFTW you need to also isntall fftw. To do so, it is necessary to do so through Homebrew, if you do not have conda.

brew install fftw
pip install pyfftw

Multiprocessing

Python 2.7 users might need to install multiprocessing

pip install multiprocessing

RecursionError: maximum recursion depth exceeded while calling a Python object

There is a known bug with Python 3.6 and Sphinx <1.6. Before updating or installing pandexo do the following:

PIP USERS:

pip install sphinx==1.5.6

CONDA USERS:

conda install sphinx=1.5.6

TypeError: super() argument 1 must be type

This is the same error above with Sphinx, but for Python 2.7 users. The fix is the same:

PIP USERS:

pip install sphinx==1.5.6

CONDA USERS:

conda install sphinx=1.5.6

The Importance of Upgrading PandExo

It is crucial that your verison of PandExo remain up to date. Especially through commissioning and leading up to launch, there may be crucial changes to the code or the reference data. Updating PandExo requires three crucial steps.

Verify Reference Data is Current

The link to the reference data is located on Pandeia’s PyPI page. Before doing a large batch of calculations, make sure that you have this version.

Verify pandeia.engine is Current

pip install pandeia.engine --upgrade

Verify pandexo.engine is Current

pip install pandexo.engine --upgrade