JWST WebbPSF:docs

Requirements & Installation

Software Requirements

Python: Python 2.6 or higher is required. Python 2.7 is required for the GUI (see below) and strongly recommended overall. WebbPSF is not yet Python 3 compatible.

Python modules: Beyond the usual numpy/scipy/matplotlib core modules, the following are required.

The following are optional. The first, pysynphot, is recommended for most users. The other optional installs are only worth adding for speed improvements if you are spending substantial time running calculations.

  • pysynphot enables the simulation of PSFs with proper spectral response to realistic source spectra. Without this, PSF fidelity is reduced. See below for installation instructions for pysynphot.
  • psutil enables slightly better automatic selection of numbers of processes for multiprocess calculations.
  • pyFFTW. The FFTW library can speed up the FFTs used in coronagraphic simulations and slit spectroscopy. Since direct imaging simulations use a discrete matrix FFT instead, direct imaging simulation speed is unchanged. pyFFTW is recommended if you expect to perform many coronagraphic calculations, particularly for MIRI. (Note: WebbPSF previously made use of the PyFFTW3 package, which is different from pyFFTW. The latter is more actively maintained and supported today, hence the switch.) See the Appendix: Performance and Parallelization page for more details.

Additional requirement for the GUI: The graphical user interface requires

  • Either the wxpython interface to the wxwidgets widget library (recommended),
  • or the ttk enhanced version of the Tkinter widget library.

Fairly similar GUIs are implemented in both widget tool kits, with the wxpython GUI providing additional functionality. Future development will concentrate on the wxpython toolkit only, but for now both are more or less supported.

Alternatively, you can just skip using the GUI; the optical modeling classes themselves have no dependency on these widgets.

Installing WebbPSF


For a prerelease version, you can’t install off of PyPI yet. Please use the download links below.

WebbPSF and its underlying optical library poppy are both installable from the Python Package Index via the standard toolchain using pip. This is the easiest installation method if you already have a working copy of python, numpy, and matplotlib on your computer.

Simply invoke pip in the usual manner:

$ pip install webbpsf
[... progress report ...]

``Successfully installed webbpsf``

You should now be able to do import webbpsf in a Python session to start WebbPSF.

However, the above installs only the program code. You still must download and install the data files, as described below.

Future versions may be installed with pip install --upgrade webbpsf when they become available.


If you wish to install webbpsf on a machine for which you do not have administrative access, you can do so by using Python’s built-in “–user” mechanism for installing packages into your home directory.

$ pip install webbpsf --user

Installing WebbPSF manually

If for some reason you don’t wish to use PYPI, you can just install from the source directly:

  1. Download the following files.
  1. Untar each into a temporary working directory.
  2. Run python setup.py install in each of those directories to install first poppy and then webbpsf.

You should now be able to do import webbpsf in a Python session to start WebbPSF.

However, the above installs only the program code. You still must download and install the data files, as described below.


If you lack the filesystem permissions to write into the system python directory (for instance, on a machine you don’t have root on), you can do python setup.py install --user to install locally in your home directory.

Installing WebbPSF development versions, and/or contributing to its development

The webbpsf 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.

Installing the Required Data Files

  1. Download the following file: webbpsf-data-0.3.0.tar.gz [417 MB]
  2. Untar webbpsf-data-0.3.0.tar.gz into a directory of your choosing.
  3. Set the environment variable WEBBPSF_PATH to point to that directory. e.g. setenv WEBBPSF_PATH $HOME/data/webbpsf-data for tcsh/csh, or WEBBPSF_PATH=$HOME/data/webbpsf-data; export WEBBPSF_PATH for bash.

Optional: sign up to receive announcement of updates

This is entirely optional, but you may wish to sign up to the mailing list webbpsf-users@stsci.edu. This is a low-traffic moderated announce-only list, to which we will periodically post announcements of updates to this software.

To subscribe, email majordomo@stsci.edu with the message body text "subscribe webbpsf-users".

Installing or updating pysynphot

Pysynphot is an optional dependency, but is highly recommended.

To install or update pysynphot, do the following. (See also http://stsdas.stsci.edu/pysynphot/ and https://trac6.assembla.com/astrolib). WebbPSF has most recently been tested using pysynphot 0.9.5 but is known to work well with earlier versions as well.


You may have trouble installing pysynphot, as the zip file of the source on pypi is broken. This has been communicated upstream but not yet fixed. You may have more luck installing from an updated zip file on testpypi: https://testpypi.python.org/pypi/pysynphot/0.9.5 To install this, use this command:

pip install -i https://testpypi.python.org/pypi pysynphot

If this is your initial installation of pysynphot you need to install the CDBS files. See the pysynphot installation guide. The necessary files are available from https://trac6.assembla.com/astrolib; follow the download links for “throughput files” and “model spectra”. If you already have CDBS installed, then you’re all set and can skip this step.

WebbPSF includes its own normalized copies of the new JWST instrumental throughputs from the development CDBS at STScI. If you have JWST throughput files available in your $PYSYN_CDBS directory (likely true only for internal users at STScI), those will be used in preference to the WebbPSF internal files, but this is not required.

Note for STScI Internal Users

Webbpsf is installed centrally on the WITServ computers for use by all members of the Webb instrument teams.

The directory /witserv/data10/software contains shared software tools, currently a handful of Python modules, WebbPSF, and a copy of CDBS.

The file /witserv/data10/software/README.txt gives a little bit of documentation, but briefly, it should be enough to add the line:

source /witserv/data10/software/setup.tcsh

to your shell startup files on witserv* (assuming you’re using tcsh), and then you should be able to run webbpsfgui from the command line, or start a python session and import webbpsf.

Prerelease access to updated versions of the CDBS files may be available; contact Marshall if interested.