HeNeAr_fit

pydis.HeNeAr_fit(calimage, linelist='apohenear.dat', interac=True, trim=True, fmask=(1, ), display=False, tol=10, fit_order=2, previous='', mode='poly', second_pass=True)[source]

Determine the wavelength solution to be used for the science images. Can be done either automatically (buyer beware) or manually. Both the manual and auto modes use a “slice” through the chip center to learn the wavelengths of specific HeNeAr lines. Emulates the IDENTIFY function in IRAF.

If the automatic mode is selected (interac=False), program tries to first find significant peaks in the “slice”, then uses a brute-force guess scheme based on the grating information in the header. While easy, your mileage may vary with this method.

If the interactive mode is selected (interac=True), you click on features in the “slice” and identify their wavelengths.

Parameters
calimagestr

Path to the HeNeAr calibration image

lineliststr, optional

The linelist file to use in the resources/linelists/ directory. Only used in automatic mode. (Default is apohenear.dat)

interacbool, optional

Should the HeNeAr identification be done interactively (manually)? (Default is True)

trimbool, optional

Trim the image using the DATASEC keyword in the header, assuming has format of [0:1024,0:512] (Default is True)

fmaskarray-like, optional

A list of illuminated rows in the spatial direction (Y), as returned by flatcombine.

displaybool, optional
tolint, optional

When in automatic mode, the tolerance in pixel units between linelist entries and estimated wavelengths for the first few lines matched… use carefully. (Default is 10)

modestr, optional

What type of function to use to fit the entire 2D wavelength solution? Options include (poly, spline2d). (Default is poly)

fit_orderint, optional

The polynomial order to use to interpolate between identified peaks in the HeNeAr (Default is 2)

previousstring, optional

name of file containing previously identified peaks. Still has to do the fitting.

Returns
wfitbivariate spline object or 2d polynomial

The wavelength solution at every pixel. Output type depends on the mode keyword above (poly is recommended)