3.3.2. getPeaksAndPolynomials
Extract etalon peak positions and fit line profile parameters.
TODO: Rewrite docstring to make reference to maroonx_fit module
3.3.2.1. Parameters
- adinputslist of
AstroData Input AstroData objects with 1D box extracted etalon spectra. Must have ETALON tag.
- guess_filestr, optional
Path to file containing initial guess spectrum for peak positions. Default is None.
- fiberslist of int, optional
Fiber numbers to process. Valid values are 1-5. If None, automatically detects fibers with ETALON or LFC fiber type. Default is None.
- orderslist of int, optional
Order numbers to process. If None, all orders are processed. Default is None.
- degree_sigmaint, optional
Polynomial degree for Gaussian sigma variation along order. Default is 4.
- degree_widthint, optional
Polynomial degree for box width variation along order. Default is 2.
- use_sigma_lrbool, optional
If True, use different polynomial coefficients for left and right Gaussian wings. Default is True.
- show_plotsbool, optional
If True, generate diagnostic plots of etalon line fits. Automatically disabled if multithreading is True. Default is False.
- plot_pathstr, optional
Directory path for saving diagnostic plots when show_plots is True. Default is empty string (current directory).
- multithreadingbool, optional
If True, use multiprocessing to parallelize fiber/order fitting. Disables show_plots option. Default is False.
- iterationsint, optional
Maximum number of iterative fitting cycles. Default is 8.
- suffixstr, optional
Suffix to append to output filenames. Default is empty string.
3.3.2.2. Returns
- list of
AstroData Input frames with the following extensions added:
PEAKS: Peak parameters including centroid positions, intensities, and widths for each detected etalon line.POLY: Polynomial coefficients describing how box width and Gaussian sigma vary across each order.
3.3.2.3. Notes
The iterative fitting algorithm may fail for orders with excessive cosmic rays or artifacts. Failed fits are logged as warnings.
Known bad pixels are masked during fitting (e.g., pixel 1943 in order 122, first 400 pixels in truncated red arm order 94 fiber 5).
3.3.2.4. Parameter defaults and options
suffix '' Filename suffix
guess_file None Name of file containing initial guess spectrum.
fibers None List of fibers to process.
orders None List of orders to process.
degree_sigma 4 Degree of the sigma polynomial
degree_width 2 Degree of the width polynomial
use_sigma_lr True Use different polynomials for the left and right sides of the wings
multithreading False Use multithreading
iterations 8 Number of iterations
3.3.2.5. Algorithm
Todo
add description
3.3.2.6. Issues and Limitations
Todo
add description