soxspipe.commonutils.detect_continuum¶
find and fit the continuum trace across all echelle orders with low-order polynomials.
- Author
David Young & Marco Landoni
- Date Created
September 10, 2020
Module Contents¶
Classes¶
find and fit the continuum trace across all echelle orders with low-order polynomials. |
API¶
- class soxspipe.commonutils.detect_continuum.detect_continuum(log, traceFrame, dispersion_map, settings=False, recipeSettings=False, recipeName=False, qcTable=False, productsTable=False, sofName=False, binx=1, biny=1, lampTag=False, locationSetIndex=False, orderPixelTable=False, startNightDate='', debug=False)[source][source]¶
Bases:
soxspipe.commonutils.detect_continuum._base_detectfind and fit the continuum trace across all echelle orders with low-order polynomials.
Key Arguments:
log– loggertraceFrame– calibrated frame containing a source trace (CCDObject)dispersion_map– path to dispersion map file containing polynomial fits of the dispersion solution for the framesettings– the settings dictionaryrecipeSettings– the recipe specific settingsrecipeName– the recipe name as given in the settings dictionaryqcTable– the data frame to collect measured QC metricsproductsTable– the data frame to collect output productssofName—- name of the originating SOF filebinx– binning in x-axisbiny– binning in y-axislampTag– add this tag to the end of the product filename. Default FalselocationSetIndex– the index of the AB cycle locations (nodding mode only). Default FalseorderPixelTable– this is used for tuning the pipeline. Default FalsestartNightDate– YYYY-MM-DD date of the observation night. Default “”debug– if True then extra debugging information is printed. Default False
Usage:
To use the
detect_continuumobject, use the following:from soxspipe.commonutils import detect_continuum detector = detect_continuum( log=log, traceFrame=traceFrame, dispersion_map=dispersion_map, settings=settings, recipeName="soxs-order-centres" ) order_table_path = detector.get()
Initialization
- calculate_residuals(orderPixelTable, coeff, axisACol, axisBCol, orderCol=False, writeQCs=False)[source]¶
- create_pixel_arrays()[source][source]¶
create a pixel array for the approximate centre of each order
Return:
orderPixelTable– a data-frame containing lines and associated pixel locationsdmBinx– the dispersion map binning in xdmBiny– the dispersion map binning in y
- fit_1d_gaussian_to_slices(orderPixelTable, sliceLength, medianStddev=False)[source][source]¶
Optimized version of Gaussian fitting to slices
- fit_global_polynomial(pixelList, axisACol='cont_x', axisBCol='cont_y', orderCol='order', exponentsIncluded=False, writeQCs=False)[source]¶
- fit_order_polynomial(pixelList, order, axisBDeg, axisACol, axisBCol, exponentsIncluded=False)[source]¶
- get()[source][source]¶
return the order centre table filepath
Return:
order_table_path– file path to the order centre table giving polynomial coeffs to each order fit
- plot_results(orderPixelTable, orderPolyTable, clippedData)[source][source]¶
generate a plot of the polynomial fits and residuals
Key Arguments:
orderPixelTable– the pixel table with residuals of fitsorderPolyTable– data-frame of order-location polynomial coeffclippedData– the sigma-clipped data
Return:
filePath– path to the plot pdforderMetaTable– dataframe of useful order fit metadata