pynrc.simul.apt.DMS_input

class pynrc.simul.apt.DMS_input(xml_file, pointing_file, json_file, sm_acct_file, save_dir=None, obs_date='2022-03-01', obs_time='12:00:00', pa_v3=None, rand_seed_init=None)[source]

Bases: object

Class to generate a series of observation dictionaries in order to build DMS-like files. Loads APT files to generate the necessary observation information.

Usage:

json_file = ‘NRC-21.timing.json’ sm_acct_file = ‘NRC-21.smart_accounting’ pointing_file = ‘NRC-21.pointing’ xml_file = ‘NRC-21.xml’

obs_input = DMS_input(xml_file, pointing_file, json_file, sm_acct_file) # Update observation time and telescope PA obs_input.obs_date = ‘2022-03-01’ obs_input.obs_time = ‘12:00:00.000’ obs_input.pa_v3 = 45

# Create a list of observation parameters obs_params_all = obs_input.gen_all_obs_params()

# Select one of the parameter dictionaries obs_params = obs_params_all[0]

# Create a series of science data based on observation params # that results in sci_data and zero_data 16-bit numpy arrays out_model = level1b_data_model(obs_params, sci_data, zero_data)

# Save to FITS file # Performs minor updates to the saved FITS file save_level1b_fits(out_model, obs_params, save_dir)

__init__(xml_file, pointing_file, json_file, sm_acct_file, save_dir=None, obs_date='2022-03-01', obs_time='12:00:00', pa_v3=None, rand_seed_init=None)[source]

Methods

__init__(xml_file, pointing_file, json_file, ...)

gen_all_obs_params()

Generate a full set of parameters for all exposures

gen_obs_params(visit_id, exp_id, det_id[, ...])

Generate a single set of observation parameters for a given exposure

gen_pitch_array([nvals, pitch_init])

make_jwst_point(visit_id, exp_id, detname[, ...])

Create jwst_point object

Attributes

obs_date

Date of observations

obs_time

Start time of observations

pa_v3

gen_all_obs_params()[source]

Generate a full set of parameters for all exposures

gen_obs_params(visit_id, exp_id, det_id, det=None, seg_num=None, seg_tot=None, int_range=None, grp_id=1, seq_id=1, act_id='01')[source]

Generate a single set of observation parameters for a given exposure

make_jwst_point(visit_id, exp_id, detname, obs_params=None, base_std=0, dith_std=0, rand_seed=None, grp_id=1, seq_id=1, act_id='01')[source]

Create jwst_point object

Parameters
  • visit_id (str) – obsnum:visitnum, for example: ‘007:001’

  • exp_id (int) – Exposure number

  • detname (str) – Name of detector, such as ‘NRCA5’.

Keyword Arguments
  • obs_params (dict) – Option to pass any already generated obs_params dictionary rather than generating it automatically. Should be part of the associated visit.

  • base_std (float or None) – The 1-sigma pointing uncertainty per axis for telescope slew. If None, then standard deviation is chosen to be either 5 mas or 100 mas, depending on use_ta attribute (default: True).

  • dith_std (float or None) – The 1-sigma pointing uncertainty per axis for dithers. If None, then standard deviation is chosen to be either 2.5 or 5 mas, depending on use_sgd attribute (default: True).

  • rand_seed (None or int) – Random seed to use for generating repeatable random offsets.

property obs_date

Date of observations

property obs_time

Start time of observations