Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebbPSF to STPSF #951

Open
wants to merge 13 commits into
base: develop
Choose a base branch
from
48 changes: 2 additions & 46 deletions .github/workflows/ci_workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,11 @@ jobs:
matrix:
include:

- name: Coverage test in Python 3
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'

steps:
- name: Checkout code
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
Expand All @@ -68,28 +42,10 @@ jobs:
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
2 changes: 0 additions & 2 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 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
48 changes: 1 addition & 47 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,42 +1,8 @@
[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
envlist = docbuild
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't seem right to me to remove all test environments apart from the docs.

We're still going to have the webbpsf package as a wrapper that imports stpsf, and being able to do import webbpsf and have existing code run is a KEY PART of the intended functionality here.

Therefore there needs to be a test suite that verifies that we can indeed import webbpsf and run calculations.

So please let's keep at least one test environment that runs the existing full test suite of webbpsf test functions. I don't think this needs to have all the different instances in the test matrix -- those will be covered by the stpsf test suite -- but there should be enough here to test that the import wrapper is working as intended.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Context for removing all the test environments:

Because the entire repository is replaced with stpsf, the tests that are running are stpsf tests. This wasn't playing nicely with our CI as all tests labelled webbpsf no longer existed. As this was intended to be the final release of WebbPSF, I decided to manually verify that the init change worked properly (as these automated tests will not need to run in the future because development is stopping in this repository). I think that if we all take a look and are comfortable with testing the build manually, that suffices. If this makes anyone uncomfortable I can spend time trying to get the CI functional, however I felt the benefits of that time investment were minimal.


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= *
deps=
Expand All @@ -53,15 +19,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
Loading