Requirements & Installation
Note
This is entirely optional, but you may wish to sign up to the mailing list stpsf-users@maillist.stsci.edu
. This is a very low-traffic moderated announce-only list, to which we will periodically post announcements of updates to this software.
To subscribe, visit the maillist.stsci.edu server
Installing with pip
STPSF and its underlying optical library POPPY may be installed from the Python Package Index in the usual manner for Python packages.
$ pip install --upgrade stpsf
[... progress report ...]
Successfully installed stpsf
Note that pip install stpsf
only installs the program code. If you install via pip, you must manually download and install the data files, as described below.
To obtain source spectra for calculations, you should also follow installation instructions for synphot.
Note
Installation through conda is not available as of STPSF version 1.1.0. Conda users should instead follow the insructions in the preceding section to install via pip.
Installing or updating synphot
Stsynphot is an optional dependency, but is highly recommended. Its installation instructions can be found in the synphot docs or a discussion in the POPPY docs.
Installing the Required Data Files
If you install via pip or manually, you must install the data files yourself.
Files containing such information as the JWST pupil shape, instrument throughputs, and aperture positions are distributed separately from STPSF. To run STPSF, you must download these files and tell STPSF where to find them using the STPSF_PATH
environment variable.
Download the following file: stpsf-data-LATEST.tar.gz [approx. 70 MB]
Untar
stpsf-data-LATEST.tar.gz
into a directory of your choosing.Set the environment variable
STPSF_PATH
to point to that directory. e.g.export STPSF_PATH=$HOME/data/stpsf-data
for bash. (You will probably want to add this to your .bashrc
.)
You should now be able to successfully import stpsf
in a Python session.
Warning
If you have previously installed the data files for an earlier version of STPSF, and then update to a newer version, the software may prompt you that you must download and install a new updated version of the data files.
Note
- For STScI Users Only: Users at STScI may access the required data files from the Central Storage network. Set the following environment variables in your
bash
shell. (You will probably want to add this to your.bashrc
.) :: export STPSF_PATH=”/grp/stpsf/stpsf-data” export PYSYN_CDBS=”/grp/hst/cdbs”
Software Requirements
See the requirements.txt specification file for the required package dependencies.
Required Python version: STPSF 1.1 and above require Python 3.10 or higher.
The major dependencies are the standard NumPy, SciPy, matplotlib stack, and Astropy.
Recommended Python packages:
synphot enables the simulation of PSFs with proper spectral response to realistic source spectra. Without this, PSF fidelity is reduced. See above for installation instructions for synphot. Stsynphot is recommended for most users.
Optional Python packages:
Some calculations with POPPY can benefit from the optional packages psutil and pyFFTW, but these are not needed in general. See the POPPY installation docs for more details. These optional packages are only worth adding for speed improvements if you are spending substantial time running calculations.
Additional packages are needed for the optional use of GPUs to accelerate calculations. See the POPPY documentation.
Installing a pre-release version or contributing to STPSF development
The STPSF source code repository is hosted at GitHub, as is the repository for POPPY. Users may clone or fork in the usual manner. Pull requests with code enhancements welcomed.
To install the current development version of STPSF, you can use pip
to install directly from a git
repository. To install STPSF and POPPY from git
, uninstall any existing copies of STPSF and POPPY, then invoke pip as follows:
$ pip install -e git+https://github.com/spacetelescope/poppy.git#egg=poppy \
-e git+https://github.com/spacetelescope/stpsf.git#egg=stpsf
This will create directories ./src/poppy
and ./src/stpsf
in your current directory containing the cloned repository. If you have commit access to the repository, you may want to clone via ssh with a URL like git+ssh://git@github.com:spacetelescope/stpsf.git
. Documentation of the available options for installing directly from Git can be found in the pip documentation.
Remember to install the required data files, if you have not already installed them.