hispecdrp.primitives.bias_subtraction.make_bias_primitive

Functions

_find_bad_pixels_bias(bias, kTC, dq[, ...])

std_axis0_3d_sigclip(bias_arr[, nsig, min_keep])

Sigma-clipped std over axis=0 for bias_arr with shape (n_files, ny, nx)

Classes

MakeBiasPrimitive([dataset, config, ...])

Derive the detector bias and kTC noise from a set of dark exposures.

class MakeBiasPrimitive(dataset=None, config=None, context=None, log_config=None, parent=None, **kwargs)[source]

Bases: BasePrimitive

Derive the detector bias and kTC noise from a set of dark exposures. 1) Median combine the first read to create the bias frame. 2) Compute the kTC noise as the standard deviation across the first reads, using sigma-clipping to reject outliers. 3) Flag pixels with high bias level or high kTC noise in the DQ array.

Parameters:
  • input (list of str or list of RampModel) – List of input file paths or ramp models to process.

  • max_cores (int, optional) – Maximum number of CPU cores to use for parallel processing. Default is 1.

  • kTC_threshold (float, optional) – Threshold kTC above which pixels are flagged as bad in the DQ array. Default is 100 DN.

  • bias_threshold (float, optional) – Threshold bias above which pixels are flagged as bad in the DQ array. Default is 1000 DN.

Returns:

output (BiasModel) – The derived bias calibration model containing the bias frame, kTC noise map, and updated DQ array.