Hermes DRS  6.0
reduction software
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Public Attributes | List of all members
hermes.pipeline.components.extractOrders.extractOrders Class Reference

Extract the (weighted) flux in each spectral order class extractOrdersSimpleSumCosmicsRemoved(PipelineComponent): More...

Inheritance diagram for hermes.pipeline.components.extractOrders.extractOrders:
hermes.pipeline.core.pipelinecomponent.PipelineComponent

Public Member Functions

def __init__
 Make a Hermes component and initialize variables.
 
def optionsAreValid
 read user-defined values
 
def makeFileName
 This builds the correct filenames for fiber LRF_WRF It is always used to build the output file name.
 
def __call__
 run begins here
 
- Public Member Functions inherited from hermes.pipeline.core.pipelinecomponent.PipelineComponent
def __init__
 
def __call__
 
def optionsAreValid
 
def getOptions
 
def setOptions
 
def checkExistShapeUnits
 
def isOption
 

Public Attributes

 imageNumber
 Default values.
 
 isDebug
 User may set this flag in order to get intermediary result files generated in the debug folder.
 
 BlemishedPixelsMasked
 User may eventually discard this feature.
 
 compareExtractionMethods
 User may eventually discard this feature.
 
 checkValidityCrossorderProfile
 User may eventually discard this feature.
 
 areVirtualEdgeOrdersAdded
 User may eventually discard this feature.
 
 removeCosmics
 User may eventually discard this feature.
 
 fsafe
 User gives another fsafe value for cosmic clipping check overwriting values in run/absoluteDRS. More...
 
 fcrit
 User gave another fcrit value for cosmic removal check overwriting values in run/absoluteDRS.
 
 results
 
- Public Attributes inherited from hermes.pipeline.core.pipelinecomponent.PipelineComponent
 options
 
 logger
 
 ConsoleLogSeverity
 default value
 
 canShowGraphics
 when machine does not run matplotlib. More...
 

Detailed Description

Extract the (weighted) flux in each spectral order class extractOrdersSimpleSumCosmicsRemoved(PipelineComponent):

PURPOSE :

This module 'sums' the flux in a given detector row over all pixels
contributing to the same bin in a specific spectral order. The
algorithm assumes that the flux can be computed as a weighted sum of
the fluxes on the contributing pixels (at least background and bias
subtracted) over an extration slit whose length can differ for
different spectral orders. Weights can include pre-defined masks
(to eliminate data on detector blemishes), a pre-defined normalised
cross-order profile, and estimates of the rms scatter on the fluxes
in the pixels. Radiation events (cosmic rays) can be identified, and
the corresponding pixels are masked out. The default extraction modes
provided in the pipeline data reduction are: \n
    - unweighted sum of the flux on all pixels   \n

    - flux with pre-defined masks and cosmic ray detection \n

    - weighted extraction including pre-defined masks and cosmic ray detection,
    but using the pre-defined normalised cross-order profile and the error
    estimates on the data to define quasi-optimal weights \n

Details about the position and intensity of cosmic rays can be saved for
further analysis.




COMMENTS :


The optimal extraction mode with normalised cross-order profiles (COP) estimated
from the proper data is not included, but the instrument model contains an
algorithm to derive normalised cross-order profiles from (several) high
signal-to-noise frames. \n


SYNTAX :

self.results = extractOrders(self.results, instrumentModel)


INPUT :

subtractBackgroundImage = Image: background-subtracted image resulting from subtractBackground
subtractBackgroundVarImage = VarImage: corresponding variance image

positions of spectral orders as determined in modelOrderPositions
    xslitpos: array (nrow x norder) of positions of slit center for (rowy, orderk)

from MODEL :
mSlit (orderk): length of extraction slit (can vary with order k)
masks (of the same dimensions as subtractBackgroundImage)
    with always invalid pixels : at least the product of
    stronglyHotPixelMask * stronglyDarkPixelMask
    rejected pixels are set to 1
    cosmicRayMask (optional)
offsetExtractionSlitXXX[maxSlitWidth,100]
    where XXX=fiberMode (HRF,LRF,WCF,2F)
    = 2-D array giving the offset of the first pixel in the slit
    for a given slit width and indexSlitPos
    (indexSlitPos is roughly the fractional part of xSlitPos)
    This valus has to be added to the central pixel to get the first pixel to be extracted.
    There a currently 9 rows (slit width from 9 to 17 pixels)
fluxCorExtractionSlitXXX[maxSlitWidth,100]
    where XXX=fiberMode (HRF,LRF,WCF,2F)
    = 2-D array giving the multiplicative correction factor that has to be applied
    to the extracted flux in order to correct for the fractional edge pixels
    This factoris given for a given slit width and indexSlitPos (like offsetExtractionSlitXXX)
    There a currently 9 rows (slit width from 9 to 17 pixels)
crossOrderProfileXXX[100,atLeastMslitMax]
    where XXX=fiberMode (HRF,LRF,WCF,2F)
    = 2-D array containing normalized cross-order profile
    for each possible value of indexSlitPos
    (indexSlitPos is roughly the fractional part of xSlitPos)
    with a resolution of 1 pixel.


OPTIONS :

All options are to be placed in the OptionDict.
WeightedSimpleSum (True/False) : switch is present but commented out : both cases are computed

    MANDATORY :
        switches for extraction method :
            BlemishedPixelsMasked   (remove all permanently bad pixels)
            withPreDefinedCrossOrderProfile

        switches for optional output :
            identifyRadiationEvents   : YES / NO
            compareExtractionMethods  : YES / NO
            validityCrossorderProfile : YES / NO
    OPTIONAL :

        isDebug (boolean)
            default value : True

            When True :
                writes results to fits files
                display COP profiles for selected rows and orders
                display extracted flux


OUTPUT :

MANDATORY :

    extracted flux as straightforward seen over valid pixels correlated for masked pixels
    variance over this extracted flux.
    percentage of flux on valid pixels at each cross-cut.

    extracted flux as above but masking also pixels blemished by radiation events
    variance over this extracted flux.
    percentage of flux on valid pixels at each cross-cut.

    extracted flux using a predefined normalised cross-order profile as weight and excluding masked pixels
    variance over this extracted flux.
    percentage of flux on valid pixels at each cross-cut.

    extracted flux using a predefined normalised cross-order profile as weight and excluding masked pixels and those blemished by radiation events
    variance over this extracted flux.
    percentage of flux on valid pixels at each cross-cut.

    AJ: Put these 4 blocks in a single image

OPTIONAL :
    (optional output will primarily be used in test phases and for maintenance purposes)
    identifyRadiationEvents = YES :
        difference of extracted flux when including or excluding pixels blemished by radiation events
    compareExtractionMethods = YES :
        ratio of extracted flux with or without use of a predefined normalized cross-order profile for the case with pixels blemished by radiation events rejected
    validityCrossorderProfile = YES :
        for all pixels in each slot : residual "observed-predicted" counts (for comparaison with variance input frame).

Member Data Documentation

hermes.pipeline.components.extractOrders.extractOrders.fsafe

User gives another fsafe value for cosmic clipping check overwriting values in run/absoluteDRS.

it is the number of safety pixels we add at both sides of the order

when they are None, user did not gave values. we must use the default from instrumentModel.


The documentation for this class was generated from the following file: