hispecdrp.primitives.wavesol.wavesol_cheb2d_primitive

Functions

_build_wavesol_poly2d_structured(coeffs, ...)

_build_wavesol_poly2d_unstructured(coeffs, ...)

_normalize_val(x, lo, hi)

auto_deg_inter_order(n_orders[, ...])

Choose a Chebyshev inter-order degree from the number of fit orders.

fit_wavesol_chebyshev2d(pixels, orders, ...)

Fit a 2D Chebyshev polynomial to the wavelength solution data.

fit_wavesol_spline_1d(pixels, orders, waves, ...)

Per-order cubic spline through LFC (MU_PIX, WAVE).

Classes

CalculateChebyshev2DWLSPrimitive([dataset, ...])

Fit a wavelength solution from LFC line centroids.

class CalculateChebyshev2DWLSPrimitive(dataset=None, config=None, context=None, log_config=None, parent=None, **kwargs)[source]

Bases: BasePrimitive

Fit a wavelength solution from LFC line centroids.

The default wave_model='chebyshev2d' fits a 2D Chebyshev polynomial to {pixel, order, m*λ} (a grating-equation expansion). wave_model='cubic_spline_1d' instead interpolates each order with a cubic spline through (MU_PIX, WAVE). The spline is optional and is not the default.

Parameters:
  • wave_model ({'chebyshev2d', 'cubic_spline_1d'}) – Wavelength model used to fill wave_fib*. Default chebyshev2d.

  • deg_intra_order (int or 'auto') – Degree of the polynomial within an order (Chebyshev model only). 'auto' uses DEFAULT_DEG_INTRA_ORDER.

  • deg_inter_order (int or 'auto') – Degree of the polynomial between orders. If ‘auto’, it will be set based on the number of orders being fit.

  • max_iters (int) – Maximum number of iterations for the 2D fitting process.

  • sigma_cut (float) – Sigma clipping cutoff in units of standard deviation of the residuals.

  • max_vel_cut (float) – Maximum velocity cutoff for the residuals. Points with velocity residuals larger than this cutoff will be excluded from the fit in the next iteration. Units = m/s.

  • opt_weights (bool) – Whether to use optimized weights based on the input model’s wavelength errors. If False, uniform weights will be used. Default is True.

  • fit_orders (list of int or None) – List of orders to fit. If None, all orders will be fit.

  • do_fibers (list of int or None) – List of fibers to fit. If None, all fibers will be fit (separately in series).

Returns:

output (LFCWavesolModel) – The wavelength solution model.