pynrc.reduce.calib.apply_linearity

pynrc.reduce.calib.apply_linearity(cube, det, coeff_dict)[source]

Apply pixel linearity corrections to ramp

Linearize a bias-subtracted, ref-pixel-corrected ramp and convert from units of DN to electrons.

Parameters
  • cube (ndarray) – Ramp data in DN of size (nz,ny,nx). Should be bias-subtracted and ref-pixel-corrected. Should match det subarray shape.

  • det (Detector Class) – NIRCam detector class.

  • coeff_dict (ndarray) –

    Dictionary holding coefficient information:

    • ‘cf_nonlin’ : Set of polynomial coefficients of size (ncf,ny,nx).

    • ‘use_legendre’ : Coefficients use Legendre polynomials?

    • ‘lxmap’ : Legendre polynomial normalization range, usually [0,1e5]

    Possible to separately fit lower flux values:

    • ‘counts_cut’ : Flux cut-off value in electrons

    • ‘cf_nonlin_low’ : Coefficients for flux values below counts_cut