GalSim-developers / GalSim

The modular galaxy image simulation toolkit. Documentation:
http://galsim-developers.github.io/GalSim/
Other
227 stars 107 forks source link

Update Roman PSF orientation #1094

Closed rmjarvis closed 4 years ago

rmjarvis commented 4 years ago

@troxel pointed out a subtlety with the Roman PSFs that we had been doing wrong in demo13 and which he also did wrong in his WFIRST sims. Namely, the PSF that is returned by galsim.roman.getPSF is oriented with respect to the image coordinates, not world coordinates.

While it is in arcsec (not pixels, so kind of in world coordinates), the pupil plane rotates with the camera, so observations with different PA values don't have the diffraction spikes rotate correctly as the telescope rotates. This led to coadd images in Troxel's sims having very pronounced spikes, whereas we actually expect them to be washed out by the varying PA angles.

This PR fixes that by adding an optional wcs parameter to the getPSF function. To get the PSF in world coordinates (as is standard everywhere else in GalSim), you need to provide the wcs of the image onto which you will be drawing it. Otherwise, it will return the PSF oriented along the image directions as before.

rmjarvis commented 4 years ago

Note: I confirmed with the project that the pupil plane orientation is along the SCA directions, not the observatory directions, which makes this simpler than it might have been. cf. https://github.com/spacetelescope/webbpsf/issues/374