pynrc.DetectorOps

class pynrc.DetectorOps(detector=481, wind_mode='FULL', xpix=2048, ypix=2048, x0=0, y0=0, nff=None, **kwargs)[source]

Bases: pynrc.detops.det_timing

Class to hold detector operations information. Includes SCA attributes such as detector names and IDs as well as multiaccum class for ramp settings.

Parameters
  • detector (int, str) – NIRCam detector ID (481-490) or SCA ID (A1-B5).

  • wind_mode (str) – Window mode type ‘FULL’, ‘STRIPE’, ‘WINDOW’.

  • xpix (int) – Size of window in x-pixels for frame time calculation.

  • ypix (int) – Size of window in y-pixels for frame time calculation.

  • x0 (int) – Lower-left x-coord position of detector window.

  • y0 (int) – Lower-left y-coord position of detector window.

  • nff (int) – Number of fast row resets.

Keyword Arguments
  • read_mode (str) – NIRCam Ramp Readout mode such as ‘RAPID’, ‘BRIGHT1’, etc.

  • nint (int) – Number of integrations (ramps).

  • ngroup (int) – Number of groups in a integration.

  • nf (int) – Number of frames per group.

  • nd1 (int) – Number of drop frame after reset (before first group read).

  • nd2 (int) – Number of drop frames within a group (ie., groupgap).

  • nd3 (int) – Number of drop frames after final read frame in ramp.

Examples

Use kwargs functionality to pass keywords to the multiaccum class.

Send via a dictionary of keywords and values:
>>> kwargs = {'read_mode':'RAPID', 'nint':5, 'ngroup':10}
>>> d = DetectorOps(**kwargs)
Set the keywords directly:
>>> d = DetectorOps(read_mode='RAPID', nint=5, ngroup=10)

Attributes Summary

channel

Detector channel ‘SW’ or ‘LW’ (inferred from detector ID)

chsize

detid

Selected Detector ID from detectors in the detid_list attribute.

detid_list

Allowed Detector IDs

detname

Selected Detector ID from detectors in the scaid_list attribute.

module

NIRCam modules A or B (inferred from detector ID)

nff

Number of fast row resets that occur before Reset Frame

nout

Number of simultaenous detector output channels stripes

ref_info

Array of reference pixel borders being read out [lower, upper, left, right].

scaid

Selected SCA ID from detectors in the scaid_list attribute.

scaid_list

Allowed SCA IDs

time_exp

Total photon collection time for all ramps.

time_frame

Determine frame times based on xpix, ypix, and wind_mode.

time_group

Time per group based on time_frame, nf, and nd2.

time_int

Same as time_ramp, except that ‘int’ follows the JWST nomenclature

time_ramp

Photon collection time for a single ramp.

time_row_reset

NFF Row Resets time per integration

time_total

Total exposure acquisition time

DetectorOps.time_total_int

Methods Summary

make_header([filter, pupil, obs_time])

Create a generic NIRCam FITS header.

pixel_noise([fsrc, fzodi, fbg, verbose])

Noise values per pixel.

DetectorOps.pixel_timing_map

times_to_dict([verbose])

Export ramp times as dictionary with option to print output to terminal.

to_dict([verbose])

Export detector settings to a dictionary.

Methods Documentation

make_header(filter=None, pupil=None, obs_time=None, **kwargs)[source]

Create a generic NIRCam FITS header.

Parameters
  • filter (str) – Name of filter element.

  • pupil (str) – Name of pupil element.

  • obs_time (datetime) – Specifies when the observation was considered to be executed. If not specified, then it will choose the current time. This must be a datetime object:

    >>> datetime.datetime(2016, 5, 9, 11, 57, 5, 796686)
    
pixel_noise(fsrc=0.0, fzodi=0.0, fbg=0.0, verbose=False, **kwargs)[source]

Noise values per pixel.

Return theoretical noise calculation for the specified MULTIACCUM exposure in terms of e-/sec. This uses the pre-defined detector-specific noise properties. Can specify flux of a source as well as background and zodiacal light (in e-/sec/pix). After getting the noise per pixel per ramp (integration), value(s) are divided by the sqrt(NINT) to return the final noise

Parameters
  • fsrc (float) – Flux of source in e-/sec/pix

  • fzodi (float) – Flux of the zodiacal background in e-/sec/pix

  • fbg (float) – Flux of telescope background in e-/sec/pix

  • ideal_Poisson (bool) – If set to True, use total signal for noise estimate, otherwise MULTIACCUM equation is used.

  • verbose (bool) – Print out results at the end.

Notes

fsrc, fzodi, and fbg are functionally the same as they are immediately summed. They can also be single values or multiple elements (list, array, tuple, etc.). If multiple inputs are arrays, make sure their array sizes match.

times_to_dict(verbose=False)

Export ramp times as dictionary with option to print output to terminal.

to_dict(verbose=False)

Export detector settings to a dictionary.