hispecdrp.primitives.lsf.lsf_gauss_primitive

Functions

_build_lsf_poly2d_structured(coeffs, pixels, ...)

_build_lsf_poly2d_unstructured(coeffs, ...)

_normalize_val(x, lo, hi)

fit_gausslsf_chebyshev2d(pixels, orders, ...)

Fit a 2D Chebyshev polynomial to the Gaussian sigmas (units microns) as a function of pixel and echelle order.

Classes

CalculateGaussianLSFPrimitive([dataset, ...])

NOTE: Under development

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

Bases: BasePrimitive

NOTE: Under development

Calculate a Gaussian LSF model by fitting a 2D Chebyshev polynomial to the Gaussian FWHMs as a function of pixel and echelle order.

The unstructured set of points {x_i, m_i, sigma_i} is fit with a 2D Chebyshev polynomial and then evaluated at each detecor pixel to determine the appropriate Gaussian LSF width at that pixel and wavelength. The LSF width is never updated according to any drifts. The LSF can then be calculated at any sub-pixel or wavelength by interpolating the resulting sigmas at each pixel.

Parameters:
  • input (str or DataModel) – Input data model or path to input data model. The input data model must contain the attribute lfc_fitparams_fib# for each fiber, where # is the fiber number.

  • do_fibers (list[int] | None) – List of fibers to fit. If None, fit all fibers.

  • fit_orders (list[int] | None) – List of echelle orders to fit. If None, fit all orders.

  • deg_intra_order (int) – Degree of the polynomial within an order.

  • deg_inter_order (int | 'auto') – Degree of the polynomial between orders. If ‘auto’, the degree is determined based on the number of orders being fit.

  • opt_weights (bool) – Whether to use the inverse variance of the FWHM measurements as weights in the fit. Default is True.

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

  • sigma_cut (float) – Cutoff for the residuals in terms of standard deviation for iterative outlier rejection. If None, no outlier rejection is performed.

Returns:

output_model (GaussianLSFModel) – Output data model containing the fitted Gaussian LSF parameters.