Skip to content

Commit

Permalink
Merge branch 'develop' into coron_pupil_mask_alignment_defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
mperrin committed Nov 8, 2023
2 parents fd1acc9 + 794f7c5 commit bc3ce8e
Show file tree
Hide file tree
Showing 43 changed files with 5,266 additions and 1,502 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: build

on:
release:
types: [ released ]
pull_request:
workflow_dispatch:

jobs:
build:
uses: OpenAstronomy/github-actions-workflows/.github/workflows/publish_pure_python.yml@v1
with:
upload_to_pypi: ${{ (github.event_name == 'release') && (github.event.action == 'released') }}
secrets:
pypi_token: ${{ secrets.PYPI_PASSWORD_STSCI_MAINTAINER }}
6 changes: 3 additions & 3 deletions .github/workflows/ci_workflows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}

Expand All @@ -58,7 +58,7 @@ jobs:

- name: Get WebbPSF Data
run: | # Get WebbPSF data files (just a subset of the full dataset!) and set up environment variable
wget https://stsci.box.com/shared/static/n1fealx9q0m6sdnass6wnyfikvxtc0zz.gz -O /tmp/minimal-webbpsf-data.tar.gz
wget https://stsci.box.com/shared/static/0ojjfg3cieqdpd18vl1bjnpe63r82dx8.gz -O /tmp/minimal-webbpsf-data.tar.gz
tar -xzvf /tmp/minimal-webbpsf-data.tar.gz
echo "WEBBPSF_PATH=${{github.workspace}}/webbpsf-data" >> $GITHUB_ENV
Expand Down
16 changes: 0 additions & 16 deletions .github/workflows/publish-to-pypi.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
WebbPSF: Simulated Point Spread Functions for the James Webb and Nancy Grace Roman Space Telescopes
===================================================================================================

.. image:: docs/readme_fig.png
.. image:: https://github.com/spacetelescope/webbpsf/blob/stable/docs/readme_fig.png?raw=true

.. image:: https://img.shields.io/pypi/v/webbpsf.svg
:target: https://pypi.python.org/pypi/webbpsf
Expand All @@ -21,7 +21,7 @@ WebbPSF: Simulated Point Spread Functions for the James Webb and Nancy Grace Rom
.. image:: https://img.shields.io/badge/ascl-1504.007-blue.svg?colorB=262255
:target: http://ascl.net/1504.007

WebbPSF produces simulated PSFs for the James Webb Space Telescope, NASA's next
WebbPSF produces simulated PSFs for the James Webb Space Telescope, NASA's
flagship infrared space telescope. WebbPSF can simulate images for any of the
four science instruments plus the fine guidance sensor, including both direct
imaging and coronagraphic modes.
Expand All @@ -37,4 +37,4 @@ Documentation can be found online at https://webbpsf.readthedocs.io
WebbPSF requires input data for its simulations, including optical path
difference (OPD) maps, filter transmission curves, and coronagraph Lyot mask
shapes. These data files are not included in this source distribution.
Please see the documentation to download the required data files.
Please see the documentation to download the required data files.
368 changes: 89 additions & 279 deletions dev_utils/Get Throughputs from Pandeia.ipynb

Large diffs are not rendered by default.

Binary file added dev_utils/MIMF_FP_Table_From_WAG.xlsx
Binary file not shown.
1,346 changes: 1,346 additions & 0 deletions dev_utils/Plot SI MIMF Field Point Locations Wall Chart.ipynb

Large diffs are not rendered by default.

1,453 changes: 1,453 additions & 0 deletions dev_utils/Plot SI WFE Field Dependence.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dev_utils/make-data-sdist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ if ! [[ $1 ]]; then
fi

if ! [[ $DATAROOT ]]; then
DATAROOT="/itar/jwst/tel/share/webbpsf/webbpsf-data-source/"
DATAROOT="/grp/jwst/ote/webbpsf-data-source/"
fi
echo "Using data from $DATAROOT"

Expand Down
14 changes: 13 additions & 1 deletion dev_utils/master_data_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,23 @@ TMPDIR="/tmp/webbpsf-data"

./make-data-sdist.sh $VER

