Defines | |
| #define | USE_PPM 0 |
| #define | FIT_SLOPE 1 |
| #define | WEIGHTED_FIT 1 |
Functions | |
| static cpl_error_code | verify_calibration (const cpl_table *selected, const cpl_table *linetable, double TOLERANCE, double red_chisq) |
| Report quality of calibration. | |
| static cpl_error_code | compute_lambda (cpl_table *linetable, const polynomial *dispersion_relation, const polynomial *dispersion_variance, bool verbose) |
| Apply dispersion relation to line table. | |
| static int | identify_lines (cpl_table *linetable, const cpl_table *line_refer, double ALPHA) |
| Identify lines by comparing to catalogue wavelengths. | |
| static polynomial * | calibrate_global (const cpl_table *linetable, cpl_table **selected, int degree, bool verbose, bool reject, double TOLERANCE, double kappa, double *red_chisq, polynomial **dispersion_variance, double *pixelsize, double *rms_wlu, double *rms_pixels) |
| Create a fit of all orders. | |
| polynomial * | uves_wavecal_identify (cpl_table *linetable, const cpl_table *line_refer, const polynomial *guess_dispersion, int DEGREE, double TOLERANCE, double ALPHA, double MAXERROR, double kappa) |
| Obtain final dispersion relation. | |
| int | uves_wavecal_identify_lines_ppm (cpl_table *linetable, const cpl_table *line_refer) |
| Identify lines using point pattern matching. | |
| static double | xcenter (const cpl_image *image, const cpl_image *noise, int xlo, int xhi, int row, centering_method CENTERING_METHOD, int bin_disp, double *sigma, double *intensity, double *dx0, double *slope, double *background) |
| Refine the center position of an initially detected emission line. | |
| static cpl_error_code | detect_lines (const cpl_image *spectrum, const cpl_image *noise, const uves_propertylist *spectrum_header, bool flat_fielded, int RANGE, double THRESHOLD, centering_method CENTERING_METHOD, int bin_disp, const polynomial *order_locations, cpl_image *arcframe, cpl_table *linetable, int *ndetected, int *nrows) |
| Find emission lines above a certain threshold. | |
| cpl_table * | uves_wavecal_search (const cpl_image *spectrum, const cpl_image *noise, const uves_propertylist *spectrum_header, bool flat_fielded, const polynomial *order_locations, cpl_image *arcframe, int RANGE, int MINLINES, int MAXLINES, centering_method CENTERING_METHOD, int bin_disp) |
| Search for a given number of emission lines. | |
| lt_type * | uves_lt_new (int windows, int traces) |
| Allocate line table. | |
| void | uves_lt_delete (lt_type **lt) |
| Deallocate line table. | |
| cpl_table ** | uves_lt_get_table (const lt_type *lt, int window, int trace) |
| Get the table structure. | |
| polynomial ** | uves_lt_get_disprel (const lt_type *lt, int window, int trace) |
| Get dispersion relation. | |
| polynomial ** | uves_lt_get_absord (const lt_type *lt, int window, int trace) |
| Get absolute order polynomial. | |
| int * | uves_lt_get_firstabs (const lt_type *lt, int window, int trace) |
| Get first absolute order. | |
| int * | uves_lt_get_lastabs (const lt_type *lt, int window, int trace) |
| Get last absolute order. | |
| int | uves_wavecal_find_nearest (const cpl_table *line_refer, double lambda, int lo, int hi) |
| Find best matching catalogue wavelength. | |
| int | uves_delete_bad_lines (cpl_table *table, double TOLERANCE, double kappa) |
| Delete bad lines from line table. | |
| cpl_error_code | uves_draw_lines (cpl_image *image, polynomial *dispersion, const polynomial *order_locations, const cpl_table *t, const char *lambda_column, const char *abs_order, const int *relative_order, int minorder, int maxorder, bool vertical, int offset) |
| Draw lines in an echelle image. | |
|
||||||||||||||||||||
|
Report quality of calibration.
Definition at line 459 of file uves_wavecal_identify.c. References check, uves_msg, and uves_msg_warning. |
|
||||||||||||||||||||
|
Apply dispersion relation to line table.
Definition at line 538 of file uves_wavecal_identify.c. References check, passure, uves_msg_debug, uves_msg_warning, uves_polynomial_derivative_2d(), uves_polynomial_evaluate_2d(), and uves_polynomial_get_dimension(). Referenced by calibrate_global(), and uves_wavecal_identify(). |
|
||||||||||||||||
|
Identify lines by comparing to catalogue wavelengths.
An identification is made iff
The purpose of the first criterion is to make the correct identifications. The purpose of the latter two criterions is to avoid making incorrect identifications. If a line was previously identified (implied by a valid "Ident" column value) but now fails to meet the ID criterium, it is not deleted. Definition at line 687 of file uves_wavecal_identify.c. References assure, assure_mem, passure, uves_max_int(), uves_min_double(), uves_min_int(), uves_round_double(), and uves_wavecal_find_nearest(). Referenced by uves_wavecal_identify(). |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Create a fit of all orders.
Definition at line 1052 of file uves_wavecal_identify.c. References assure, assure_mem, check, check_nomsg, compute_lambda(), passure, uves_delete_bad_lines(), uves_msg_debug, uves_polynomial_delete(), uves_polynomial_regression_2d(), and uves_polynomial_regression_2d_autodegree(). Referenced by uves_wavecal_identify(). |
|
||||||||||||||||||||||||||||||||||||
|
Obtain final dispersion relation.
The function will iteratively identify as many of the detected lines as possible (using the specified wavelength catalogue, see also Definition at line 204 of file uves_wavecal_identify.c. References assure, calibrate_global(), check, compute_lambda(), identify_lines(), passure, uves_msg, uves_msg_debug, uves_polynomial_delete(), and uves_wavecal_identify_lines_ppm(). |
|
||||||||||||
|
Identify lines using point pattern matching.
Definition at line 1185 of file uves_wavecal_identify.c. References assure, check_nomsg, and uves_round_double(). Referenced by uves_wavecal_identify(). |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Refine the center position of an initially detected emission line.
uves_fit_gaussian_1d_image() with the "guess" values.The centering_method indicates whether to use the 'gravity' method or gaussian fitting and should always be set to CENTERING_GAUSSIAN . Definition at line 658 of file uves_wavecal_search.c. References assure, FIT_SLOPE, passure, uves_error_reset, uves_gauss(), uves_gauss_derivative(), uves_gauss_linear(), uves_gauss_linear_derivative(), uves_max_int(), uves_min_int(), uves_msg_debug, and WEIGHTED_FIT. Referenced by detect_lines(), and trace_order(). |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Find emission lines above a certain threshold.
The detected lines will be written to the columns "Y" (the relative order number), "X" (the line position), "Xwidth" (the detected line width (stddev in pixels)) and "Peak" (the detected emission line intensity). A line is detected iff the flux at a position is more than THRESHOLD plus the local background level, which is defined as the median of a window of width (2 * RANGE + 1) centered on the current position. If flat_fielding was done THRESHOLD is the peak height in units of error bars.
After the line is initially detected, the line position is calculated depending on the CENTERING_METHOD. See also The number of detected lines, ndetected, will be different from the number of rows written to the line table, nrows, only if the table is not large enough to contain all the detected lines. Finally, doublets (i.e. lines with positions within 2.0 pixels) are removed from the line table. The maximum number of lines to search for is defined by the number of available rows in the line table. If the provided arcframe is not NULL, the results of the line search will be marked on this image (used for debugging purposes). Definition at line 388 of file uves_wavecal_search.c. References assure, check, passure, uves_max_int(), uves_min_int(), uves_msg_debug, uves_pfits_get_crval2(), uves_polynomial_evaluate_2d(), uves_round_double(), uves_tostring_cpl_type(), and xcenter(). |
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
Search for a given number of emission lines.
detect_lines() . with varying detection threshold levels.The result line table contains the columns "Y" (the relative order number), "X" (the line positions), "Xwidth" (the detected line widths (stddev in pixels)) and "Peak" (the detected emission line intensities). Definition at line 179 of file uves_wavecal_search.c. References assure, check, detect_lines(), passure, uves_msg, and uves_tostring_cpl_type(). |
|
||||||||||||
|
Allocate line table.
Definition at line 110 of file uves_wavecal_utils.c. References lt_type::absolute_order, assure_mem, lt_type::dispersion_relation, lt_type::first_absolute_order, lt_type::last_absolute_order, lt_type::table, lt_type::traces, and lt_type::windows. |
|
|
Deallocate line table.
Definition at line 138 of file uves_wavecal_utils.c. References uves_polynomial_delete(). |
|
||||||||||||||||
|
Get the table structure.
Definition at line 172 of file uves_wavecal_utils.c. References lt_type::table, and lt_type::traces. |
|
||||||||||||||||
|
Get dispersion relation.
Definition at line 187 of file uves_wavecal_utils.c. References lt_type::dispersion_relation, and lt_type::traces. |
|
||||||||||||||||
|
Get absolute order polynomial.
Definition at line 201 of file uves_wavecal_utils.c. References lt_type::absolute_order, and lt_type::traces. |
|
||||||||||||||||
|
Get first absolute order.
Definition at line 215 of file uves_wavecal_utils.c. References lt_type::first_absolute_order, and lt_type::traces. |
|
||||||||||||||||
|
Get last absolute order.
Definition at line 229 of file uves_wavecal_utils.c. References lt_type::last_absolute_order, and lt_type::traces. |
|
||||||||||||||||||||
|
Find best matching catalogue wavelength.
Definition at line 252 of file uves_wavecal_utils.c. References uves_wavecal_find_nearest(). Referenced by identify_lines(), and uves_wavecal_find_nearest(). |
|
||||||||||||||||
|
Delete bad lines from line table.
Definition at line 304 of file uves_wavecal_utils.c. References assure, check, check_nomsg, and uves_average_reject(). Referenced by calibrate_global(). |
|
||||||||||||||||||||||||||||||||||||||||||||||||
|
Draw lines in an echelle image.
If abs_order is non-NULL, each wavelength is drawn on the order specified by abs_order. In this case minorder and maxorder are ignored. If abs_order is NULL, each wavelength is drawn on every order from minorder (inclusive) to maxorder (inclusive). This mode can be used to plot catalogue wavelengths that a priori are located in no specific order. The y position of a wavelength is inferred from the polynomial order_locations (the order table), and the x position is inferred from the dispersion relation. Definition at line 404 of file uves_wavecal_utils.c. References check, passure, uves_error_reset, uves_max_int(), uves_min_int(), uves_msg_debug, uves_polynomial_evaluate_2d(), uves_polynomial_get_dimension(), and uves_polynomial_solve_2d(). |
1.4.6