soxspipe.commonutils.horne_extraction¶
perform optimal source extraction using the Horne method (Horne 1986)
- Author
Marco Landoni & David Young
- Date Created
May 17, 2023
Module Contents¶
Classes¶
perform optimal source extraction using the Horne method (Horne 1986) |
Functions¶
This function is used to create a single, 1-pixel wide cross-dispersion slices of object data. When applied to the dataframe, a single slice is created for each discrete pixel position in the dispersion direction |
|
extract the object spectrum for a single order |
API¶
- soxspipe.commonutils.horne_extraction.create_cross_dispersion_slices(crossDispersionSlices)[source][source]¶
This function is used to create a single, 1-pixel wide cross-dispersion slices of object data. When applied to the dataframe, a single slice is created for each discrete pixel position in the dispersion direction
Key Arguments:
crossDispersionSlices– the seed dataframe
Return:
crossDispersionSlices– dataframe containing metadata for each cross-dispersion slice (single data-points in extracted spectrum)
- soxspipe.commonutils.horne_extraction.extract_single_order(crossDispersionSlices, funclog, ron, slitHalfLength, clippingSigma, clippingIterationLimit, globalClippingSigma, axisA, axisB, gain=1.0, hornePolyOrder=3, debug=False)[source][source]¶
extract the object spectrum for a single order
Return:
crossDispersionSlices– dataframe containing metadata for each cross-dispersion slice (single data-points in extracted spectrum)
- class soxspipe.commonutils.horne_extraction.horne_extraction(log, settings, recipeSettings, skyModelFrame, skySubtractedFrame, unflattenedFrame, twoDMapPath, recipeName=False, qcTable=False, productsTable=False, dispersionMap=False, sofName=False, locationSetIndex=False, startNightDate='', notFlattened=False, debug=False, turnOffMP=False)[source][source]¶
Bases:
objectperform optimal source extraction using the Horne method (Horne 1986)
Key Arguments:
log– loggersettings– the settings dictionaryrecipeSettings– the recipe specific settingsskyModelFrame– path to sky model frameskySubtractedFrame– path to sky subtracted frameunflattenedFrame– path to unflattened frametwoDMapPath– path to 2D dispersion map image pathrecipeName– name of the recipe as it appears in the settings dictionaryqcTable– the data frame to collect measured QC metricsproductsTable– the data frame to collect output products (if False no products are saved to file)dispersionMap– the FITS binary table containing dispersion map polynomialsofName– the set-of-files filenamelocationSetIndex– the index of the AB cycle locations (nodding mode only). Default FalsestartNightDate– YYYY-MM-DD date of the observation night. Default “”notFlattened– flag to indicate if the frame is flattened or not. Default Falsedebug– flag to indicate if debug mode is on (shows plots). Default FalseturnOffMP– turn off multiprocessing. True or False. Default False. If True, multiprocessing will be turned off and the recipe will run in serial. This is useful for debugging.
Usage:
To setup your logger, settings and database connections, please use the
fundamentalspackage (see tutorial here https://fundamentals.readthedocs.io/en/master/initialisation.html).To initiate a horne_extraction object, use the following:
from soxspipe.commonutils import horne_extraction optimalExtractor = horne_extraction( log=log, skyModelFrame=skyModelFrame, skySubtractedFrame=skySubtractedFrame, unflattenedFrame=unflattenedFrame, twoDMapPath=twoDMap, settings=settings, recipeName="soxs-stare", qcTable=qc, productsTable=products, dispersionMap=dispMap, sofName=sofName, locationSetIndex=locationSetIndex, startNightDate=startNightDate, debug=debug, turnOffMP=turnOffMP ) qc, products = optimalExtractor.extract()
Initialization
- extract()[source][source]¶
extract the full spectrum order-by-order and return FITS Binary table containing order-merged spectrum
Return:
qcTable– the data frame to collect measured QC metricsproductsTable– the data frame to collect output productsmergedSpectumDF– path to the FITS binary table containing the merged spectrum
- merge_extracted_orders(extractedOrdersDF)[source][source]¶
merge the extracted order spectra in one continuous spectrum
Key Arguments:
extractedOrdersDF– a data-frame containing the extracted orders
Return:
None