spacetelescope / webbpsf

James Webb Space Telescope PSF simulation tool
https://webbpsf.readthedocs.io
BSD 3-Clause "New" or "Revised" License
119 stars 63 forks source link

Using PSF Grids - webbpsf.gridded_library.display_psf_grid(grid) does not provide correct labels #887

Closed ecoughli-trinity closed 2 months ago

ecoughli-trinity commented 4 months ago

When following the provided sample code from https://github.com/spacetelescope/webbpsf/blob/develop/docs/psf_grids.rst, the resulting output is not correctly labeled and instead labels every image as 'None'. Definitely really minor, but not sure how to rectify.

mperrin commented 4 months ago

Hi @ecoughli-trinity, thanks for reporting this bug. I can reproduce the issue here with the unhelpful None output labels.

The good news is, the functionality in webbpsf's display_psf_grid was migrated into photutils last fall, and the version in photutils is working correctly. (I think the cause of the problem with the plot output from display_psf_grid is due to some internal changes in the recent versions of photutils, which that function in webbpsf was not updated for).

I recommend you simply use the photutils plot_grid function instead, like this:

grid = nrc.psf_grid(num_psfs=36, all_detectors=False)
grid.plot_grid()
grid.plot_grid(deltas=True)

It seems to me like we should probably deprecate the function in webbpsf, and certainly should update the docs to just point users towards that photutils function call instead. @larrybradley @BradleySappington I presume you concur?

BradleySappington commented 4 months ago

@mperrin - agreed that this is the best course of action

larrybradley commented 4 months ago

@mperrin - yep I agree.