pynrc.reduce.calib.apply_nonlin

pynrc.reduce.calib.apply_nonlin(cube, det, coeff_dict, randomize=True, rand_seed=None)[source]

Apply pixel non-linearity to ideal ramp

Given a simulated cube of data in electrons, apply non-linearity coefficients to obtain values in DN (ADU). This

Parameters
  • cube (ndarray) – Simulated ramp data in e-. These should be intrinsic flux values with Poisson noise, but prior to read noise, kTC, IPC, etc. Size (nz,ny,nx). Should match det subarray shape.

  • det (Detector Class) – Desired detector class output

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

    • ‘sat_vals’ : An image indicating what saturation levels in DN for each pixel

    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

    To include randomization in line with observed variation:

    • ‘cflin0_mean’ : Average 0th-order coefficient

    • ‘cflin0_std’ : Measured standard deviation of 0th-order coefficent

    • ‘corr_slope’ : Slope of linear correlation between 0th-order and higher orders

    • ‘corr_intercept’ : Intercept of linear Correaltion between 0th-order and higher orders

Keyword Arguments

randomize (bool) – Add variation to the non-linearity coefficients