./make-minimal-datafiles.py ${PWD}/webbpsf-data-${VER}.tar.gz $VER
echo
echo "Copying latest data to /grp/jwst/ote for internal stsci use..."
main_directory="/grp/jwst/ote"
new_directory="$main_directory/webbpsf-data-$VER"
symlink_directory="/grp/jwst/ote/webbpsf-data"

cp "$PWD/webbpsf-data-$VER.tar.gz" "$main_directory"
tar -xzf "$PWD/webbpsf-data-$VER.tar.gz" -C "$main_directory"
mv "$main_directory/webbpsf-data" "$new_directory"
ln -s "$new_directory" "$symlink_directory"

./make-minimal-datafiles.py ${PWD}/webbpsf-data-${VER}.tar.gz $VER

echo
echo "================================================="
echo "Data extracted for internal use with updated symlink $symlink_directory -> $new_directory"
echo
echo "OUTPUT FILES:"
echo
echo ${PWD}/webbpsf-data-${VER}.tar.gz
Expand Down
2 changes: 2 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,12 @@
"sphinx.ext.inheritance_diagram",
"sphinx.ext.viewcode",
"sphinx.ext.autosummary",
"sphinxcontrib.jquery",
"sphinx_automodapi.automodapi",
"sphinx_issues",
"nbsphinx",
"numpydoc",
"astroquery",
]

numpydoc_show_class_members = False
Expand Down
30 changes: 25 additions & 5 deletions docs/field_dependence/multifield_documentation.ipynb

Large diffs are not rendered by default.

