soxspipe.commonutils.detect_order_edges

using a fully-illuminated slit flat frame detect and record the order-edges

Author

David Young & Marco Landoni

Date Created

September 18, 2020

Module Contents

Classes

detect_order_edges

using a fully-illuminated slit flat frame detect and record the order-edges

API

class soxspipe.commonutils.detect_order_edges.detect_order_edges(log, flatFrame, orderCentreTable, settings=False, recipeSettings=False, recipeName='soxs-mflat', verbose=False, qcTable=False, productsTable=False, tag='', sofName=False, binx=1, biny=1, extendToEdges=True, lampTag=False, startNightDate='', debug=False)[source][source]

Bases: soxspipe.commonutils._base_detect

using a fully-illuminated slit flat frame detect and record the order-edges

Key Arguments:

  • log – logger

  • settings – the settings dictionary

  • recipeSettings – the recipe specific settings

  • flatFrame – the flat frame to detect the order edges on

  • orderCentreTable – the order centre table

  • recipeName – name of the recipe as it appears in the settings dictionary

  • verbose – verbose. True or False. Default False

  • qcTable – the data frame to collect measured QC metrics

  • productsTable – the data frame to collect output products

  • tag – e.g. ‘_DLAMP’ to differentiate between UV-VIS lamps

  • sofName – name of the originating SOF file

  • binx – binning in x-axis

  • biny – binning in y-axis

  • extendToEdges – if true, extend the order edge tracing to the edges of the frame (Default True)

  • lampTag – add this tag to the end of the product filename (Default False)

  • startNightDate – YYYY-MM-DD date of the observation night. Default “”

Usage:

from soxspipe.commonutils import detect_order_edges
edges = detect_order_edges(
    log=log,
    flatFrame=flatFrame,
    orderCentreTable=orderCentreTable,
    settings=settings,
    recipeSettings=recipeSettings,
    recipeName="soxs-mflat",
    verbose=False,
    qcTable=False,
    productsTable=False,
    extendToEdges=True,
    lampTag=False
)
productsTable, qcTable, orderDetectionCounts = edges.get()

Initialization

calculate_residuals(orderPixelTable, coeff, axisACol, axisBCol, orderCol=False, writeQCs=False)[source]
determine_lower_upper_edge_pixel_positions(orderData)[source][source]

from a pixel postion somewhere on the trace of the order centre, return the lower and upper edges of the order

Key Arguments:

  • orderData – one row in the orderTable

Return:

  • orderData – orderData with upper and lower edge xcoord arrays added

determine_order_flux_threshold(orderData, orderPixelTable)[source][source]

determine the flux threshold at the central column of each order

Key Arguments:

  • orderData – one row in the orderTable

  • orderPixelTable the order table containing pixel arrays

Return:

  • orderData – orderData with min and max flux thresholds added

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]

get the detect_order_edges object

Return:

  • orderTablePath – path to the new order table

plot_results(orderPixelTableUpper, orderPixelTableLower, orderPolyTable, orderMetaTable, clippedDataUpper, clippedDataLower)[source][source]

generate a plot of the polynomial fits and residuals

Key Arguments:

  • orderPixelTableUpper – the pixel table with residuals of fits for the upper edges

  • orderPixelTableLower – the pixel table with residuals of fits for the lower edges

  • orderPolyTable – data-frame of order-location polynomial coeff

  • orderMetaTable – data-frame containing the limits of the fit

  • clippedDataUpper – the sigma-clipped data from upper edge

  • clippedDataLower – the sigma-clipped data from lower edge

Return:

  • filePath – path to the plot pdf

write_order_table_to_file(frame, orderPolyTable, orderMetaTable)[source]