Construct a differential (or absolute) model for the positions of the spectral orders. More...
Public Member Functions | |
def | __init__ |
Make a Hermes component and initialize variables. | |
def | optionsAreValid |
check user's options | |
def | __call__ |
run entry point | |
def | locateOrdersOnRow |
a first estimate of the order positions is used to locate the orders more accurately. More... | |
def | writeMidOrders |
def | checkPositionConsistency |
check if there is a large difference with the previous position it also returns the reference that should be used | |
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 | |
isDebug | |
isDebug is False by default. More... | |
positionDev | |
positionDev comes from option largerPositionDeviationAllowed default is 2 | |
crossAxis | |
default for crossAxis is 0 More... | |
rowStep | |
default for rowStep is 1 | |
shiftApproximateOrderPositions | |
default for shiftApproximateOrderPositions is 0.0 | |
minShift | |
default for minShift is -3 | |
minShiftForCopCorrelation | |
default for minShiftForCopCorrelation is -5 | |
maxShiftForCopCorrelation | |
default for maxShiftForCopCorrelation is +5 | |
results | |
Public Attributes inherited from hermes.pipeline.core.pipelinecomponent.PipelineComponent | |
options | |
logger | |
ConsoleLogSeverity | |
default value | |
canShowGraphics | |
when machine does not run matplotlib. More... | |
Construct a differential (or absolute) model for the positions of the spectral orders.
PURPOSE : This module was developed to search the order positions on the model template. It starts from scratch (almost). COMMENTS : SYNTAX : INPUT CONSTANTS FROM INSTRUMENT MODEL : MANDATORY : INPUT DATA FROM RESULTDICT : MANDATORY : crossOrderProfile (array) Cross order profile centerCrossOrderProfile (int) Pixel on which the center of the cross order profile is centered. OPTIONAL : middleCcdRowOrderPositionsAfterCut (list of floats) Is a list that contains the order positions on the middle row of the ccd. This should in theory be saved in the instrument config file. After cut. ReferenceRow (int) index of the reference row used to measure the ApproximateOrderPositionsOnMiddleRow if ApproximateOrderPositionsOnMiddleRow, then this must be set. OPTIONS READ FROM OPTIONDICT : MANDATORY : crossAxis (int 0 or 1) Is the cross order axis. Its value is 1 or 0. Could be written in the InstrumentConfig. Default is 0 RowStepForTheOrderPositionsSearch (int > 0) Is the row step used to derive the order positions. "1" means that the positions are derived for all the orders. Default is 1 isDebug (boolean) default is True Set this parameter to true to write debug information in the self.results["DebugPath"] path. the following fits files will be written: foundorderpositions.fits maximaoftheccf.fits largerPositionDeviationAllowed (int) default is 2 The determination of the order positions on a row is based on the previous positions. If the new position is different by more than largerPositionDeviationAllowed pixels from the previous value, then the position is masked (put at 0) and the value used to derive the next position is the same (i.e. if we derive the position of order k in row n, and that its position in row n+1 is masked, then we use the position in row n to determine the positions in row n+2). [find a better way to explain this] OPTIONAL : shiftApproximateOrderPositions (float) default is 0. used if the first estimate of the order positions on midrow is only shifted by a fractional number of floats. OUTPUT written in the RESULTDICT : AbsoluteOrderPositionsInTemplate (Frame) Is a frame where all non zero values are the positions of the orders on the template. If RowStepForTheOrderPositionsSearch = 1, there should be no zero values. Dimensions are [NRow x NOrder]. NRow number of row (cross-order direction) and NOrder number of orders. MaximaOfTheCrossCorrelationFunctions (Frame) Containes the value of the maximum of the cross correlation function used to locate the order. It has the same dimensions than AbsoluteOrderPositionsInTemplate.
def hermes.pipeline.components.searchorderpositions.searchOrderPositions.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.
hermes.pipeline.components.searchorderpositions.searchOrderPositions.crossAxis |
default for crossAxis is 0
from the middle row to the first.
just to avoid extrapolation if the rowStep is too large
for the middle row
next one generates a pyfits message "Card is too long, comment will be truncated." header [ "HIERARCH shiftApproximateOrderPositions" ] = ( self.shiftApproximateOrderPositions, name )
try not to produce too long cards Here we first check if the approximate order positions of the midrow was determined previously and saved in the result dictionary Here we first check if the approximate order positions of the midrow was determined previously and saved in the result dictionary YF: we should add the 50 in the dictionary because I added it to the COP header keyword is:
hermes.pipeline.components.searchorderpositions.searchOrderPositions.isDebug |
isDebug is False by default.
When set to True, intermediate files are written in the debug folder. This is meant to let the user find out why his results are not the expected ones. Usually it reflects a change in the instrument that has to be fixed.