From 7798e70ac2f8b3ed93b5a57cde50bca1b56d9a9c Mon Sep 17 00:00:00 2001 From: Charles-Philippe Lajoie Date: Wed, 7 Feb 2024 15:04:28 -0500 Subject: [PATCH] Minor fix to clarify user-provided position angle instead of roll --- romanisim/wcs.py | 14 +++++++------- scripts/romanisim-make-image | 4 ++-- scripts/romanisim-make-stack | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/romanisim/wcs.py b/romanisim/wcs.py index 759dc369..597caa95 100644 --- a/romanisim/wcs.py +++ b/romanisim/wcs.py @@ -38,7 +38,7 @@ import roman_datamodels.testing.utils as maker_utils -def fill_in_parameters(parameters, coord, roll_ref=0, boresight=True): +def fill_in_parameters(parameters, coord, pa_aper=0, boresight=True): """Add WCS info to parameters dictionary. Parameters @@ -50,8 +50,8 @@ def fill_in_parameters(parameters, coord, roll_ref=0, boresight=True): coord : astropy.coordinates.SkyCoord or galsim.CelestialCoord world coordinates at V2 / V3 ref (boresight or center of WFI CCDs) - roll_ref : float - roll of the V3 axis from north + pa_aper : float + position angle (North to YIdl) at the aperture V2Ref/V3Ref boresight : bool whether coord is the telescope boresight (V2 = V3 = 0) or the center of @@ -74,7 +74,9 @@ def fill_in_parameters(parameters, coord, roll_ref=0, boresight=True): parameters['wcsinfo']['dec_ref'] = ( parameters['pointing']['dec_v1']) - parameters['wcsinfo']['roll_ref'] = roll_ref + # Romanisim uses ROLL_REF = PA_APER - V3IdlYAngle + V3IdlYAngle = -60 # this value should eventually be taken from the SIAF + parameters['wcsinfo']['roll_ref'] = pa_aper - V3IdlYAngle if boresight: parameters['wcsinfo']['v2_ref'] = 0 @@ -83,10 +85,8 @@ def fill_in_parameters(parameters, coord, roll_ref=0, boresight=True): from .parameters import v2v3_wficen parameters['wcsinfo']['v2_ref'] = v2v3_wficen[0] parameters['wcsinfo']['v3_ref'] = v2v3_wficen[1] - parameters['wcsinfo']['roll_ref'] = ( - parameters['wcsinfo'].get('roll_ref', 0) + 60) - + def get_wcs(image, usecrds=True, distortion=None): """Get a WCS object for a given sca or set of CRDS parameters. diff --git a/scripts/romanisim-make-image b/scripts/romanisim-make-image index feb426a9..50006c30 100755 --- a/scripts/romanisim-make-image +++ b/scripts/romanisim-make-image @@ -37,7 +37,7 @@ if __name__ == '__main__': help='ra and dec (deg)', default=None) parser.add_argument('--rng_seed', type=int, default=None) parser.add_argument('--roll', type=float, default=0, - help='Roll angle for the instrument.') + help='Position angle (North towards YIdl) measured at the V2Ref/V3Ref of the aperture used.') parser.add_argument('--sca', type=int, default=7, help='SCA to simulate') parser.add_argument('--usecrds', action='store_true', help='Use CRDS for distortion map') @@ -69,7 +69,7 @@ if __name__ == '__main__': if args.radec is not None: coord = SkyCoord(ra=args.radec[0] * u.deg, dec=args.radec[1] * u.deg, frame='icrs') - wcs.fill_in_parameters(metadata, coord, boresight=args.boresight, roll_ref=args.roll) + wcs.fill_in_parameters(metadata, coord, boresight=args.boresight, pa_aper=args.roll) rng = galsim.UniformDeviate(args.rng_seed) diff --git a/scripts/romanisim-make-stack b/scripts/romanisim-make-stack index 0e44bbd2..66c833e2 100755 --- a/scripts/romanisim-make-stack +++ b/scripts/romanisim-make-stack @@ -207,7 +207,7 @@ def main(): coord = SkyCoord(ra=float(entry['RA']) * u.deg, dec=float(entry['DEC']) * u.deg, frame='icrs') wcs.fill_in_parameters(metadata, coord, boresight=args.boresight, - roll_ref=float(entry['PA'])) + pa_aper=float(entry['PA'])) # Set metadata metadata = ris.set_metadata(meta=metadata,