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: observation_time
, num_groups
, magnitude
,
model
, band
, filt
, filt_ta
, instrument
,
subarray
, subarray_ta
, saturation_mode
, max_saturation
,
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.
Use¶
This is mostly a module to be used by the ExoCTK web application, but the main function can be run standalone as such:
from exoctk.groups_integrations.groups_integrations import perform_calculation perform_calculation()
Dependencies¶
astropy
numpy
scipy
- exoctk.groups_integrations.groups_integrations.calc_duration_time(num_groups, num_integrations, num_reset_frames, frame_time, frames_per_group=1)[source]¶
Calculates duration time (or exposure duration as told by APT)
- Parameters:
- num_groupsint
Groups per integration
- num_integrationsint
Integrations per exposure
- num_reset_framesint
Reset frames per integration
- frame_timefloat
Frame time (in seconds)
- frames_per_groupint, optional
Frames per group – always one except brown dwarves
- Returns:
- duration_timefloat
Duration time (in seconds).
- exoctk.groups_integrations.groups_integrations.calc_exposure_time(num_integrations, ramp_time)[source]¶
Calculates exposure time (or photon collection duration as told by APT.)
- Parameters:
- num_integrationsint
Integrations per exposure.
- ramp_timefloat
Ramp time (in seconds).
- Returns:
- exposure_timefloat
Exposure time (in seconds).
- exoctk.groups_integrations.groups_integrations.calc_frame_time(num_columns, num_rows, num_amps, instrument)[source]¶
Calculates the frame time for a given instrument/readmode/subarray.
- Parameters:
- num_columnsint
Number of columns
- num_rowsint
Number of rows
- num_ampsint
Amplifiers reading data
- instrumentstr
The instrument
- Returns:
- frame_timefloat
The frame time (in seconds)
- exoctk.groups_integrations.groups_integrations.calc_groups_from_exp_time(max_exptime_per_int, frame_time)[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
- frame_timefloat
The time per frame
- Returns:
- groupsint
The required number of groups.
- exoctk.groups_integrations.groups_integrations.calc_integration_time(num_groups, frame_time, frames_per_group, num_skips)[source]¶
Calculates the integration time.
- Parameters:
- num_groupsint
Groups per integration.]
- frame_timefloat
Frame time (in seconds)
- frames_per_groupint
Frames per group – always 1 except maybe brown dwarves
- num_skipsint
Skips per integration – always 0 except maybe brown dwarves
- Returns:
- integration_timefloat
Integration time (in seconds)
- exoctk.groups_integrations.groups_integrations.calc_num_integrations(transit_time, num_groups, num_reset_frames, frame_time, frames_per_group)[source]¶
Calculates number of integrations required.
- Parameters:
- transit_timefloat
The time of the transit (in hours)
- num_groupsint
Groups per integration
- num_reset_framesint
Number of reset frames per integration
- frame_timefloat
The frame time (in seconds)
- frames_per_groupint
Frames per group – always 1 except maybe for brown dwarves
- Returns:
- num_integrationsfloat
The required number of integraitions.
- exoctk.groups_integrations.groups_integrations.calc_observation_efficiency(exposure_time, duration_time)[source]¶
Calculates the observation efficiency.
- Parameters:
- exposure_timefloat
Exposure time (in seconds).
- duration_timefloat
Duration time (in seconds).
- Returns:
- observation_efficiencyfloat
Observation efficiency.
- exoctk.groups_integrations.groups_integrations.calc_ramp_time(integration_time, num_reset_frames, frame_time)[source]¶
Calculates the ramp time – or the integration time plus overhead for resets.
- Parameters:
- integration_timefloat
Integration time (in seconds)
- num_reset_framesint
Rest frames per integration
- frame_timefloat
Frame time (in seconds)
- Returns:
- ramp_timefloat
Ramp time (in seconds).
- exoctk.groups_integrations.groups_integrations.convert_saturation(max_saturation, saturation_mode, instrument, infile, target_acq_mode=False)[source]¶
Converts full well fraction to a saturation in counts OR provides the max fullwell for TA mode.
- Parameters:
- max_saturationfloat
Either a full well fraction or counts
- saturation_modestr
well
orcounts
- instrumentstr
The instrument
- infilestr
The path to the data file
- target_acq_modebool, optional
Whether or not it’s TA mode
- Returns:
- max_saturationfloat
The fullwell to use in counts.
- exoctk.groups_integrations.groups_integrations.interpolate_from_pandeia(magnitude, instrument, filt, subarray, model, band, frame_time, saturation_level, infile, target_acq_mode=False)[source]¶
Interpolates the precalculated
pandeia
data to estimate the saturation limit.- Parameters:
- magnitudefloat
The magnitude of the source. (Takes between 4.5-12.5)
- instrumentstr
The instrument, allowable
miri
,niriss
,nirspec
,nircam
- filtstr
The filter
- subarraystr
The subarray
- modelstr
Phoenix model key
- bandstr
Magnitude band
- frame_timefloat
Frame time
- saturation_levelfloat
The maximum fullwell saturation we’ll allow
- infilestr
The data file to use
- target_acq_modebool, optional
Whether or not we’re running this for TA
- Returns:
- num_groupsint
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(instrument, max_num_groups, min_num_groups)[source]¶
Turns the min/max groups into the closest allowable TA group mode.
- Parameters:
- instrumentstr
The instrument
- max_num_groupsint
The maximum number of groups without oversaturating
- min_num_groupsint
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_num_groups_for_sat(magnitude, instrument, filt, subarray, model, band, infile)[source]¶
Estimates the minimum number of groups to reach target acq saturation requirements.
- Parameters:
- magnitudefloat
Magnitude of star.
- instrumentstr
Instrument.
- filtstr
Filter.
- subarraystr
Subarray.
- modelstr
Phoenix model key.
- bandstr, currently unused?
The band – right now only k sooo?
- infilestr
The file with the pandeia data.
- Returns:
- min_num_groups_for_satint
The minimum number of groups to reach target snr.
- exoctk.groups_integrations.groups_integrations.perform_calculation(params, frames_per_group=1, num_skips=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
,max_sat
,infile
- frames_per_groupint, optional
The number of frames – almost always 1
- num_skips: 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_frame_time(infile, instrument, subarray, target_acq_mode=False)[source]¶
Assign the appropriate frame time based on the instrument and subarray. For now, modes are implied.
- Parameters:
- infile: str
The path to the data file.
- instrumentstr
The instrument :
miri
,niriss
,nirspec
, ornircam
- subarraystr
The subarray
- target_acq_modebool
Whether this is for TA or not.
- Returns:
- frame_timefloat
The frame time for this instrument/subarray combo.
- exoctk.groups_integrations.groups_integrations.set_params_from_instrument(instrument, subarray)[source]¶
Sets/collects the running parameters from the instrument.
- Parameters:
- instrumentstr
Instrument, options are
nircam
,niriss
,nirpec
, andmiri
- subarraystr
Subarray mode
- Returns:
- rowsint
The number of pixels per row.
- colsint
The number of columns per row.
- ampsint
The number of amplifiers.
- pixel_sizeint
The pixel size.
- frame_timefloat
The frame time.
- num_reset_framesint
The number of reset frames.