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

Fill out target metadata stanza #103

Merged
merged 2 commits into from
Mar 13, 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
2 changes: 1 addition & 1 deletion romanisim/ris_make_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -258,4 +258,4 @@ def simulate_image_file(args, metadata, cat, rng=None, persist=None):
af = asdf.AsdfFile()
af.tree = {'roman': im, 'romanisim': romanisimdict}

af.write_to(args.filename)
af.write_to(open(args.filename, 'wb'))
16 changes: 16 additions & 0 deletions romanisim/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,22 @@ def add_more_metadata(metadata):
metadata['exposure']['read_pattern'] = read_pattern
# integration_start? integration_end? nints = 1? ...

if 'target' not in metadata.keys():
metadata['target'] = {}
target = metadata['target']
target['type'] = 'FIXED'
if 'wcsinfo' in metadata.keys():
target['ra'] = metadata['wcsinfo']['ra_ref']
target['dec'] = metadata['wcsinfo']['dec_ref']
target['proposer_ra'] = target['ra']
target['proposer_dec'] = target['dec']
target['ra_uncertainty'] = 0
target['dec_uncertainty'] = 0
target['proper_motion_ra'] = 0
target['proper_motion_dec'] = 0
target['proper_motion_epoch'] = 'J2000'
target['source_type'] = 'EXTENDED'


def king_profile(r, rc, rt):
"""Compute the King (1962) profile.
Expand Down
1 change: 0 additions & 1 deletion romanisim/wcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ def fill_in_parameters(parameters, coord, pa_aper=0, boresight=True):
parameters['aperture']['position_angle'] = pa_aper



def get_wcs(image, usecrds=True, distortion=None):
"""Get a WCS object for a given sca or set of CRDS parameters.

Expand Down
Loading