14 changes: 9 additions & 5 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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 (formerly WFIRST). 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 *not* a full optical model of JWST, but rather a tool for transforming optical path difference (OPD) maps, created with some other tool, into the resulting PSFs as observed with JWST's or Roman's instruments.
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 %
Expand All @@ -19,7 +19,7 @@ WebbPSF is a Python package that computes simulated point spread functions (PSFs


**Contributors:**
WebbPSF has been developed by Marshall Perrin, Shannon Osborne, Robel Geda, Joseph Long, Justin Otor, Jarron Leisenring, Neil Zimmerman, Keira Brooks, and Anand Sivaramakrishnan, with contributions from Marcio Meléndez Hernandez, Alden Jurling, Lauren Chambers, Ewan Douglas, Charles Lajoie, Megan Sosey, and Kathryn St.Laurent. We also are grateful to the contributors of the astropy-helpers and stsci package templates.
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
----------------------------
Expand All @@ -30,8 +30,10 @@ See :ref:`using_api`.

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.

.. note::
*Getting help:* For help using or installing webbpsf, you can contact the STScI JWST Help Desk at jwsthelp.stsci.edu. Note that WebbPSF is included in the Astroconda python distribution, as well as being installable via :ref:`standard Python packaging tools <installation>`.

.. 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>`
Expand All @@ -47,8 +49,10 @@ Contents
relnotes.rst
usage.rst
jwst.rst
jwst_optical_budgets.ipynb
jwst_measured_opds.ipynb
jwst_detector_effects.ipynb
jwst_matching_psfs_to_data.ipynb
jwst_optical_budgets.ipynb
jwst_wavefront_deltas.ipynb
roman.rst
psf_grids.rst
Expand Down
5 changes: 2 additions & 3 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ Installing the Required Data Files
Files containing such information as the JWST pupil shape, instrument throughputs, and aperture positions are distributed separately from WebbPSF. To run WebbPSF, you must download these files and tell WebbPSF where to find them using the ``WEBBPSF_PATH`` environment variable.

1. Download the following file: `webbpsf-data-1.1.1.tar.gz <https://stsci.box.com/shared/static/t90gqazqs82d8nh25249oq1obbjfstq8.gz>`_ [approx. 80 MB]
2. Untar ``webbpsf-data-1.1.1.tar.gz`` into a directory of your choosing.
1. Download the following file: `webbpsf-data-LATEST.tar.gz <https://stsci.box.com/shared/static/qxpiaxsjwo15ml6m4pkhtk36c9jgj70k.gz>`_ [approx. 70 MB]
2. Untar ``webbpsf-data-LATEST.tar.gz`` into a directory of your choosing.
3. Set the environment variable ``WEBBPSF_PATH`` to point to that directory. e.g. ::

export WEBBPSF_PATH=$HOME/data/webbpsf-data
Expand All @@ -87,7 +87,6 @@ You should now be able to successfully ``import webbpsf`` in a Python session.
.. Note::

**For STScI Users Only:** Users at STScI may access the required data files from the Central Storage network. Set the following environment variables in your ``bash`` shell. (You will probably want to add this to your ``.bashrc``.) ::

export WEBBPSF_PATH="/grp/jwst/ote/webbpsf-data"
export PYSYN_CDBS="/grp/hst/cdbs"

Expand Down
505 changes: 505 additions & 0 deletions docs/jwst_detector_effects.ipynb

Large diffs are not rendered by default.

235 changes: 235 additions & 0 deletions docs/jwst_matching_psfs_to_data.ipynb

Large diffs are not rendered by default.

9 changes: 5 additions & 4 deletions docs/jwst_wavefront_deltas.ipynb

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions docs/more_examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ Perhaps you want to calculate PSFs for all filters of a given instrument, using
niriss.filter=filtname
fov=18
outname = "PSF_NIRISS_%scen_wfe%d.fits" % (filtname, i)
psf = niriss.calc_psf(outname, nlambda=1, oversample=4, fov_arcsec=fov, rebin=True, display=True)
psf = niriss.calc_psf(outname, nlambda=1, oversample=4, fov_arcsec=fov, display=True)
Expand All @@ -97,7 +97,7 @@ Monochromatic PSFs with steps of 0.1 micron from 5-28.3 micron.
for iw, wavelength in enumerate(waves):
psffile = 'psf_MIRI_mono_%.1fum_opd1.fits' % (wavelength*1e6)
psf = m.calc_psf(fov_arcsec=30, oversample=4, rebin=True, monochromatic=wavelength, display=False,
psf = m.calc_psf(fov_arcsec=30, oversample=4, monochromatic=wavelength, display=False,
outfile=psffile)
ax = plt.subplot(16,16,iw+1)
webbpsf.display_psf(psffile, ext='DET_SAMP', colorbar=False, imagecrop=8)
Expand Down Expand Up @@ -135,7 +135,7 @@ NIRSpec fixed slits
psfs = {}
for wave in [0.6e-6, 1e-6, 2e-6, 3e-6]:
psfs[wave] = nspec.calc_psf(monochromatic=wave, oversamp=4)
psfs[wave] = nspec.calc_psf(monochromatic=wave, oversample=4)
for i, wave in enumerate([0.6e-6, 1e-6, 2e-6, 3e-6]):
plt.subplot(1, 4, i+1)
Expand All @@ -159,7 +159,7 @@ NIRSpec MSA
ns.image_mask='MSA all open'
ns.display()
plt.savefig('example_nirspec_msa_optics.png')
msapsf = ns.calc_psf(monochromatic=2e-6, oversample=8, rebin=True)
msapsf = ns.calc_psf(monochromatic=2e-6, oversample=8)
webbpsf.display_psf(msapsf, ext='DET_SAMP')
.. image:: ./fig_example_nirspec_msa_optics.png
Expand Down Expand Up @@ -215,7 +215,7 @@ NIRCam coronagraphy with an offset source
# (note that this is MUCH larger than expected acq
# offsets. This size displacement is just for show)
nc.options['source_offset_theta'] = 45 # at a position angle of 45 deg
nc.calc_psf('coronagraphic.fits', oversample=4, clobber=True) # create highly oversampled output image
nc.calc_psf('coronagraphic.fits', oversample=4) # create highly oversampled output image
plt.figure(figsize=(12,4))
Expand Down Expand Up @@ -332,7 +332,7 @@ Make plots of encircled energy in PSFs at various wavelengths
outname = "PSF_MIRI_%.1fum_wfe%d.fits" % (wave, i)
psf = miri.calc_psf(outname, monochromatic=wave*1e-6,
oversample=4, fov_arcsec=fov, rebin=True, display=True)
oversample=4, fov_arcsec=fov, display=True)
Expand Down Expand Up @@ -414,7 +414,7 @@ There are two functions here, one that creates a simulated PSF for a given amoun
return
psf, intermediates = miri.calc_psf(oversample=4, fov_arcsec=fov,
rebin=True, display=display, return_intermediates=True, \*\*kwargs)
display=display, return_intermediates=True, \*\*kwargs)
lyot_intensity = intermediates[4]
Expand Down
33 changes: 14 additions & 19 deletions docs/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,33 @@ Developer Notes: Releasing a new version of WebbPSF
Prerequisites
=============

