pynrc.reduce.ref_pixels.chrem_med¶
- pynrc.reduce.ref_pixels.chrem_med(imarr, nchans=4, yind=None, bpmask=None, in_place=True, mean_func=<function median>)[source]¶
Subtract Amplifier Channel Offsets
Sometimes amplifiers have offsets relative to each other due to imperfect tracking of reference pixels. This function determines the average offset from zero of each channel and subtracts the mean/median from the entire channel.
- Parameters
imarr (ndarray) – Array of image (or single image).
nchans (int) – Number of amplifier readout channels.
yind (array-like) – Two element array to select a y-range for calculating the channel offset.
bpmask (bool array) – Bad pixel mask (1 for bad, 0 for good). Can either be a single image or image cube of same size as imarr.
in_place (bool) – Correct in-place? If False, returns a copy of the array with channels offset.
mean_func (func) – Function to use for performing the mean calculation.