Wave Solution
[Data Format Handling functions]

Functions

xsh_wavesolxsh_wavesol_create (cpl_frame *spectral_format_frame, xsh_detect_arclines_param *params, xsh_instrument *instrument)
 Create a new wavelength solution structure.
xsh_wavesolxsh_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_wavesolxsh_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.

Function Documentation

void xsh_wavesol_add_poly ( xsh_wavesol to,
xsh_wavesol from 
)

Calculates the sum of the coefficients of poly polynomial.

Parameters:
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.

Parameters:
[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

Parameters:
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(), and xsh_detect_arclines().

xsh_wavesol* xsh_wavesol_create ( cpl_frame *  spectral_format_frame,
xsh_detect_arclines_param params,
xsh_instrument instrument 
)
void xsh_wavesol_dump ( xsh_wavesol wsol,
const char *  fname,
int  nb 
)
xsh_wavesol* xsh_wavesol_duplicate ( xsh_wavesol org  ) 
double xsh_wavesol_eval_polx ( xsh_wavesol sol,
double  lambda,
double  order,
double  slit 
)
double xsh_wavesol_eval_poly ( xsh_wavesol sol,
double  lambda,
double  order,
double  slit 
)
void xsh_wavesol_free ( xsh_wavesol **  w  ) 
cpl_propertylist* xsh_wavesol_get_header ( xsh_wavesol sol  ) 

get header of the table

Parameters:
sol the wavelength solution
Returns:
the header associated to the table

Definition at line 315 of file xsh_data_wavesol.c.

References xsh_wavesol::header, and XSH_ASSURE_NOT_NULL.

Referenced by xsh_detect_arclines().

cpl_polynomial* xsh_wavesol_get_polx ( xsh_wavesol sol  ) 

get the solution in X

Parameters:
sol the wavelength solution
Returns:
return the solution in X

Definition at line 297 of file xsh_data_wavesol.c.

References xsh_wavesol::polx, and XSH_ASSURE_NOT_NULL.

Referenced by xsh_detect_arclines().

cpl_polynomial* xsh_wavesol_get_poly ( xsh_wavesol sol  ) 

get the solution in Y

Parameters:
sol the wavelength solution
Returns:
return the solution in Y

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

Parameters:
wsol the wavelength solution
Returns:
the type GUESS or 2D

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().

xsh_wavesol* xsh_wavesol_load ( cpl_frame *  frame,
xsh_instrument instrument 
)

load a wavelength solution

Parameters:
frame input frame
instrument instrument arm setting
Returns:
the wavelength solution

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_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.

Parameters:
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 
)
void xsh_wavesol_set_bin_x ( xsh_wavesol wsol,
int  bin 
)

Set the bin of wave table in x.

Parameters:
[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.

Parameters:
[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

Parameters:
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().

cpl_table* xsh_wavesol_trace ( xsh_wavesol wsol,
double *  lambda,
double *  order,
double *  slit,
int  size 
)

Generated on 9 Mar 2011 for X-shooter Pipeline Reference Manual by  doxygen 1.6.1