Trace

Mode:

Trace

Usage:

Offline, Online

Key:

MegaraTraceMap

Product:

TraceMap.

Recipe:

TraceMapRecipe

Recipe input:

TraceMapRecipeInput

Recipe result:

TraceMapRecipeResult

Although for the majority of the observing modes described elsewhere in this document the MEGARA off-line pipeline will perform its own fiber spectra extraction from the 2D CCD FITS frame, there are cases where an archival master “trace map” should be used instead. Note that a different “trace map” should be available for each pseudo-slit and VPH combination.

Requirements

This observing mode should include the actions needed to obtain a series of Fiber-flats that should be combined to generate a master “trace map”. This will be done by means of illuminating the instrument focal plane with a continuum (halogen) lamp that is part of the GTC Instrument Calibration Module (ICM). The use of the twilight sky is not recommended in this case as the twilight sky can present strong absorption lines that could lead to errors in the resulting trace map at specific wavelengths.

This mode requires having the ICM turned on, one of the halogen lamps at the ICM also turned on, to configure the focal-plane cover (at least one of the sides should be open), to have the instrument shutter open, to move the pseudo-slit to that of the instrument mode of choice, to configure the VPH wheel mechanism in order to select the grating to be used, to move the focusing mechanism to the position pre-defined for the specific VPH of choice and to expose a certain time and to readout the detector a series of exposures, being this series the trace map image set.

Procedure

The “User” processes an observing block obtained in the observing mode Trace. This mode includes the required actions to obtain a mapping of the trace of the fibers. The master trace map generated is used in other stages of the data processing.

Products

Trace map image sets are to be obtained both as part of the activities related to the verification of the instrument status and for processing data for scientific exploitation. Note, however, that the use of this observing mode for scientific exploitation should be limited as it could affect to the general performance of the on-line quick-look software.

This mode produces the tracing information required to extract the flux of the fibers. The result is stored in an object named master_traces of type TraceMap.

Recipe

class megaradrp.recipes.calibration.trace.TraceMapRecipe(*args, **kwargs)

Provides tracing information from continuum flat images.

This recipe process a set of continuum flat images obtained in Trace Map mode and returns the tracing information required to perform fiber extraction in other recipes. The recipe also returns the result of processing the input images upto dark correction.

See also

megaradrp.products.tracemap.TraceMap

description of TraceMap product

megaradrp.recipes.calibration.modelmap.ModelMapRecipe

description of ModelMap recipe

numina.array.trace.traces

tracing algorithm

megaradrp.instrument.configs

instrument configuration

Notes

Images provided in obresult are trimmed and corrected from overscan, bad pixel mask (if master_bpm is not None), bias and dark current (if master_dark is not None). Images thus corrected are the stacked using the median.

The result of the combination is saved as an intermediate result, named ‘reduced_image.fits’. This combined image is also returned in the field reduced_image of the recipe result and will be used for tracing the position of the fibers.

The fibers are grouped in packs of different numbers of fibers. To match the traces in the image with the corresponding fibers is neccessary to know how fibers are packed and where the different groups of fibers appear in the detector. This information is provided by the fields ‘pseudoslit.boxes’ and ‘pseudoslit.boxes_positions’ of the instrument configuration.

Using the column reference provided by ‘pseudoslit.boxes_positions’, peaks are detected (using an average of 7 columns) and matched to the layout of fibers provided by ‘pseudoslit.boxes_positions’. Fibers without a matching peak are counted and their ids stored in the final master_traces object.

Once the peaks in the reference column are found, each one is traced until the border of the image is reached. The trace may be lost before reaching the border. In all cases, the beginning and the end of the trace are stored.

The Y position of the trace is fitted to a polynomial of degree polynomial_degree. The coefficients of the polynomial are stored in the final master_traces object.

RecipeInput

alias of TraceMapRecipeInput

RecipeResult

alias of TraceMapRecipeResult

class TraceMapRecipeInput(*args, **kwds)

TraceMapRecipeInput documentation.

Attributes:
debug_plotint, requirement, optional

Save intermediate tracing plots

master_biasMasterBias, requirement

Master BIAS image

master_bpmMasterBPM, requirement, optional

Master Bad Pixel Mask

master_darkMasterDark, requirement, optional

Master DARK image

obresultObservationResultType, requirement

Observation Result

polynomial_degreeint, requirement, optional, default=5

Polynomial degree of trace fitting

reference_columnint, requirement, optional, default=2000

Column used to search for peaks

reference_column_hwint, requirement, optional, default=5

Half-width (w = 2 * hw + 1) of the region used to search for peaks

relative_thresholdfloat, requirement, optional, default=0.3

Threshold for peak detection

class TraceMapRecipeResult(*args, **kwds)

TraceMapRecipeResult documentation.

Attributes:
master_tracesTraceMap, product
reduced_imageProcessedImage, product
reduced_rssProcessedRSS, product
run(rinput)

Execute the recipe.

Parameters:
rinputTraceMapRecipe.RecipeInput
Returns:
TraceMapRecipe.RecipeResult
Raises:
ValidationError

if the recipe input is invalid

run_qc(recipe_input, recipe_result)

Run quality control checks