Skip to content

Commit

Permalink
Merge pull request #951 from spacetelescope/webbpsf_to_stpsf
Browse files Browse the repository at this point in the history
WebbPSF to STPSF
  • Loading branch information
BradleySappington authored Feb 14, 2025
2 parents 207f724 + fbe7749 commit 6fc889a
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 354 deletions.
56 changes: 5 additions & 51 deletions .github/workflows/ci_workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,38 +15,10 @@ jobs:
fail-fast: false
matrix:
include:

- name: Coverage test in Python 3
- name: Try Python 311
os: ubuntu-latest
python: '3.11'
toxenv: py311-poppydev-pysiafdev-cov

- name: Check for Sphinx doc build errors
os: ubuntu-latest
python: '3.10'
toxenv: docbuild

- name: Try Astropy development version
os: ubuntu-latest
python: '3.10'
toxenv: py310-astropydev-test

- name: Try latest versions of all dependencies
os: ubuntu-latest
python: '3.11'
toxenv: py311-latest-test

- name: Try minimum supported versions
os: ubuntu-latest
python: '3.10'
toxenv: py310-legacy-test

- name: Try released POPPY and PySIAF
os: ubuntu-latest
python: '3.10'
toxenv: py310-stable-test
continue-on-error: 'true'

toxenv: py311-test
steps:
- name: Checkout code
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
Expand All @@ -62,34 +34,16 @@ jobs:
run: pip install tox tox-conda>=0.2

- name: Get WebbPSF Data
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
uses: actions/cache@v4 # v4.0.2
with:
path: ${{ needs.retrieve_cache.outputs.cache_path }}
key: ${{ needs.retrieve_cache.outputs.cache_key }}

- name: Set WebbPSF data path
run: echo "WEBBPSF_PATH=${{ needs.retrieve_cache.outputs.cache_path }}/webbpsf-data/" >> $GITHUB_ENV
run: echo "WEBBPSF_PATH=${{ needs.retrieve_cache.outputs.cache_path }}/stpsf-data/" >> $GITHUB_ENV

- name: Check conda info
run: conda info

- name: Run tests with requirements file
if: ${{ contains(matrix.toxenv,'-latest') }}
run: |
cp requirements.txt ${{ runner.temp }}
tox -e ${{ matrix.toxenv }}
- name: Run tests
if: ${{ matrix.continue-on-error == null && contains(matrix.toxenv,'-latest') != true }}
- name: Run Sphinx doc build
run: tox -e ${{ matrix.toxenv }}

- name: Run tests and allow failures
if: matrix.continue-on-error
continue-on-error: true
run: tox -e ${{ matrix.toxenv }}

- name: Upload coverage to codecov
if: ${{ contains(matrix.toxenv,'-cov') }}
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
file: ./coverage.xml
4 changes: 1 addition & 3 deletions .github/workflows/download_data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ on:
type: boolean
required: false
default: true
schedule:
- cron: "0 0 * * 0"
release:
push:
branches:
Expand All @@ -81,7 +79,7 @@ jobs:
run: echo "version=$(cat ${{ steps.cache_path.outputs.cache_path }}/webbpsf-data/version.txt)" >> $GITHUB_OUTPUT
- id: cache_key
run: echo "cache_key=webbpsf-data-${{ (github.event_name == 'schedule' || github.event_name == 'release') && 'mini' || inputs.minimal && 'mini' || 'full' }}-${{ steps.version.outputs.version }}" >> $GITHUB_OUTPUT
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
- uses: actions/cache@v4
with:
path: ${{ runner.temp }}/data/
key: ${{ steps.cache_key.outputs.cache_key }}
Expand Down
115 changes: 2 additions & 113 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,113 +1,2 @@
Documentation for WebbPSF
===============================

WebbPSF is a Python package that computes simulated point spread functions (PSFs) for NASA's James Webb Space Telescope (JWST) and Nancy Grace Roman Space Telescope. WebbPSF transforms models of telescope and instrument optical state into PSFs, taking into account detector pixel scales, rotations, filter profiles, and point source spectra. It is rather a tool for transforming optical path difference (OPD) maps, created with observatory systems engineering models, into the resulting PSFs as observed with JWST's or Roman's instruments.

.. figure:: ./fig_instrument_comparison.png
:scale: 45 %
:align: center
:alt: Sample PSFs for JWST's instruments.

Sample PSFs for JWST's instrument suite, all on the same angular scale and display stretch.

.. figure:: ./roman_figures/webbpsf-roman_page_header.png
:scale: 70 %
:align: center
:alt: Sample PSFs for the filters in the Roman WFI.

Sample PSFs for the filters in the Roman WFI on SCA01. Note that
the prism and grism PSFs shown here are monochromatic.


**Contributors:**
WebbPSF has been developed by Marshall Perrin, Marcio Meléndez, Shannon Osborne, Robel Geda, Brad Sappington, Charles-Philippe Lajoie, Joseph Long, Justin Otor, Jarron Leisenring, Neil Zimmerman, Keira Brooks, and Anand Sivaramakrishnan, with contributions from Alden Jurling, Lauren Chambers, Ewan Douglas, and `others <https://github.com/spacetelescope/webbpsf/graphs/contributors>`_.

Getting Started with WebbPSF
----------------------------

See `Using WebbPSF <usage.html>`_.

.. admonition:: Quickstart Jupyter Notebook

