Skip to content

Commit

Permalink
Merge pull request #910 from Skyhawk172/roman-docs-updates
Browse files Browse the repository at this point in the history
Roman docs & figures updates
  • Loading branch information
obi-wan76 authored Sep 12, 2024
2 parents 2c128b5 + 883bbbd commit be0f790
Show file tree
Hide file tree
Showing 6 changed files with 481 additions and 91 deletions.
3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ WebbPSF is a Python package that computes simulated point spread functions (PSFs
:align: center
:alt: Sample PSFs for the filters in the Roman WFI.

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:**
Expand Down
4 changes: 3 additions & 1 deletion docs/roman.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ Wide Field Instrument (WFI)
:align: center
:alt: Sample PSFs for the filters in the Roman WFI.

Sample PSFs for the filters in the Roman WFI. Angular scale in arcseconds, log-scaled intensity.
Sample PSFs for the filters in the Roman WFI on SCA01. Angular
scale in arcseconds, log-scaled intensity. Note that the prism and
grism PSFs shown here are monochromatic.

The WFI model is based on the `Cycle 9 instrument reference information <https://roman.gsfc.nasa.gov/science/Roman_Reference_Information.html>`_ from the Roman team at Goddard Space Flight Center (GSFC). The reported jitter for the Roman observatory is 0.012 arcsec per axis, per `GSFC <https://roman.ipac.caltech.edu/sims/Param_db.html#telescope>`_.

Expand Down
Binary file modified docs/roman_figures/compare_wfi_sca09_sca17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
40 changes: 23 additions & 17 deletions docs/roman_figures/how_tos.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,41 @@
from webbpsf import display_psf, roman

#### Create webbpsf-roman_page_header.png
long = 4
wide = 3

fig = plt.figure(figsize=(10, 8))
gs = fig.add_gridspec(wide, long, hspace=0.2, wspace=-0.15)
ax = gs.subplots(sharey=True, sharex=True)
axes = ax.flatten()

wfi = roman.WFI()

all_filters = [f for f in wfi.filter_list]

long = 6
wide = 2
for i, ifilter in enumerate(sorted(all_filters)):
ax = axes[i]

wfi.filter = ifilter

fig, axs = plt.subplots(wide, long, figsize=(12, 6), sharey=True)
nlambda = None # use defaults
if wfi.filter in ['PRISM', 'GRISM0', 'GRISM1']:
nlambda = 1

for i, filter in enumerate(sorted(all_filters)):
r = int(np.floor(i / long))
c = (i % long if i < long
else (i % long) + 1) # remove else for left-justified bottom row
ax = axs[r][c]
psf = wfi.calc_psf(oversample=4, nlambda=nlambda)

wfi.filter = filter
psf = wfi.calc_psf(oversample=4)
display_psf(psf, ax=ax, colorbar=False, title=ifilter)

if i not in [0, 4, 8]:
ax.tick_params(axis='y', length=0)
if i == 7:
ax.tick_params(axis='x', reset=True, top=False)

display_psf(psf, ax=ax, colorbar=False, title=filter)
ax.title.set_fontsize(20)
ax.tick_params(axis='both', labelsize=10)
ax.xaxis.label.set_visible(False)
ax.yaxis.label.set_visible(False)

axes[-1].remove()

axs[-1][0].remove() # change last index to -1 to justify left

fig.tight_layout(w_pad=.1, h_pad=0)
fig.tight_layout(w_pad=.1, h_pad=0) # calling twice somehow tightens h_pad
# fig.savefig('webbpsf-roman_page_header.png', dpi=100, facecolor='w')

#### Create compare_wfi_sca09_sca17.png
Expand Down
Binary file modified docs/roman_figures/webbpsf-roman_page_header.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
525 changes: 453 additions & 72 deletions notebooks/WebbPSF-Roman_Tutorial.ipynb

Large diffs are not rendered by default.

0 comments on commit be0f790

Please sign in to comment.