Hermes DRS  6.0
reduction software
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
hermes.pipeline.components.generatecop.generateCop Class Reference
Inheritance diagram for hermes.pipeline.components.generatecop.generateCop:
hermes.pipeline.core.pipelinecomponent.PipelineComponent

Public Member Functions

def __init__
 Make a Hermes component and initialize variables.
 
def optionsAreValid
 read user-defined values
 
def getOrderMaskForBivariate
 
def __call__
 
def phaseD
 
def isSlitDifferent
 
def isCopDifferent
 
def discretization
 
def mountProfile
 
def modelComplete
 
def modelCore
 
def siSmoth
 
def modelWings
 
def modelFarWings
 
def getCenter
 
def locateOrdersOnRow
 a first estimate of the order positions is used to locate the orders more accurately. More...
 
def prepareCrossCut
 
def getIdx
 
- 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

 midOrder
 
 midRow
 
 halfWidthOfTheCore
 crontab does not run pylab. More...
 
 overLap
 
 widthOfWings
 
- Public Attributes inherited from hermes.pipeline.core.pipelinecomponent.PipelineComponent
 options
 
 logger
 
 ConsoleLogSeverity
 default value
 
 canShowGraphics
 when machine does not run matplotlib. More...
 

Static Public Attributes

tuple pRow = n.min( og, axis = 0 )
 og = self.results["modelAbsoluteOrderPositions"][:,1:56] provides the positions of the "highest point" of the order
 
list cop = self.results[ "crossOrderProfile" ]
 we should read the 50 = centeredIdx from the model (it is saved in the cop fits file)
 
list sizeCop = cop.shape[ 0 ]
 
list ccop = self.results[ "centerCrossOrderProfile" ]
 
int nSum = self.bluest-self.reddest+1
 
tuple posx = n.zeros( [ nSum ], int )
 
tuple posy = n.zeros( [ nSum ], float )
 
 l = u-self.reddest
 
tuple er = n.where( og [ : , l ] == pRow [ l ], 1, 0 )
 
tuple cops = n.zeros( [ nSum, sizeCop ], float )
 
tuple xS = n.zeros( [ nSum, sizeCop ], float )
 
tuple xC = n.zeros( ( ( nSum - 1 ) * sizeCop ), float )
 
tuple yC = n.zeros( ( ( nSum - 1 ) * sizeCop ), float )
 
tuple sumT = n.sum( cops [ k, : ], axis = 0 )
 
tuple frac = ( 0.49 - posy [ k ] % 1.0)
 
tuple surf = n.sum( cops [ k, : ] )
 
int zC = yC+xC*10000
 
tuple xCS = n.sort( xC )
 
tuple yCS = n.sort( zC )
 
tuple icCOP = self.getCenter( xCS, yCS )
 
 hWiCore = self.halfWidthOfTheCore
 
 ov = self.overLap
 
list coreCOPx = []
 
list coreCOPy = []
 
list leftCOPx = []
 
list leftCOPy = []
 
list rightCOPx = []
 
list rightCOPy = []
 
list fLeftCOPx = []
 
list fLeftCOPy = []
 
list fRightCOPx = []
 
list fRightCOPy = []
 
tuple yT = self.mountProfile( xfl, yfl, xl, yl, xco, yco, xr, yr, xfr, yfr, xCS, yCS )
 
tuple xTmp = n.zeros( [ xCS.shape [ 0 ] + 1 ], float )
 
tuple yTmp = n.zeros( [ xCS.shape [ 0 ] + 1 ], float )
 
 xCS = xTmp
 
 yT = yTmp
 
 devC = ccop-icCOP
 
 residuals = yT-yCS
 
tuple maxCOP = n.max( ycF )
 
tuple fig = plt.figure( )
 
 doGraphics = True
 
tuple ax1 = fig.add_subplot( 411 )
 
tuple ax2 = fig.add_subplot( 412 )
 
tuple ax3 = fig.add_subplot( 413 )
 
tuple ax4 = fig.add_subplot( 414 )
 
list date = self.results[ "inputImageHeader" ]
 please add a date as title
 
int centeredIdx = 0
 
int kl = 0
 
tuple xx = n.arange( sizeCop )
 
tuple newCop = zeros( ( 100, sizeCop ), float )
 
tuple yy = self.discretization( xcF, ycF, xx, shift, s1 = s2, k1 = k2 )
 
 centeredIdx = kl
 
list obsd = imHead[ "DATE-OBS" ]
 
tuple date = ( ( obsd.split ( "T" ) ) [ 0 ] )
 
tuple idx = inputFile.split( "_" )
 
tuple slits = n.array( ( og.shape [ 1 ] ) * [ int ( n.rint ( slitW ) + 1 ) ] )
 

Detailed Description

PURPOSE :

    Generate, on the fly, the cross order profile using the FF.

COMMENTS :

    This procedure is not iterative. It starts from an a priori knowledge of the order positions.
    These positions are computed using the model coefficients found in the header of the order
    position template in the model. In a second step the COP is measured and smoothed.
    The COP is therefore divided in 3 regions: core, wings and far-wings. Each of these regions
    are modeled in a somewhat different way. The size of these regions depends on the observing mode
    (HRF/LRF). Once the COP is generated, the reduction may proceed to the extraction.

SYNTAX :


INPUT CONSTANTS FROM INSTRUMENT MODEL :

    Order position template: we need the coefficients of the bivariate polynomial used to represent
        the position of the order centers.
    COP: The COP in the model is assumed to be the one used to measure the order positions during the
        night used as reference in the model. We use this profile to generate an instrument warning.

INPUT DATA FROM RESULTDICT :


OPTIONS READ FROM OPTIONDICT :

MANDATORY :


OPTIONAL :



OUTPUT WRITTEN TO THE RESULTDICT:

Are always written :
    path2mslit - Slit widths derived from the new COP. These widths are also saved in the file
        XXXXXXXX_HRF_FF_mslit.fits and after verification can be used to make a new model.
    crossOrderProfile - Updated cross order profile. Is also saved in the file
        XXXXXXXX_HRF_FF_COP.fits. After verification (you can check f.e. the corresponding png file)
        this file can also be used to create a new model.

When success condition is not met :



SUCCESS CONDITIONS :

Member Function Documentation

def hermes.pipeline.components.generatecop.generateCop.__call__ (   self,
  instrumentModel,
  container = None 
)
Main method
@param self.results: result dictionary
@type self.results: self.results
@param instrumentModel: instrument model
@type instrumentModel: instrumentModel
@return self.results: result dictionary
@rtype self.results: self.results
def hermes.pipeline.components.generatecop.generateCop.locateOrdersOnRow (   self,
  apOrdPos,
  imageLine,
  cop,
  ccop 
)

a first estimate of the order positions is used to locate the orders more accurately.

Input: apOrdPos, the approximate order position (generally we assume that the approximate order position is the order position on the previous row. In that case, we just need to put (or to locate) the order positions of the first row (here we take the middle row where more signal is available. row, is the CCD row we are studying, cop, is the cross order profile, ccop, is the center of the cop.

Member Data Documentation

hermes.pipeline.components.generatecop.generateCop.halfWidthOfTheCore

crontab does not run pylab.

This makes it possible to run the reduction anyway, but without graphics.


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