nghxrg

class pynrc.simul.nghxrg.HXRGNoise(naxis1=None, naxis2=None, naxis3=None, n_out=None, dt=None, nroh=None, nfoh=None, nfoh_pix=None, dark_file=None, bias_file=None, verbose=False, reverse_scan_direction=False, reference_pixel_border_width=None, wind_mode='FULL', x0=0, y0=0, det_size=None, use_fftw=False, ncores=None)[source]

Bases: object

Simulate Teledyne HxRG + SIDECAR ASIC noise

HXRGNoise is a class for making realistic Teledyne HxRG system noise. The noise model includes correlated, uncorrelated, stationary, and non-stationary components. The default parameters make noise that resembles Channel 1 of JWST NIRSpec. NIRSpec uses H2RG detectors. They are read out using four video outputs at 1.e+5 pix/s/output.

Parameters
  • naxis1 (int) – X-dimension of the FITS cube.

  • naxis2 (int) – Y-dimension of the FITS cube.

  • naxis3 (int) – Z-dimension of the FITS cube (number of up-the-ramp samples).

  • n_out (int) – Number of detector amplifiers/channels/outputs.

  • nroh (int) – New row overhead in pixels. This allows for a short wait at the end of a row before starting the next one.

  • nfoh (int) – New frame overhead in rows. This allows for a short wait at the end of a frame before starting the next one.

  • nfoh_pix(TBD) (int) – New frame overhead in pixels. This allows for a short wait at the end of a frame before starting the next one. Generally a single pix offset for full frame and stripe for JWST ASIC systems.

  • dt (float) – Pixel dwell time in seconds (10e-6 sec, for instance).

  • bias_file (str) – Name of a FITS file that contains bias pattern, also used for PCA-zero.

  • dark_file (str) – Name of a FITS file that contains dark current values per pixel.

  • verbose (bool) – Enable this to provide status reporting.

  • wind_mode (str) – ‘FULL’, ‘STRIPE’, or ‘WINDOW’.

  • x0/y0 (int) – Pixel positions of subarray mode.

  • det_size (int) – Pixel dimension of full detector (square).

  • reference_pixel_border_width (int) – Width of reference pixel border around image area.

  • reverse_scan_direction (bool) – Enable this to reverse the fast scanner readout directions. This capability was added to support Teledyne’s programmable fast scan readout directions. The default setting of False corresponds to what HxRG detectors default to upon power up.

  • use_fftw (bool) – If pyFFTW is installed, you can use this in place of np.fft.

  • ncores (int) – Specify number of cores (threads, actually) to use for pyFFTW.

Methods Summary

message(message_text)

Used for status reporting

mknoise([o_file, gain, rd_noise, c_pink, …])

Create FITS cube containing only noise

pink_noise(mode[, fmin])

Generate a vector of non-periodic pink noise.

white_noise([nstep])

Gaussian noise

Methods Documentation

message(message_text)[source]

Used for status reporting

mknoise(o_file=None, gain=None, rd_noise=None, c_pink=None, u_pink=None, acn=None, aco_a=None, aco_b=None, pca0_amp=None, reference_pixel_noise_ratio=None, ktc_noise=None, bias_off_avg=None, bias_off_sig=None, bias_amp=None, ch_off=None, ref_f2f_corr=None, ref_f2f_ucorr=None, ref_inst=None, out_ADU=True)[source]

Create FITS cube containing only noise

Parameters
  • o_file (str, None) – Output filename. If None, then no output.

  • gain (float) – Gain in e/ADU. Defaults to 1.0.

  • ktc_noise (float) – kTC noise in electrons. Set this equal to sqrt(k*T*C_pixel)/q_e, where k is Boltzmann’s constant, T is detector temperature, and C_pixel is pixel capacitance. For an H2RG, the pixel capacitance is typically about 40 fF.

  • rd_noise (float) – Standard deviation of read noise in electrons. Can be an array for individual amplifiers.

  • c_pink (float) – Standard deviation of correlated pink noise in electrons.

  • u_pink (float) – Standard deviation of uncorrelated pink noise in electrons. Can be an array for individual amplifiers.

  • acn (float) – Standard deviation of alterating column noise in electrons

  • pca0_amp (float) – Standard deviation of pca0 in electrons

  • reference_pixel_noise_ratio (float) – Ratio of the standard deviation of the reference pixels to the science pixels. Reference pixels are usually a little lower noise.

  • bias_off_avg (float) – On average, integrations start here in electrons. Set this so that all pixels are in range.

  • bias_off_sig (float) – bias_off_avg has some variation. This is its std dev.

  • bias_amp (float) – A multiplicative factor that we multiply bias_image by to simulate a bias pattern. This is completely independent from adding in “picture frame” noise. Set to 0.0 remove bias pattern. For NIRCam, default is 1.0.

  • ch_off (float) – Offset of each channel relative to bias_off_avg. Can be an array for individual amplifiers.

  • ref_f2f_corr (float) – Random frame-to-frame reference offsets due to PA reset, correlated between channels.

  • ref_f2f_ucorr (float) – Random frame-to-frame reference offsets due to PA reset, per channel. Can be an array for individual amplifiers.

  • aco_a (float) – Relative offsets of altnernating columns “a”. Can be an array for individual amplifiers.

  • aco_b (float) – Relative offsets of altnernating columns “b”. Can be an array for individual amplifiers.

  • ref_inst (float) – Reference instability relative to active pixels.

  • out_ADU (bool) – Return as converted to ADU (True) or raw electrons?

Notes

Because of the noise correlations, there is no simple way to predict the noise of the simulated images. However, to a crude first approximation, these components add in quadrature.

The units in the above are mostly “electrons”. This follows convention in the astronomical community. From a physics perspective, holes are actually the physical entity that is collected in Teledyne’s p-on-n (p-type implants in n-type bulk) HgCdTe architecture.

pink_noise(mode, fmin=None)[source]

Generate a vector of non-periodic pink noise.

Parameters
  • mode (str) – Selected from ‘pink’, ‘acn’, or ‘ref_inst’.

  • fmin (float, optional) – Low-frequency cutoff. A value of 0 means no cut-off.

white_noise(nstep=None)[source]

Gaussian noise

Generate white noise for an HxRG including all time steps (actual pixels and overheads).

Parameters

nstep (int) – Length of vector returned