exoctk.groups_integrations package¶
Submodules¶
exoctk.groups_integrations.groups_integrations module¶
This is a module for calcuating groups and integrations with JWST on the fly. the main function (perform_calculation) takes a dictionary of inputs (modeled around how the web tool takes inputs) which must include : obs_time, n_group, mag, mod, band, filt, filt_ta, ins, subarray, subarray_ta, sat_mode, sat_max, and infile. It produces and dictionary of outputs that includes all of the original information as well as groups, integrations, saturation levels, and observation time estimates for target acquisition and science observations with JWST.
Authors¶
Jules Fowler, April 2017
Use¶
This is mostly a module to be used by ExoCTKWeb – but the main function can be run standalone.
-
exoctk.groups_integrations.groups_integrations.calc_groups_from_exp_time(max_exptime_per_int, t_frame)[source]¶ Given the maximum saturation time, calculates the number of frames per group.
- Parameters
- max_exptime_per_intfloat
The maximum number of seconds an integration can last before it’s oversaturated.
- t_framefloat
The time per frame.
- Returns
- groupsint
The required number of groups.
-
exoctk.groups_integrations.groups_integrations.calc_n_int(transit_time, n_group, n_reset, t_frame, n_frame)[source]¶ Calculates number of integrations required.
- Parameters
- transit_timefloat
The time of your planeting transit (in hours.)
- n_groupint
Groups per integration.
- n_resetint
Reset frames per integration.
- t_framefloat
The frame time (in seconds).
- n_frameint
Frames per group – always 1 except maybe brown dwarves.
- Returns
- n_intsfloat
The required number of integraitions.
-
exoctk.groups_integrations.groups_integrations.calc_obs_efficiency(t_exp, t_duration)[source]¶ Calculates the observation efficiency.
- Parameters
- t_expfloat
Exposure time (in seconds).
- t_durationfloat
Duration time (in seconds).
- Returns
- obs_efffloat
Observation efficiency.
-
exoctk.groups_integrations.groups_integrations.calc_t_duration(n_group, n_int, n_reset, t_frame, n_frame=1)[source]¶ Calculates duration time (or exposure duration as told by APT.)
- Parameters
- n_groupint
Groups per integration.
- n_intint
Integrations per exposure.
- n_resetint
Reset frames per integration.
- t_framefloat
Frame time (in seconds).
- n_frameint, optional
Frames per group – always one except brown dwarves.
- Returns
- t_durationfloat
Duration time (in seconds).
-
exoctk.groups_integrations.groups_integrations.calc_t_exp(n_int, t_ramp)[source]¶ Calculates exposure time (or photon collection duration as told by APT.)
- Parameters
- n_intint
Integrations per exposure.
- t_rampfloat
Ramp time (in seconds).
- Returns
- t_expfloat
Exposure time (in seconds).
-
exoctk.groups_integrations.groups_integrations.calc_t_frame(n_col, n_row, n_amp, ins)[source]¶ Calculates the frame time for a given ins/readmode/subarray.
- Parameters
- n_colint
Number of columns.
- n_rowint
Number of rows.
- n_ampint
Amplifiers reading data.
- insstr
The instrument key.
- Returns:
- t_framefloat
The frame time (in seconds).
-
exoctk.groups_integrations.groups_integrations.calc_t_int(n_group, t_frame, n_frame, n_skip)[source]¶ Calculates the integration time.
- Parameters
- n_groupint
Groups per integration.
- t_framefloat
Frame time (in seconds).
- n_frameint
Frames per group – always 1 except maybe brown dwarves.
- n_skipint
Skips per integration – always 0 except maybe brown dwarves.
- Returns
- t_intfloat
Integration time (in seconds).
-
exoctk.groups_integrations.groups_integrations.calc_t_ramp(t_int, n_reset, t_frame)[source]¶ Calculates the ramp time – or the integration time plus overhead for resets.
- Parameters
- t_intfloat
Integration time (in seconds).
- n_resetint
Rest frames per integration
- t_framefloat
Frame time (in seconds).
- Returns
- t_rampfloat
Ramp time (in seconds).
-
exoctk.groups_integrations.groups_integrations.convert_sat(sat_max, sat_mode, ins, infile, ta=False)[source]¶ Converts full well fraction to a saturation in counts OR provides the max fullwell for TA mode.
- Parameters
- sat_maxfloat
Either a full well fraction or counts.
- sat_modestr
‘well’ or ‘counts’.
- insstr
The instrument.
- infilestr
The path to the data file.
- tabool, optional
Whether or not it’s TA mode.
- Returns
- sat_maxfloat
The fullwell to use in counts.
-
exoctk.groups_integrations.groups_integrations.interpolate_from_dat(mag, ins, filt, sub, mod, band, t_frame, sat_lvl, infile, ta=False)[source]¶ Interpolates the precalculated pandeia data to estimate the saturation limit.
- Parameters
- magfloat
The magnitude of the source. (Takes between 4.5-12.5)
- insstr
The instrument, allowable “miri”, “niriss”, “nirspec”, “nircam”.
- filtstr
Filter.
- substr
Subarray.
- modstr
Phoenix model key.
- bandstr
Magnitude band – unsed rn.
- t_framefloat
Frame time.
- sat_lvlfloat
The maximum fullwell saturation we’ll allow.
- infilestr
The data file to use.
- tabool, optional
Whether or not we’re running this for TA.
- Returns
- n_groupint
The number of groups that won’t oversaturate the detector.
- max_satint
The maximum saturation level reached by that number of groups.
-
exoctk.groups_integrations.groups_integrations.map_to_ta_modes(ins, max_group, min_group)[source]¶ Turns the min/max groups into the closest allowable TA group mode.
- Parameters
- insstr
Instrument.
- max_groupint
The maximum number of groups without oversaturating.
- min_groupint
The groups needed to hit the target SNR.
- Returns
- min_ta_groupsint
The min possible groups to hit target SNR.
- max_ta_groupsint
The max possible groups before saturation.
-
exoctk.groups_integrations.groups_integrations.min_groups(mag, ins, filt, sub, mod, band, infile)[source]¶ Estimates the minimum number of groups to reach target acq sat requirements.
- Parameters
- magfloat
Magnitude of star.
- insstr
Instrument.
- filtstr
Filter.
- substr
Subarray.
- modstr
Phoenix model key.
- bandstr, currently unused?
The band – right now only k sooo?
- infilestr
The file with the pandeia data.
- Returns
- min_groupsint
The minimum number of groups to reach target snr.
-
exoctk.groups_integrations.groups_integrations.perform_calculation(params, n_frame=1, n_skip=0)[source]¶ Calculates all of the outputs and puts them in a dictionary for easy access.
- Parameters
- paramsdict
Dictionary of all the needed parameters. Must include: obs_time, n_group, mag, mod, band, filt, filt_ta, ins, subarray, subarray_ta, sat_mode, sat_max, infile
- n_frame :int, optional
The number of frames – almost always 1.
- n_skip: int, optional
Number of skips – almost always 0
- Returns
- paramsdict, str
Dictionary of outputs and inputs. If the calculation throws an error it will return a string error message instead.
-
exoctk.groups_integrations.groups_integrations.set_params_from_ins(ins, subarray)[source]¶ Sets/collects the running parameters from the instrument.
- Parameters
- insstr
Instrument, options are nircam, niriss, nirpec, and miri.
- subarraystr
Subarray mode.
- Returns
- rowsint
The number of pixels per row.
- colsint
The number of columns per row.
-
exoctk.groups_integrations.groups_integrations.set_t_frame(infile, ins, sub, ta=False)[source]¶ Assign the appropriate frame time based on the ins and subarray. For now, modes are implied.
- Parameters
- infile: str
The path to the data file.
- insstr
The instrument : ‘miri’, ‘niriss’, ‘nirspec’, or ‘nircam’.
- substr
The subarray – too lazy to write out the options here.
- tabool
Whether this is for TA or not.
- Returns
- t_framefloat
The frame time for this ins/sub combo.