Functions | |
xsh_wavesol * | xsh_wavesol_create (cpl_frame *spectral_format_frame, xsh_detect_arclines_param *params, xsh_instrument *instrument) |
Create a new wavelength solution structure. | |
xsh_wavesol * | xsh_wavesol_duplicate (xsh_wavesol *org) |
duplicate a wavelength solution structure | |
void | xsh_wavesol_add_poly (xsh_wavesol *to, xsh_wavesol *from) |
void | xsh_wavesol_free (xsh_wavesol **w) |
free wavelength solution structure | |
cpl_polynomial * | xsh_wavesol_get_poly (xsh_wavesol *sol) |
get the solution in Y | |
void | xsh_wavesol_set_type (xsh_wavesol *wsol, enum wavesol_type type) |
set the type of the wave table | |
enum wavesol_type | xsh_wavesol_get_type (xsh_wavesol *wsol) |
get the type of the wave table | |
cpl_polynomial * | xsh_wavesol_get_polx (xsh_wavesol *sol) |
get the solution in X | |
cpl_propertylist * | xsh_wavesol_get_header (xsh_wavesol *sol) |
get header of the table | |
double | xsh_wavesol_eval_polx (xsh_wavesol *sol, double lambda, double order, double slit) |
eval the polynomial solution in X | |
double | xsh_wavesol_eval_poly (xsh_wavesol *sol, double lambda, double order, double slit) |
eval the polynomial solution in Y | |
void | xsh_wavesol_compute (xsh_wavesol *sol, int size, double *pos, double *posmin, double *posmax, double *lambda, double *order, double *slit, cpl_polynomial *result) |
compute a wavelength solution | |
void | xsh_wavesol_residual (xsh_wavesol *sol, xsh_wavesol *adj, int size, double *new_pos, double *lambda, double *order, double *slit, cpl_polynomial *result, char axis) |
cpl_frame * | xsh_wavesol_save (xsh_wavesol *w, cpl_table *trace, const char *filename, const char *tag) |
save a wavelength solution | |
xsh_wavesol * | xsh_wavesol_load (cpl_frame *frame, xsh_instrument *instrument) |
load a wavelength solution | |
void | xsh_wavesol_dump (xsh_wavesol *wsol, const char *fname, int nb) |
cpl_table * | xsh_wavesol_trace (xsh_wavesol *wsol, double *lambda, double *order, double *slit, int size) |
void | xsh_wavesol_set_bin_x (xsh_wavesol *wsol, int bin) |
Set the bin of wave table in x. | |
void | xsh_wavesol_set_bin_y (xsh_wavesol *wsol, int bin) |
Set the bin of wave table in y. | |
void | xsh_wavesol_apply_shift (xsh_wavesol *wsol, float shift_x, float shift_y) |
Apply a shift on X and Y to wave solution. |
void xsh_wavesol_add_poly | ( | xsh_wavesol * | to, | |
xsh_wavesol * | from | |||
) |
Calculates the sum of the coefficients of poly polynomial.
to | Result wavesol | |
from | Original wavesol |
Definition at line 186 of file xsh_data_wavesol.c.
References check, xsh_wavesol::deg_lambda, xsh_wavesol::deg_order, xsh_wavesol::poly, and xsh_msg_dbg_high.
void xsh_wavesol_apply_shift | ( | xsh_wavesol * | wsol, | |
float | shift_x, | |||
float | shift_y | |||
) |
Apply a shift on X and Y to wave solution.
[in] | wsol | The wavesolution to shift |
[in] | shift_x | The shift in X |
[in] | shift_y | The shift in Y |
Definition at line 1080 of file xsh_data_wavesol.c.
References xsh_wavesol::max_x, xsh_wavesol::max_y, xsh_wavesol::min_x, xsh_wavesol::min_y, and XSH_ASSURE_NOT_NULL.
Referenced by xsh_flexcor(), and xsh_ifu_wavetab_create().
void xsh_wavesol_compute | ( | xsh_wavesol * | sol, | |
int | size, | |||
double * | pos, | |||
double * | posmin, | |||
double * | posmax, | |||
double * | lambda, | |||
double * | order, | |||
double * | slit, | |||
cpl_polynomial * | result | |||
) |
compute a wavelength solution
sol | The Wavesolution to compute | |
size | Number of entries in the data vectors | |
pos | Pointer to position arrray | |
[out] | posmin | Pointer to minimum of the position |
[out] | posmax | Pointer to maximum of the position |
[in] | lambda | Array of wavelength |
[in] | order | Array of orders |
[in] | slit | Array of slits |
result | Calculated polynomial |
Definition at line 495 of file xsh_data_wavesol.c.
References check, xsh_wavesol::deg_lambda, xsh_wavesol::deg_order, xsh_wavesol::deg_slit, xsh_wavesol::max_lambda, xsh_wavesol::max_order, xsh_wavesol::max_slit, xsh_wavesol::min_lambda, xsh_wavesol::min_order, xsh_wavesol::min_slit, xsh_wavesol::nbcoefs, XSH_ASSURE_NOT_ILLEGAL, XSH_ASSURE_NOT_NULL, XSH_CALLOC, XSH_FREE, XSH_SLIT_RANGE, xsh_tools_min_max(), xsh_tools_tchebitchev_transform_tab(), and y.
Referenced by data_wavesol_fit_with_sigma(), xsh_detect_arclines(), and xsh_detect_arclines_dan().
xsh_wavesol* xsh_wavesol_create | ( | cpl_frame * | spectral_format_frame, | |
xsh_detect_arclines_param * | params, | |||
xsh_instrument * | instrument | |||
) |
Create a new wavelength solution structure.
[in] | spectral_format_frame | The spectral format frame |
[in] | params | Pointer to the parameters structure |
[in] | instrument | The instrument structure |
Definition at line 73 of file xsh_data_wavesol.c.
References xsh_spectralformat::absorder, xsh_wavesol::bin_x, xsh_wavesol::bin_y, check, xsh_wavesol::deg_lambda, xsh_wavesol::deg_order, xsh_wavesol::deg_slit, xsh_wavesol::dim, xsh_wavesol::header, xsh_spectralformat::lambda_max_full, xsh_spectralformat::lambda_min_full, xsh_spectralformat_list::list, xsh_wavesol::max_lambda, xsh_wavesol::max_order, xsh_wavesol::min_lambda, xsh_wavesol::min_order, xsh_wavesol::nbcoefs, xsh_wavesol::polx, xsh_wavesol::poly, xsh_spectralformat_list::size, xsh_detect_arclines_param::wavesol_deg_lambda, xsh_detect_arclines_param::wavesol_deg_order, xsh_detect_arclines_param::wavesol_deg_slit, XSH_ASSURE_NOT_NULL, xsh_instrument_get_binx(), xsh_instrument_get_biny(), XSH_MALLOC, xsh_msg_dbg_high, xsh_spectralformat_list_free(), and xsh_spectralformat_list_load().
Referenced by xsh_detect_arclines(), and xsh_detect_arclines_dan().
void xsh_wavesol_dump | ( | xsh_wavesol * | wsol, | |
const char * | fname, | |||
int | nb | |||
) |
Definition at line 957 of file xsh_data_wavesol.c.
References check, xsh_wavesol::deg_lambda, xsh_wavesol::deg_order, xsh_wavesol::deg_slit, xsh_wavesol::poly, and xsh_msg.
xsh_wavesol* xsh_wavesol_duplicate | ( | xsh_wavesol * | org | ) |
duplicate a wavelength solution structure
org | Original structure |
Definition at line 150 of file xsh_data_wavesol.c.
References xsh_wavesol::bin_x, xsh_wavesol::bin_y, xsh_wavesol::deg_lambda, xsh_wavesol::deg_order, xsh_wavesol::deg_slit, xsh_wavesol::dim, xsh_wavesol::header, xsh_wavesol::max_lambda, xsh_wavesol::max_order, xsh_wavesol::max_slit, xsh_wavesol::max_x, xsh_wavesol::max_y, xsh_wavesol::min_lambda, xsh_wavesol::min_order, xsh_wavesol::min_slit, xsh_wavesol::min_x, xsh_wavesol::min_y, xsh_wavesol::nbcoefs, xsh_wavesol::polx, xsh_wavesol::poly, and XSH_MALLOC.
double xsh_wavesol_eval_polx | ( | xsh_wavesol * | sol, | |
double | lambda, | |||
double | order, | |||
double | slit | |||
) |
eval the polynomial solution in X
sol | the wavelength solution | |
lambda | lambda value | |
order | order value | |
slit | slit value |
Definition at line 336 of file xsh_data_wavesol.c.
References xsh_wavesol::bin_x, check, convert_data_to_bin(), xsh_wavesol::deg_lambda, xsh_wavesol::deg_order, xsh_wavesol::deg_slit, xsh_wavesol::max_lambda, xsh_wavesol::max_order, xsh_wavesol::max_slit, xsh_wavesol::max_x, xsh_wavesol::min_lambda, xsh_wavesol::min_order, xsh_wavesol::min_slit, xsh_wavesol::min_x, xsh_wavesol::polx, XSH_ASSURE_NOT_NULL, xsh_free_vector(), xsh_tools_tchebitchev_poly_eval(), xsh_tools_tchebitchev_reverse_transform(), and xsh_tools_tchebitchev_transform().
Referenced by clean_arclist_data(), fill_rectified(), main(), xsh_afcthetab_create(), xsh_build_ifu_cube(), xsh_create_poly_wavemap(), xsh_detect_arclines(), xsh_detect_arclines_dan(), xsh_flexcor(), xsh_opt_extract_orders(), xsh_resid_tab_create(), xsh_resid_tab_create_not_flagged(), xsh_wavesol_residual(), and xsh_wavesol_trace().
double xsh_wavesol_eval_poly | ( | xsh_wavesol * | sol, | |
double | lambda, | |||
double | order, | |||
double | slit | |||
) |
eval the polynomial solution in Y
sol | the wavelength solution | |
lambda | lambda value | |
order | order value | |
slit | slit value |
Definition at line 412 of file xsh_data_wavesol.c.
References xsh_wavesol::bin_y, check, convert_data_to_bin(), xsh_wavesol::deg_lambda, xsh_wavesol::deg_order, xsh_wavesol::deg_slit, xsh_wavesol::max_lambda, xsh_wavesol::max_order, xsh_wavesol::max_slit, xsh_wavesol::max_y, xsh_wavesol::min_lambda, xsh_wavesol::min_order, xsh_wavesol::min_slit, xsh_wavesol::min_y, xsh_wavesol::poly, XSH_ASSURE_NOT_NULL, xsh_free_vector(), xsh_tools_tchebitchev_poly_eval(), xsh_tools_tchebitchev_reverse_transform(), and xsh_tools_tchebitchev_transform().
Referenced by clean_arclist_data(), data_wavesol_fit_with_sigma(), fill_rectified(), main(), xsh_afcthetab_create(), xsh_build_ifu_cube(), xsh_create_poly_wavemap(), xsh_detect_arclines(), xsh_detect_arclines_dan(), xsh_flexcor(), xsh_opt_extract_orders(), xsh_resid_tab_create(), xsh_resid_tab_create_not_flagged(), xsh_spectralformat_check_wlimit(), xsh_wavesol_residual(), and xsh_wavesol_trace().
void xsh_wavesol_free | ( | xsh_wavesol ** | w | ) |
free wavelength solution structure
w | adress of pointer on wavelength solution to DEALLOCATED |
Definition at line 219 of file xsh_data_wavesol.c.
References xsh_free_polynomial(), xsh_free_propertylist(), and xsh_free_vector().
Referenced by clean_arclist_data(), xsh_afcthetab_create(), xsh_create_poly_wavemap(), xsh_data_check_spectralformat(), xsh_detect_arclines(), xsh_detect_arclines_dan(), xsh_flexcor(), xsh_ifu_wavetab_create(), xsh_opt_extract_orders(), xsh_rectify_orders(), and xsh_wavesol_load().
cpl_propertylist* xsh_wavesol_get_header | ( | xsh_wavesol * | sol | ) |
get header of the table
sol | the wavelength solution |
Definition at line 315 of file xsh_data_wavesol.c.
References xsh_wavesol::header, and XSH_ASSURE_NOT_NULL.
Referenced by xsh_detect_arclines(), and xsh_detect_arclines_dan().
cpl_polynomial* xsh_wavesol_get_polx | ( | xsh_wavesol * | sol | ) |
get the solution in X
sol | the wavelength solution |
Definition at line 297 of file xsh_data_wavesol.c.
References xsh_wavesol::polx, and XSH_ASSURE_NOT_NULL.
Referenced by xsh_detect_arclines(), and xsh_detect_arclines_dan().
cpl_polynomial* xsh_wavesol_get_poly | ( | xsh_wavesol * | sol | ) |
get the solution in Y
sol | the wavelength solution |
Definition at line 240 of file xsh_data_wavesol.c.
References xsh_wavesol::poly, and XSH_ASSURE_NOT_NULL.
Referenced by data_wavesol_fit_with_sigma().
enum wavesol_type xsh_wavesol_get_type | ( | xsh_wavesol * | wsol | ) |
get the type of the wave table
wsol | the wavelength solution |
Definition at line 279 of file xsh_data_wavesol.c.
References xsh_wavesol::type, XSH_ASSURE_NOT_NULL, and XSH_WAVESOL_GUESS.
Referenced by xsh_resid_tab_create(), and xsh_resid_tab_create_not_flagged().
xsh_wavesol* xsh_wavesol_load | ( | cpl_frame * | frame, | |
xsh_instrument * | instrument | |||
) |
load a wavelength solution
frame | input frame | |
instrument | instrument arm setting |
Definition at line 849 of file xsh_data_wavesol.c.
References xsh_wavesol::bin_x, xsh_wavesol::bin_y, check, xsh_wavesol::deg_lambda, xsh_wavesol::deg_order, xsh_wavesol::deg_slit, xsh_wavesol::dim, xsh_wavesol::header, xsh_wavesol::max_lambda, xsh_wavesol::max_order, xsh_wavesol::max_slit, xsh_wavesol::max_x, xsh_wavesol::max_y, xsh_wavesol::min_lambda, xsh_wavesol::min_order, xsh_wavesol::min_slit, xsh_wavesol::min_x, xsh_wavesol::min_y, xsh_wavesol::nbcoefs, xsh_wavesol::polx, xsh_wavesol::poly, XSH_ASSURE_NOT_NULL, XSH_CALLOC, xsh_error_msg, xsh_get_table_value(), xsh_instrument_get_binx(), xsh_instrument_get_biny(), xsh_msg_dbg_high, xsh_pfits_get_wavesol_lambda_max(), xsh_pfits_get_wavesol_lambda_min(), xsh_pfits_get_wavesol_order_max(), xsh_pfits_get_wavesol_order_min(), xsh_pfits_get_wavesol_slit_max(), xsh_pfits_get_wavesol_slit_min(), xsh_pfits_get_wavesol_x_max(), xsh_pfits_get_wavesol_x_min(), xsh_pfits_get_wavesol_y_max(), xsh_pfits_get_wavesol_y_min(), XSH_TABLE_FREE, XSH_TABLE_LOAD, xsh_wavesol_free(), XSH_WAVESOL_TABLE_COLNAME_DEGLAMBDA, XSH_WAVESOL_TABLE_COLNAME_DEGORDER, and XSH_WAVESOL_TABLE_COLNAME_DEGSLIT.
Referenced by clean_arclist_data(), main(), xsh_afcthetab_create(), xsh_build_ifu_cube(), xsh_create_poly_wavemap(), xsh_data_check_spectralformat(), xsh_detect_arclines(), xsh_detect_arclines_dan(), xsh_flexcor(), xsh_ifu_wavetab_create(), xsh_opt_extract_orders(), and xsh_rectify_orders().
void xsh_wavesol_residual | ( | xsh_wavesol * | sol, | |
xsh_wavesol * | adj, | |||
int | size, | |||
double * | new_pos, | |||
double * | lambda, | |||
double * | order, | |||
double * | slit, | |||
cpl_polynomial * | result, | |||
char | axis | |||
) |
Calculate the Tchebitchev polynomial coefficients for the residuals between new and old positions. The coefficients of the result should be added to the original polynomial.
sol | Final wavesolution | |
adj | Original wavesol | |
size | Nb of elements | |
new_pos | Pointer to array of fitted positions | |
lambda | Pointer to wavelength values | |
order | Pointer to order values | |
slit | Pointer to Slit values | |
result | Final Polynomial | |
axis | Which axis ('y' or 'x') |
Definition at line 601 of file xsh_data_wavesol.c.
References check, xsh_wavesol::deg_lambda, xsh_wavesol::deg_order, xsh_wavesol::deg_slit, xsh_wavesol::max_lambda, xsh_wavesol::max_order, xsh_wavesol::max_slit, xsh_wavesol::max_x, xsh_wavesol::max_y, xsh_wavesol::min_lambda, xsh_wavesol::min_order, xsh_wavesol::min_slit, xsh_wavesol::min_x, xsh_wavesol::min_y, xsh_wavesol::nbcoefs, XSH_ASSURE_NOT_ILLEGAL_MSG, XSH_ASSURE_NOT_NULL, XSH_CALLOC, XSH_FREE, xsh_tools_tchebitchev_transform_tab(), xsh_wavesol_eval_polx(), xsh_wavesol_eval_poly(), and y.
cpl_frame* xsh_wavesol_save | ( | xsh_wavesol * | w, | |
cpl_table * | trace, | |||
const char * | filename, | |||
const char * | tag | |||
) |
save a wavelength solution
w | Pointer to the Wave Solution structure | |
trace | table with wave solution | |
filename | the name of the file | |
tag | product category |
Definition at line 749 of file xsh_data_wavesol.c.
References check, xsh_wavesol::deg_lambda, xsh_wavesol::deg_order, xsh_wavesol::deg_slit, xsh_wavesol::header, xsh_wavesol::max_lambda, xsh_wavesol::max_order, xsh_wavesol::max_slit, xsh_wavesol::max_x, xsh_wavesol::max_y, xsh_wavesol::min_lambda, xsh_wavesol::min_order, xsh_wavesol::min_slit, xsh_wavesol::min_x, xsh_wavesol::min_y, xsh_wavesol::nbcoefs, xsh_wavesol::polx, xsh_wavesol::poly, XSH_ASSURE_NOT_NULL, xsh_frame_product(), xsh_pfits_set_pcatg(), xsh_pfits_set_wavesol_lambda_max(), xsh_pfits_set_wavesol_lambda_min(), xsh_pfits_set_wavesol_order_max(), xsh_pfits_set_wavesol_order_min(), xsh_pfits_set_wavesol_slit_max(), xsh_pfits_set_wavesol_slit_min(), xsh_pfits_set_wavesol_x_max(), xsh_pfits_set_wavesol_x_min(), xsh_pfits_set_wavesol_y_max(), xsh_pfits_set_wavesol_y_min(), XSH_TABLE_FREE, XSH_WAVESOL_TABLE_COLNAME_AXIS, XSH_WAVESOL_TABLE_COLNAME_DEGLAMBDA, XSH_WAVESOL_TABLE_COLNAME_DEGORDER, XSH_WAVESOL_TABLE_COLNAME_DEGSLIT, XSH_WAVESOL_TABLE_NB_COL, and XSH_WAVESOL_TABLE_NB_ROWS.
Referenced by xsh_detect_arclines(), xsh_detect_arclines_dan(), xsh_flexcor(), and xsh_ifu_wavetab_create().
void xsh_wavesol_set_bin_x | ( | xsh_wavesol * | wsol, | |
int | bin | |||
) |
Set the bin of wave table in x.
[in] | wsol | The wavelength solution list to update |
[in] | bin | The binning value in x |
Definition at line 1044 of file xsh_data_wavesol.c.
References xsh_wavesol::bin_x, and XSH_ASSURE_NOT_NULL.
Referenced by xsh_create_poly_wavemap().
void xsh_wavesol_set_bin_y | ( | xsh_wavesol * | wsol, | |
int | bin | |||
) |
Set the bin of wave table in y.
[in] | wsol | The wavelength solution list to update |
[in] | bin | The binning value in y |
Definition at line 1061 of file xsh_data_wavesol.c.
References xsh_wavesol::bin_y, and XSH_ASSURE_NOT_NULL.
Referenced by xsh_create_poly_wavemap().
void xsh_wavesol_set_type | ( | xsh_wavesol * | wsol, | |
enum wavesol_type | type | |||
) |
set the type of the wave table
wsol | the wavelength solution | |
type | the type GUESS or 2D |
Definition at line 261 of file xsh_data_wavesol.c.
References xsh_wavesol::type, and XSH_ASSURE_NOT_NULL.
Referenced by xsh_detect_arclines(), and xsh_detect_arclines_dan().
cpl_table* xsh_wavesol_trace | ( | xsh_wavesol * | wsol, | |
double * | lambda, | |||
double * | order, | |||
double * | slit, | |||
int | size | |||
) |
Definition at line 986 of file xsh_data_wavesol.c.
References check, XSH_ASSURE_NOT_NULL, xsh_wavesol_eval_polx(), and xsh_wavesol_eval_poly().
Referenced by xsh_detect_arclines(), xsh_detect_arclines_dan(), and xsh_flexcor().