background: Fit and subtract a line or column background

Package: kpnoslit

Usage

background input output

Parameters

input
Images to be background subtracted. The images may contain image sections.
output
Output images to be created and modified. The number of output images must match the number of input images.
axis = 1
Axis along which to fit the background and subtract. Axis 1 fits and subtracts the background along the lines and axis 2 fits and subtracts the background along the columns.
interactive = yes
Set the fitting parameters interactively?
sample = "*"
Lines or columns to be used in the background fits. The default "*" selects all lines or columns.
function = spline3
Function to be fit to the image lines or columns. The functions are "legendre" (legendre polynomial), "chebyshev" (chebyshev polynomial), "spline1" (linear spline), and "spline3" (cubic spline). The functions may be abbreviated.
order = 1
The order of the polynomials or the number of spline pieces.
low_reject = 0., high_reject = 0.
Low and high rejection limits in units of the residual sigma.
niterate = 1
Number of rejection iterations.
grow = 1.
When a pixel is rejected, pixels within this distance of the rejected pixel are also rejected.
graphics = "stdgraph"
Graphics device for interactive graphics output.
cursor = ""
Graphics cursor input

Description

For each line or column in the input images a function is fit to the columns or lines specified by the sample parameter. This function is then subtracted from the entire line or column to create an output line or column. The function fitting parameters may be set interactively. This task is a script using fit1d. For more discussion about the parameters see the help text for icfit and fit1d.

Examples

A spectrum of an object runs down the center of a 500 x 500 image. To subtract a constant background using columns 10 to 100 and 410 to 500:

cl> background image image sample="10:100,410:500"

To subtract a quadratic background from the columns of an image in which the spectrum lies between lines 50 and 70:

cl> background image image axis=2 sample="1:40,80:120" o=3

See also

fit1d, icfit