Wavelength Calibration
Functions | |
cpl_image * | giraffe_compute_pixel_abcissa (cpl_matrix *m_wavelengths, GiSlitGeometry *fiber_slit_position, cpl_matrix *m_opt_mod_params, lmrq_model lmrq_opt_mod_x) |
X abcissa computation. | |
cxint | giraffe_wavelength_calibration (GiTable *result, GiExtraction *extraction, GiLocalization *localization, GiTable *grating, GiTable *slitgeo, GiTable *wavelengths, GiWcalConfig *config, GiWcalSolution *wavcoeff) |
Perform Wavelength Calibration. | |
void | giraffe_wavecalibration_config_add (cpl_parlist *list) |
Adds parameters for the Wavelength Calibration. | |
GiWcalConfig * | giraffe_wavecalibration_config_create (cpl_parlist *list) |
Creates a setup structure for the Wavelength Calibration. | |
void | giraffe_wavecalibration_config_destroy (GiWcalConfig *config) |
Destroys a setup structure for the Wavecalibration. | |
GiWcalSolution * | giraffe_wcalsolution_new (void) |
Create a new GiWcalSolution. | |
void | giraffe_wcalsolution_delete (GiWcalSolution *ws) |
Destroy an GiWcalSolution. | |
void | giraffe_wcalsolution_dump (GiWcalSolution *ws) |
Dump the the information contained in a GiWcalSolution to output. | |
GiWcalSolution * | giraffe_wcalsolution_create (GiTable *wavesolution) |
Create a wavecalibration results structure based on a GiTable read from disk. |
Detailed Description
Main processing functions for Wavelength Calibration
- Retrieves Grating Data
- Retrieves Slit Geometry Data
- Retrieves Wavelength Catalog Data
- Remove crowded wavelengths from wavelength catalog
- Calculate X position of reference wavelenghts
- Perform LMRQ Fit of reference lines to actual data
- Update wavelength information in fitted image
- Perform fitting of PSF X width
- Find optimal physical optical parameters (optional)
- Update X and Y coordinates based on (new) physical optical model parameters
- Find Residulas of observerd versus computed solution
- Fit Residuals to polynomial
- Calculate Statistics of fit
Function Documentation
cpl_image* giraffe_compute_pixel_abcissa | ( | cpl_matrix * | m_wavelengths, | |
GiSlitGeometry * | fiber_slit_position, | |||
cpl_matrix * | m_opt_mod_params, | |||
lmrq_model | lmrq_opt_mod_x | |||
) |
X abcissa computation.
- Parameters:
-
m_wavelengths wavelengths of reference lines {mm} [nwlen] fiber_slit_position Fiber X and Y slit positions {mm} m_opt_mod_params X optical model parameters: (ny{pix},ypixsize{mm},fcoll{mm},cfact, gtheta{rad},gorder,gspace{mm}, slitdx{mm},slitdy{mm},slitphi{rad}) lmrq_opt_mod_x Physical optical model to use.
- Returns:
- xref image [nwlen,ns] of X abcissa for each line and spectrum or NULL if an error occured
- Description
- This procedure computes, for a given combination of spectrum (actually fibre) stored in fiber_slit_position and reference wavelength m_wavelengths[1..nwlen], the absolute position (in pixels, along the spectrum) on the extracted spectra image. This is done using a theoretical-physical optical model optical model lmrq_opt_mod_x() and model parameters specified in m_opt_mod_params().
- Attention:
- The returned image xref must be freed using cpl_image_delete().
- See also:
- giraffe_fit_opt_mod()
- mrqxoptmod()
- mrqxoptmod2()
- lmrq_model
Definition at line 1117 of file giwavecalib.c.
References lmrq_model::cfunc, and lmrq_model::ninputs.
void giraffe_wavecalibration_config_add | ( | cpl_parlist * | list | ) |
Adds parameters for the Wavelength Calibration.
- Parameters:
-
list Parameter list to which parameters are added.
- Returns:
- Nothing.
- Description :
- TBD
Definition at line 5634 of file giwavecalib.c.
GiWcalConfig* giraffe_wavecalibration_config_create | ( | cpl_parlist * | list | ) |
Creates a setup structure for the Wavelength Calibration.
- Parameters:
-
list Parameter list from which the setup informations is read.
- Description :
- Creates a setup structure for the Wavelength Calibration
- Returns:
- A newly allocated and initialized setup structure if no errors occurred, or
NULL
otherwise.
Definition at line 5959 of file giwavecalib.c.
References GiWcalConfig::bright_count, GiWcalConfig::bright_threshold, GiWcalConfig::fit_subslits, GiWcalConfig::flux_ratio, giraffe_wavecalibration_config_destroy(), GiWcalConfig::line_dchsq, GiWcalConfig::line_model, GiWcalConfig::line_niter, GiWcalConfig::line_ntest, GiWcalConfig::line_offset, GiWcalConfig::line_reswidratio, GiWcalConfig::line_threshold, GiWcalConfig::line_widexpo, GiWcalConfig::line_widths, GiWcalConfig::opt_direction, GiWcalConfig::opt_mod_dchsq, GiWcalConfig::opt_mod_niter, GiWcalConfig::opt_mod_ntest, GiWcalConfig::opt_model, GiWcalConfig::opt_solution, GiWcalConfig::pxw_clip_level, GiWcalConfig::pxw_clip_mfrac, GiWcalConfig::pxw_clip_niter, GiWcalConfig::pxw_poly_x_deg, GiWcalConfig::pxw_poly_y_deg, GiWcalConfig::range_wlen_max, GiWcalConfig::range_wlen_min, GiWcalConfig::xws_clip_level, GiWcalConfig::xws_clip_mfrac, GiWcalConfig::xws_clip_niter, GiWcalConfig::xws_poly_x_deg, and GiWcalConfig::xws_poly_y_deg.
void giraffe_wavecalibration_config_destroy | ( | GiWcalConfig * | config | ) |
Destroys a setup structure for the Wavecalibration.
- Parameters:
-
config The setup structure to destroy.
- Returns:
- Nothing.
- Description :
- The function deallocates the memory used by the setup structure config.
Definition at line 6268 of file giwavecalib.c.
References GiWcalConfig::line_widths.
Referenced by giraffe_wavecalibration_config_create().
cxint giraffe_wavelength_calibration | ( | GiTable * | result, | |
GiExtraction * | extraction, | |||
GiLocalization * | localization, | |||
GiTable * | grating, | |||
GiTable * | slitgeo, | |||
GiTable * | wavelengths, | |||
GiWcalConfig * | config, | |||
GiWcalSolution * | wavcoeff | |||
) |
Perform Wavelength Calibration.
- Parameters:
-
result extraction localization grating slitgeo wavelengths config wavcoeff
- Description:
- Needs to be written...
- Returns:
- ==0 if successfull, >0 if an error occured
- Status Codes :
- 1 = Error in input parameters (NULL value somewhere) 2 = Could not read necessary value from FITS Keyword 3 = Error retrieving grating data 4 = Error retrieving slit geometry data 5 = Error retrieving wavelength setup 6 = Error eliminating crowded wavelengths 7 = Invalid line fitting model 8 = Error during line fitting 9 = Error updating wavelength data 10 = Error during PSF Fitting 11 = Error during optical model fitting 12 = Error during optical residuals fitting 13 = Error removing bad lines 14 = Error computing position of reference wavelengths
Definition at line 4643 of file giwavecalib.c.
References GiGrating::band, GiGrating::fcoll, GiWcalConfig::fit_subslits, GiWcalConfig::flux_ratio, GiGrating::gcam, giraffe_grating_delete(), giraffe_grating_new(), giraffe_grating_setup(), giraffe_image_delete(), giraffe_image_get(), giraffe_image_get_properties(), giraffe_image_new(), giraffe_imagestack_delete(), giraffe_imagestack_get(), giraffe_imagestack_set(), giraffe_slitgeometry_create(), giraffe_slitgeometry_delete(), giraffe_table_delete(), giraffe_table_duplicate(), giraffe_table_get(), giraffe_table_get_properties(), giraffe_table_new(), giraffe_table_set_properties(), GiWcalConfig::line_dchsq, GiWcalConfig::line_model, GiWcalConfig::line_niter, GiWcalConfig::line_ntest, GiWcalConfig::line_offset, GiWcalConfig::line_reswidratio, GiWcalConfig::line_threshold, GiWcalConfig::line_widexpo, GiWcalConfig::line_widths, lmrq_model::name, GiWcalConfig::opt_direction, GiWcalConfig::opt_mod_dchsq, GiWcalConfig::opt_mod_niter, GiWcalConfig::opt_mod_ntest, GiWcalConfig::opt_model, GiWcalConfig::opt_solution, GiGrating::order, GiWcalConfig::pxw_clip_level, GiWcalConfig::pxw_clip_mfrac, GiWcalConfig::pxw_clip_niter, GiWcalConfig::pxw_poly_x_deg, GiWcalConfig::pxw_poly_y_deg, GiGrating::resol, GiGrating::sdx, GiGrating::sdy, GiGrating::space, GiGrating::sphi, GiGrating::theta, GiGrating::wlen0, GiWcalConfig::xws_clip_level, GiWcalConfig::xws_clip_mfrac, GiWcalConfig::xws_clip_niter, GiWcalConfig::xws_poly_x_deg, and GiWcalConfig::xws_poly_y_deg.
GiWcalSolution* giraffe_wcalsolution_create | ( | GiTable * | wavesolution | ) |
Create a wavecalibration results structure based on a GiTable read from disk.
- Parameters:
-
wavesolution GiTable containing wavecalibration solution
- Returns:
- Pointer to new GiWcalSolution or NULL if an error occured
- Description:
- Creates a GiWcalSolution structure filled with the coefficients of the wavecalibration solution which are stored in the GiTable wavesolution
Definition at line 172 of file giwavecalib_types.c.
References giraffe_slitgeometry_delete(), giraffe_slitgeometry_new(), giraffe_slitgeometry_resize(), giraffe_slitgeometry_set(), giraffe_table_get(), and giraffe_table_get_properties().
void giraffe_wcalsolution_delete | ( | GiWcalSolution * | ws | ) |
Destroy an GiWcalSolution.
- Parameters:
-
ws GiWcalSolution to destroy
- Description:
- Destroys an GiWcalSolution and frees all associated memory
Definition at line 84 of file giwavecalib_types.c.
References giraffe_slitgeometry_delete().
void giraffe_wcalsolution_dump | ( | GiWcalSolution * | ws | ) |
Dump the the information contained in a GiWcalSolution to output.
- Parameters:
-
ws GiWcalSolution to dump
- Description:
- Dump the information contained in a GiWcalSolution ws using the CPL messaging subsystem.
Definition at line 109 of file giwavecalib_types.c.
References giraffe_matrix_dump(), giraffe_slitgeometry_get(), and giraffe_slitgeometry_size().
GiWcalSolution* giraffe_wcalsolution_new | ( | void | ) |
Create a new GiWcalSolution.
- Returns:
- Pointer to newly created GiWcalSolution or NULL if an error occured
- Description :
- Creates a new GiWcalSolution
Definition at line 57 of file giwavecalib_types.c.