This documentation is complemented by an `Jupyter Notebook format quickstart tutorial <http://nbviewer.jupyter.org/github/spacetelescope/webbpsf/blob/stable/notebooks/WebbPSF_tutorial.ipynb>`_. Downloading and running that notebook is a great way to get started using WebbPSF.


.. admonition:: Getting Help

For help using or installing webbpsf, you can contact the STScI JWST Help Desk at jwsthelp.stsci.edu, category WebbPSF/JWST Telescope.


:ref:`What's new in the latest release? <whatsnew>`

Contents
--------

.. toctree::
:maxdepth: 1
:caption: Getting Started

intro.rst
installation.rst
relnotes.rst
usage.ipynb
psf_grids.ipynb

.. toctree::
:maxdepth: 1
:caption: Modeling JWST PSFs

jwst.rst
more_examples.rst
jwst_measured_opds.ipynb
jwst_detector_effects.ipynb
jwst_matching_psfs_to_data.ipynb
jwst_ifu_datacubes.ipynb
jwst_large_psf.ipynb
jwst_optical_budgets.ipynb
jwst_psf_subtraction.ipynb
jwst_wavefront_deltas.ipynb
less_common_usage.rst

.. toctree::
:maxdepth: 1
:caption: Modeling Roman PSFs

roman.rst

.. toctree::
:maxdepth: 1
:caption: Package Documentation

api_reference.rst
help.rst
sampling.rst
fft_optimization.rst
poppy.rst

.. toctree::
:maxdepth: 1
:caption: Developer Reference

available_opds.rst
field_dependence/multifield_documentation.ipynb
references.rst
release.rst


.. admonition:: How to cite WebbPSF

In addition to this documentation, WebbPSF is described in the following references. Users of WebbPSF are encouraged to cite one of these.

* Perrin et al. 2014, `"Updated point spread function simulations for JWST with WebbPSF" <http://adsabs.harvard.edu/abs/2014SPIE.9143E..3XP>`_, Proc. SPIE. 9143,
* Perrin et al. 2012, `"Simulating point spread functions for the James Webb Space Telescope with WebbPSF", <http://adsabs.harvard.edu/abs/2012SPIE.8442E..3DP>`_ Proc SPIE 8842, and
* Perrin 2011, `Improved PSF Simulations for JWST: Methods, Algorithms, and Validation <Improved_PSFs_for_Webb.pdf>`_, JWST Technical report JWST-STScI-002469.

In particular, the 2012 SPIE paper gives a broad overview, the 2014 SPIE paper presents comparisons to instrument cryotest data, and the Technical Report document describes in more detail the relevant optical physics, explains design decisions and motivation for WebbPSF's architecture, and presents extensive validation tests demonstrating consistency between WebbPSF and other PSF simulation packages used throughout the JWST project.


* :ref:`genindex`
* :ref:`search`

**Mailing List**

If you would like to receive email announcements of future versions, please contact Marshall Perrin, or visit `maillist.stsci.edu <https://maillist.stsci.edu/scripts/wa.exe?SUBED1=webbpsf-users&A=1>` to subscribe yourself to the "[email protected]" list.
.. meta::
:http-equiv=Refresh: 0; url='https://stpsf.readthedocs.io/en/latest/'
10 changes: 1 addition & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,7 @@ dynamic = [
readme = "README.rst"
requires-python = ">=3.10"
dependencies = [
"numpy>=1.21.6",
"scipy>=1.5.0",
"matplotlib>=3.2.0",
"astropy>=5.1.0",
"photutils>=1.10.0",
"poppy>=1.0.0",
"pysiaf>=0.23.3",
"synphot>=1.0.0",
"astroquery>=0.4.6",
"stpsf>=1.5.2"
]

[project.license]
Expand Down
43 changes: 1 addition & 42 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,41 +1,12 @@
[tox]
envlist =
py{310,311,312}-test
py{310,311,312}-{poppydev,pysiafdev,astropydev,latest,stable}-test
py310-legacy-test
py{310,311,312}-{poppydev,pysiafdev}-cov
py311-test

isolated_build = true

[testenv]
setenv =
astropydev: PIP_EXTRA_INDEX_URL = https://pypi.anaconda.org/astropy/simple
passenv = *
deps =
pytest
pytest-astropy
poppydev,legacy,astropydev,latest: git+https://github.com/spacetelescope/poppy.git#egg=poppy
pysiafdev,astropydev: git+https://github.com/spacetelescope/pysiaf.git#egg=pysiaf
legacy: numpy==1.21.6
legacy: pysiaf==0.11.0
legacy: astropy==5.1.0
legacy: astroquery==0.4.6
astropydev: astropy>=0.0.dev0
poppydev: synphot
latest: -rrequirements.txt
stable: poppy
stable: pysiaf
cov: pytest-cov
cov: coverage
conda deps =
scipy
matplotlib
cython
photutils
astroquery
commands=
test: pytest {posargs}
cov: pytest {posargs} --cov-config=pyproject.toml --cov-report=xml --cov=webbpsf webbpsf/tests/

[testenv:docbuild]
passenv= *
Expand All @@ -53,15 +24,3 @@ conda_deps=
pandoc
commands=
sphinx-build docs docs/_build

[testenv:codestyle]
skip_install = true
description = check package code style
deps =
pycodestyle
commands =
pycodestyle webbpsf

[testenv:flake8]
exclude= .git,__pycache__, test*
max-line-length = 120
Loading

0 comments on commit 6fc889a

Please sign in to comment.