* Is the `develop` build `passing on Travis? <https://travis-ci.org/spacetelescope/webbpsf>`_ with all desired release items included?
* Is the `develop` build `passing on Github Actions? <https://github.com/spacetelescope/webbpsf/actions>`_ with all desired release items included?

Releasing new data packages
===========================

#. Run ``dev_utils/make-data-sdist.sh`` (details below) to make a gzipped tarred archive of the WebbPSF data
#. Run ``dev_utils/master_data_release.sh`` (details below) to make a gzipped tarred archive of the WebbPSF data
#. If the new data package is **required** (meaning you can't run WebbPSF without it, or you can run but may get incorrect results), you must bump ``DATA_VERSION_MIN`` in ``__init__.py`` to ``(0, X, Y)``
#. Extract the resulting data archive and check that you can run the WebbPSF tests with ``WEBBPSF_PATH`` pointing to it
#. Copy the data archive into public web space.

#. This now means on Box. Upload to Box in the webbpsf shared data folder. Get the Box shared file URL.
#. Update ``docs/installation.rst`` to have that new URL and updated filename in the appropriate location.

#. Update the shared copy on STScI Central Store:

#. ``cd`` to ``/grp/jwst/ote`` and remove the ``webbpsf-data`` symlink
#. Copy the archive into ``/grp/jwst/ote/`` and extract it to ``/grp/jwst/ote/webbpsf-data``
#. Rename the folder to ``webbpsf-data-0.x.y``
#. Create a symbolic link at ``/grp/jwst/ote/webbpsf-data`` to point to the new folder

#. Copy the data archive into public web space. This now means on Box. The following steps need to be performed in this sequence in order to preserve the naming conventions.
#. Find webbpsf-data-LATEST.tar.gz, and click on "more options" and "Update Version". Choose the newest version of webbpsf-data-#.#.#.tar.gz
#. This will change the name of webbpsf-data-LATEST.tar.gz to be what you just uploaded, rename the file back to "webbpsf-data-LATEST.tar.gz"
#. Upload to Box a separate version of webbpsf-data-#.#.#.tar.gz shared data folder for future storage.
#. Upload to Box the minimal-webbpsf-data-#.#.#.tar.gz shared data folder.
#. Verify the shared link of webbpsf-data-latest.tar.gz is the same that exists in ``docs/installation.rst`` ("copy shared link" then "link settings")

#. A shared copy will be automatically configured in STScI Central Store with updated symlink ``/grp/jwst/ote/webbpsf-data``
#. Update the URL in ``installation.rst`` under :ref:`data_install`

Details for using `make-data-sdist.sh`:
Details for using `master_data_release.sh`:
-------------------------------------

Invoke ``dev_utils/make-data-sdist.sh`` one of the following ways to make a gzipped tarred archive of the WebbPSF data suitable for distribution.
Invoke ``dev_utils/master_data_release.sh`` one of the following ways to make a gzipped tarred archive of the WebbPSF data suitable for distribution.

**If you are on the Institute network:** ::

$ cd webbpsf/dev_utils/
$ ./make-data-sdist.sh 0.X.Y
$ cp ./webbpsf-data-0.X.Y.tar.gz /path/to/public/web/directory/
$ ./master_data_release.sh 0.X.Y

**If you're working from a local data root:** ::

Expand All @@ -52,7 +47,7 @@ Update the dependency requirement to the new version of poppy, in ``webbpsf/pypr
When you are ready, proceed with the WebbPSF release as follows:
#. Get the `develop` branch into the state that you want, including all PRs merged, updated release notes. This includes all tests passing both locally and on Travis.
#. Get the `develop` branch into the state that you want, including all PRs merged, updated release notes. This includes all tests passing both locally and on GitHub Actions.
#. Tag the commit with `v<version>`, being sure to sign the tag with the `-s` option.
* ``git tag -s v<version> -m "Release v<version>"``

Expand Down
Loading

0 comments on commit bc3ce8e

Please sign in to comment.