Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fix to clarify user-provided position angle instead of roll #96

Merged
merged 1 commit into from
Feb 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions romanisim/wcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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.

Expand Down
4 changes: 2 additions & 2 deletions scripts/romanisim-make-image
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion scripts/romanisim-make-stack
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Loading