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 |
Read User's options. | |
def | __call__ |
The run is launched here. | |
def | getModelAbsoluteAndRelativeOrderPositions |
computes and returns the absolute and relative orderpositions of the frame. More... | |
def | isBetterSolutionNeeded |
checks if we need to search for a better model by excluding outliers. More... | |
def | getBivariatePolynomialValue |
computes and returns the result of the bivariate polynomial (our model) for a given order and row/column index. More... | |
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 | |
orderMid | |
default value. More... | |
rowMid | |
same | |
maxAllowedIterations | |
maxAllowedIterations is an integer, default is 1 | |
areVirtualEdgeOrdersAdded | |
areVirtualEdgeOrdersAdded : Boolean, defaults is True | |
polyorder | |
PolynomeDegreeInOrderDirection is integer, defaults is 3. | |
polyrow | |
PolynomeDegreeInRowDirection is an integer, defaults is 3. | |
tolerance | |
tolerance is a float, defaults is 4.5 | |
isDifferential | |
isDifferential is a Boolean, defaults is True | |
isDebug | |
isDebug is False by default. More... | |
areRelativeCoordinates | |
areRelativeCoordinates is a boolean, default is True | |
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 contains several types of two-dimensional model functions that may represent the positions of the spectral orders on the detector. At present, only the bivariate-polynomial model is included. It accepts input data weighted that passed the credibility test set-up in measureOrderPosition. Data obtained during commissioning time, or a dedicated study by an instrument maintainer can result in a more robust model (less parameters involved to obtain the same or better precision). The accuracy of the model and trends of the deviations (in terms of a number of parameters) can be evaluated. Standard evaluation includes: \n - rms of the residuals 'observed - computed' position ("O - C") in bins of correlation coefficients; \n - non-parametric statistics on the number of changes of sign in subsequent "O - C" along spectral order; \n - correlation between "O - C" and the discretisation of the cross-order profile i.e. the sub-pixel position of the centre of the spectral order in the considered cross-cut COMMENTS : Two-dimensional models are more robust than a sequence of one-dimensional models (each one for a specific spectral order) and have the advantage that low-quality input data can be masked or appropriately weighted, even in the case that they cover a significant part of a given order. Data not used in the merged final spectra, for reasons of optical quality or vignetting, should never be included. INPUT CONSTANTS FROM INSTRUMENT MODEL : MANDATORY : INPUT DATA FROM RESULTDICT : MANDATORY : differentialOrderPosition array with the measured change in order position MeasuredOrderPositions # not seen in tex # Is a masked array with the relative/absolute order positions template. ccCoefficientsMeasureOrderPosition array with the cross-correlation coefficients obtained at all shifts OPTIONS READ FROM OPTIONDICT : MANDATORY : PolynomeDegreeInOrderDirection (int) default is 3 It corresponds to the degree of the bivariate polynomial in the cross order direction. (i.e. the degree is therefore 7 per default) PolynomeDegreeInRowDirection (in) default is 3 It corresponds to the degree of the bivariate polynomial in the cross row direction. (i.e. the degree is therefore 5 per default) areRelativeCoordinates (boolean) default is True De we used relative CCD coordinates to model the order positions OPTIONAL : areVirtualEdgeOrdersAdded (boolean) hardcoded value is True to measure the background we need one additional order on both sides of the CCD maxAllowedIterations maximum number of iterations allowed to remove accidental outliers. default = 3 isDebug (boolean) default is True debug information is written when this parameter is True. When true, you will find in the self.results["DebugPath"], the following fits files: mAbsOPos.fits OUTPUT written in the RESULTDICT : modelOrderPositionCoefficients Are the coefficients of the bivariate polynomial. modelAbsoluteOrderPositions Is a MxN frame, where M is the row/column index and N is the order-1 number, that contains the column/row index of the order center of the image.
def hermes.pipeline.components.modelorderpositions.modelOrderPositions.getBivariatePolynomialValue | ( | self, | |
iorder, | |||
index, | |||
coefs | |||
) |
computes and returns the result of the bivariate polynomial (our model) for a given order and row/column index.
Coefficients must be provided.
def hermes.pipeline.components.modelorderpositions.modelOrderPositions.getModelAbsoluteAndRelativeOrderPositions | ( | self | ) |
computes and returns the absolute and relative orderpositions of the frame.
def hermes.pipeline.components.modelorderpositions.modelOrderPositions.isBetterSolutionNeeded | ( | self, | |
relativePositions, | |||
modelRelativePositions | |||
) |
checks if we need to search for a better model by excluding outliers.
It returns a boolean and the relativePositions with an updated mask.
hermes.pipeline.components.modelorderpositions.modelOrderPositions.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.
hermes.pipeline.components.modelorderpositions.modelOrderPositions.orderMid |
default value.
Means that we do not express the order and row/column index relatively to the middle of the CCD