pyhrs:docs

wavelength_calibrate_order

pyhrs.wavelength_calibrate_order(hrs, slines, sfluxes, ws_init, fit_ws, y0=50, npoints=30, xlimit=1.0, slimit=1.0, wlimit=0.5)[source] [edit on github]

Wavelength calibration of a single order from the HRS arc spectra

The calibration proceeds through following steps: 1. Curvature due to the optical distortion is removed from the spectra and

a square representation of the 2D spectra is created. Only integer shifts are applied to the data
  1. A model of the spectrograph is created based on the order, camera, and xpos offset that are supplied.
  2. In each row of the data, peaks are extracted and matched with a line in the atlas of wavelengths that is provided (slines, sflux). For the details of the matching process, see the match_arc function.
  3. Once the first set of peaks and lines are matched up, a new solution is calculated for the given row. Then the processes of matching lines and determining a wavelength solution is repeated. The best result from each line is saved.
  4. Using all of the matched lines from all lines, a ‘best’ solution is determined. Everything but the zeroth order parameter of the fit is fixed to a slowly varying value based on the overall solution to all lines. See fit_solution for more details.
  5. Based on the best solution found, the process is repeated for each row but only determing the zeropoint.
  6. Based on the solution found, a wavelength is assigned to each pixel
Parameters:

hrs: ~HRSOrder

Object describing a single HRS order. It should already contain the defined order and the flux from the arc for that order

slines: numpy.ndarray

wavelengths of known arc lines

sfluxes: numpy.ndarray

relative fluxes at those wavelengths

ws_init: ~astropy.modeling.model

A initial model decribe the trasnformation from x-position to wavelength

fit_ws: ~astropy.modeling.fitting

Method to fit the model

y0: int

First row for determine the solution

npoints: int

The maximum number of points to bright points to fit.

xlimit: float

Maximum shift in line centroid when fitting

slimit: float

Minimum scale for line when fitting

wlimit: float

Minimum separation in wavelength between peak and line

Returns:

hrs: ~HRSOrder

An HRSOrder with a calibrated wavelength property