spacetelescope / webbpsf

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

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

Open ecoughli-trinity opened 1 month ago

ecoughli-trinity commented 1 month 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 1 month 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 1 month ago

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

larrybradley commented 1 month ago

@mperrin - yep I agree.