Installation

POPPY may be installed from PyPI in the usual manner for Python packages:

% pip install poppy --upgrade

The source code is hosted in this repository on GitHub. It is possible to directly install the latest development version from git:

% git clone https://github.com/mperrin/poppy.git
% cd poppy
% pip install -e .

Note

Users at STScI may also access POPPY through the standard SSB software distributions.

Requirements

  • Either Python 2.7 or Python 3.4. (Under certain circumstances on Mac OS, Python 3.4 is required if you want parallelized calculations, but otherwise POPPY functionality is identical on both versions.)
  • The standard Python scientific stack: numpy, scipy, matplotlib
  • POPPY relies upon the astropy community-developed core library for astronomy. astropy, version 1.0.1 or more recent, is needed.

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 multi-plane optical simulations such as coronagraphiy or 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: POPPY previously made use of the PyFFTW3 package, which is different from pyFFTW. The latter is more actively maintained and supported today, hence the switch. Note also that some users have reported intermittent stability issues with pyFFTW for reasons that are not yet clear.) At this time we recommend most users should skip installing pyFFTW while getting started with poppy.

Installing or updating pysynphot

Pysynphot is an optional dependency, but is highly recommended. See the pysynphot installation docs here to install pysynphot and (at least some of) its CDBS data files.

The minimum needed to have stellar spectral models available for use when creating PSFs is pysynphot itself plus just one of the CDBS data files: the Castelli & Kurucz stellar atlas, file synphot3.tar.gz (18 MB). Feel free to ignore the rest of the synphot CDBS files unless you know you want a larger set of input spectra or need the reference files for other purposes.

Testing your installation of poppy

Poppy includes a suite of unit tests that exercise its functionality and verify outputs match expectations. You can optionally run this test suite to verify that your installation is working properly:

>>> import poppy
>>> poppy.test()
============================ test session starts =====================================
platform darwin -- Python 2.7.8 -- pytest-2.5.1
Running tests with Astropy version 0.4.1.
... [etc] ...
================= 66 passed, 1 skipped, 1 xfailed in 124.68 seconds ==================

Some tests may be automatically skipped depending on whether certain optional packaged are installed, and other tests in development may be marked “expected to fail” (xfail), but as long as no tests actually fail then your installation is working as expected. (Note that you will need to run the test suite using a plain python interpreter, not inside an IPython or Jupyter session.)