col_subbg

sofia_redux.spectroscopy.extspec.col_subbg(col_arc, col_image, col_var, col_apmask, col_mask, bgorder, robust=4.0, **kwargs)[source]

Fit background to a single column.

Parameters:
col_arcnumpy.ndarray of float

(nrow,) spatial coordinates

col_imagenumpy.ndarray of float

(nrow,) column image values

col_varnumpy.ndarray of float

(nrow,) variance of image column

col_apmasknumpy.ndarray of float

(nrow,) background mask where 0 indicates a background pixel

col_masknumpy.ndarray of bool

(nrow,) True indicates a valid image pixel, False indicates a bad pixel.

bgorderint

Order of polynomial to fit to the background

robustfloat

Robust threshold.

kwargsdict

Additional parameters to pass to polyfitnd.

Returns:
corrected_image, corrected_var, coefficients3-tuple of numpy.ndarray

The column with background subtracted (nrow,), the corrected variance (nrow,) and the polynomial coefficients fit to the background (bgorder + 1,).