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.

  • 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.


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


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



Selected Detector ID from detectors in the detid_list attribute.


Allowed Detector IDs


Selected Detector ID from detectors in the scaid_list attribute.


NIRCam modules A or B (inferred from detector ID)


Number of fast row resets that occur before Reset Frame


Number of simultaenous detector output channels stripes


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


Selected SCA ID from detectors in the scaid_list attribute.


Allowed SCA IDs


Total photon collection time for all ramps.


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


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


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


Photon collection time for a single ramp.


NFF Row Resets time per integration


Total exposure acquisition time


Methods Summary

make_header([filter, pupil, obs_time])

Create a generic NIRCam FITS header.

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

Noise values per pixel.



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


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.

  • 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, ng=None, 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

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

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

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

  • ng (None or int or image) – Option to explicitly states number of groups. This is specifically used to enable the ability of only calculating pixel noise for unsaturated groups for each pixel. If a numpy array, then it should be the same shape as fsrc image. By default will us self.ngroup.

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

Keyword Arguments

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


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.


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


Export detector settings to a dictionary.