STPSF - Space Telescope Point Spread Functions for Roman
STPSF
, formerly known as WebbPSF (for versions less than 2.0), is a Python tool for simulating for point spread functions (PSFs).
In the following series of articles, we provide users with a high-level view of the STPSF tool, its capabilities and limitations, as well as some use cases and tutorials.
STPSF: Simulated Point Spread Functions for JWST and the Nancy Grace Roman Space Telescope
Examples of inputs and output from STPSF for the Roman Wide Field Instrument (WFI).
What is STPSF for Roman
STPSF is a Python package for simulating point spread functions (PSFs) for the James Webb Space Telescope and the Nancy Grace Roman Space Telescope. Using a set of precomputed Optical Path Difference (OPD) maps, STPSF generates PSFs for various instrument configurations. For Roman, STPSF supports only the Wide Field Instrument (WFI), using recent optical models from NASA's Goddard Space Flight Center that incorporate field- and wavelength-dependent aberrations. Previous versions of STPSF included functionality for simulating PSFs for the Roman Coronagraph Instrument based on early-design models. This functionality has since been deprecated. Interested users should consult external tools and resources (see STPSF Caveats).
See the Description of the WFI article for more information on the instrument.
Installation
STPSF Software Version
This documentation is written for STPSF version 2.3.1 (released in November 2026). Note also that Python 3.12 or higher is required.
STPSF
is run locally and installation of the software is straightforward when using pip.
pip install stpsf
The main dependency of STPSF is POPPY (Physical Optics Propagation in PYthon), a highly flexible package that simulates physical optical propagation including diffraction. Other major dependencies include:
- NumPy, a package for scientific computing with Python
- SciPy, a package containing algorithms for scientific computing with Python
- MatPlotLib, a library for Python visualizations
- AstroPy, the community built core package for Astronomy in Python
All the required dependencies are installed by default when the user installs STPSF . Although optional, SYNPHOT is highly recommended in order to enable the simulation of PSFs with realistic source spectra.
Input Data
Note that STPSF also requires input data for its simulations, including optical path difference (OPD) maps, and filter transmission curves. In addition, the environment variable stpsf_path must also be set to point to the directory where the STPSF data are stored. These data files are not included in the source distribution and must be downloaded manually; detailed steps for installation, the associated data, and setting up the environment variables can also be found in the readthedocs documentation.
Users interested in running the development version of STPSF and/or contributing to its ongoing development may also clone or fork from the main GitHub repository.
Additional Resources
Interested users will want to refer to the readthedocs documentation.
The source code and other relevant information can also be found on the GitHub repository.
For additional questions not answered in this article, please contact the Roman Help Desk.
References
In addition to this documentation, STPSF (formerly WebbPSF) is described in the following references. Users are encouraged to cite one of these publications:
Perrin et al. 2014, “Updated point spread function simulations for JWST with WebbPSF”, Proc. SPIE. 9143
Perrin et al. 2012, “Simulating point spread functions for the James Webb Space Telescope with WebbPSF”, Proc SPIE 8842
Perrin 2011, "Improved PSF Simulations for JWST: Methods, Algorithms, and Validation", JWST Technical report JWST-STScI-002469
