X-shooter Pipeline Reference Manual 3.8.15
Functions

Functions

xsh_dispersol_listxsh_dispersol_list_new (int size, int degx, int degy, xsh_instrument *instrument)
 Create a new dispersion solution list.
 
xsh_dispersol_listxsh_dispersol_list_load (cpl_frame *frame, xsh_instrument *instrument)
 Load a dispersion list from a frame.
 
void xsh_dispersol_list_add (xsh_dispersol_list *list, int idx, int absorder, cpl_polynomial *lambda_poly, cpl_polynomial *slit_poly)
 Add a dispersion solution in the list.
 
void xsh_dispersol_list_free (xsh_dispersol_list **list)
 Free the dispersion list.
 
cpl_frame * xsh_dispersol_list_to_wavemap (xsh_dispersol_list *list, cpl_frame *order_frame, xsh_pre *pre, xsh_instrument *instr, const char *tag)
 Save a WAVE MAP image.
 
cpl_frame * xsh_dispersol_list_to_slitmap (xsh_dispersol_list *list, cpl_frame *order_frame, xsh_pre *pre, xsh_instrument *instr, const char *tag)
 Save a SLIT MAP image.
 
double xsh_dispersol_list_eval (xsh_dispersol_list *list, cpl_polynomial *poly, cpl_vector *pos)
 Evaluate the polynomial according the binning.
 
cpl_frame * xsh_dispersol_list_save (xsh_dispersol_list *list, const char *tag)
 Save a dispersion list on the disk.
 

Detailed Description

Function Documentation

◆ xsh_dispersol_list_add()

void xsh_dispersol_list_add ( xsh_dispersol_list list,
int  idx,
int  absorder,
cpl_polynomial *  lambda_poly,
cpl_polynomial *  slit_poly 
)

Add a dispersion solution in the list.

Parameters
[in]listThe dispersion list
[in]idxThe index in the list
[in]absorderThe absolute order
[in]lambda_polyThe lambda 2D polynomial solution
[in]slit_polyThe slit 2D polynomial solution

Definition at line 198 of file xsh_data_dispersol.c.

References xsh_dispersol::absorder, xsh_dispersol::lambda_poly, xsh_dispersol_list::list, size, xsh_dispersol::slit_poly, XSH_ASSURE_NOT_ILLEGAL, and XSH_ASSURE_NOT_NULL.

Referenced by xsh_dispersol_list_load(), and xsh_wavemap_list_save_poly().

◆ xsh_dispersol_list_eval()

double xsh_dispersol_list_eval ( xsh_dispersol_list list,
cpl_polynomial *  poly,
cpl_vector *  pos 
)

Evaluate the polynomial according the binning.

Parameters
[in]listThe dispersion list
[in]polyThe slit or wave poly
[in]posThe position x, y in a vector
Returns
The evaluation of the polynomial at the given position

Definition at line 742 of file xsh_data_dispersol.c.

References xsh_dispersol_list::binx, xsh_dispersol_list::biny, check, convert_bin_to_data(), and XSH_ASSURE_NOT_NULL.

Referenced by compute_specres(), main(), xsh_dispersol_list_to_slitmap(), and xsh_dispersol_list_to_wavemap().

◆ xsh_dispersol_list_free()

void xsh_dispersol_list_free ( xsh_dispersol_list **  list)

Free the dispersion list.

Parameters
[in]listThe list to free

Definition at line 225 of file xsh_data_dispersol.c.

References xsh_free_polynomial(), and xsh_free_propertylist().

Referenced by compute_specres(), main(), xsh_create_map(), xsh_dispersol_list_load(), xsh_dispersol_list_new(), xsh_rectify_orders(), and xsh_wavemap_list_save_poly().

◆ xsh_dispersol_list_load()

xsh_dispersol_list * xsh_dispersol_list_load ( cpl_frame *  frame,
xsh_instrument instrument 
)

Load a dispersion list from a frame.

Parameters
[in]frameThe frame contatining the dispersion list
[in]instrumentinstrument (arm) setting
Returns
A new allocated dispersion list

Definition at line 114 of file xsh_data_dispersol.c.

References check, instrument, XSH_ASSURE_NOT_ILLEGAL, xsh_dispersol_list_add(), xsh_dispersol_list_free(), xsh_dispersol_list_new(), XSH_DISPERSOL_TABLE_COLNAME_DEGX, XSH_DISPERSOL_TABLE_COLNAME_DEGY, XSH_DISPERSOL_TABLE_COLNAME_ORDER, xsh_free_table(), xsh_get_table_value(), and XSH_TABLE_LOAD.

Referenced by compute_specres(), main(), xsh_create_map(), and xsh_rectify_orders().

◆ xsh_dispersol_list_new()

xsh_dispersol_list * xsh_dispersol_list_new ( int  size,
int  degx,
int  degy,
xsh_instrument instrument 
)

Create a new dispersion solution list.

Parameters
[in]sizeThe size of the diseprsion list
[in]degxpoly degree on X direction
[in]degypoly degree on Y direction
[in]instrumentinstrument (arm) setting
Returns
The new ALLOCATED dispersion list

Definition at line 77 of file xsh_data_dispersol.c.

References xsh_dispersol_list::binx, xsh_dispersol_list::biny, check, xsh_dispersol_list::degx, xsh_dispersol_list::degy, xsh_dispersol_list::header, instrument, xsh_dispersol_list::list, xsh_dispersol_list::size, size, XSH_ASSURE_NOT_ILLEGAL, XSH_ASSURE_NOT_NULL, XSH_CALLOC, xsh_dispersol_list_free(), xsh_instrument_get_binx(), xsh_instrument_get_biny(), and XSH_NEW_PROPERTYLIST.

Referenced by xsh_dispersol_list_load(), and xsh_wavemap_list_save_poly().

◆ xsh_dispersol_list_save()

cpl_frame * xsh_dispersol_list_save ( xsh_dispersol_list list,
const char *  tag 
)

◆ xsh_dispersol_list_to_slitmap()

cpl_frame * xsh_dispersol_list_to_slitmap ( xsh_dispersol_list list,
cpl_frame *  order_frame,
xsh_pre pre,
xsh_instrument instr,
const char *  tag 
)

Save a SLIT MAP image.

Parameters
[in]listThe dispersion list
[in]order_frameThe order list frame
[in]preThe pre image
[in]instrinstrument (arm) setting
[in]tagproduct tag
Returns
The slit map frame

Definition at line 463 of file xsh_data_dispersol.c.

References xsh_order::absorder, xsh_order_list::bin_x, xsh_dispersol_list::binx, xsh_pre::binx, xsh_order::cenpoly, check, xsh_order::edglopoly, xsh_order::edguppoly, endy, xsh_dispersol_list::list, xsh_order_list::list, xsh_pre::nx, nx, xsh_pre::ny, ny, xsh_dispersol_list::size, xsh_order::sliclopoly, xsh_order::slicuppoly, xsh_dispersol::slit_poly, starty, x, XSH_ASSURE_NOT_ILLEGAL, XSH_ASSURE_NOT_NULL, xsh_dispersol_list_eval(), xsh_frame_product(), xsh_free_frame(), xsh_free_image(), xsh_free_propertylist(), xsh_free_vector(), xsh_instrument_get_binx(), xsh_instrument_get_biny(), xsh_instrument_get_mode(), XSH_MODE_IFU, xsh_order_list_eval(), xsh_order_list_free(), xsh_order_list_get_endy(), xsh_order_list_get_starty(), xsh_order_list_load(), xsh_pfits_set_pcatg(), xsh_pfits_set_slitmap_median_cen(), xsh_pfits_set_slitmap_median_edglo(), xsh_pfits_set_slitmap_median_edgup(), xsh_pfits_set_slitmap_median_sliclo(), xsh_pfits_set_slitmap_median_slicup(), xsh_pfits_set_slitmap_order_cen(), xsh_pfits_set_slitmap_order_edglo(), xsh_pfits_set_slitmap_order_edgup(), xsh_pfits_set_slitmap_order_sliclo(), xsh_pfits_set_slitmap_order_slicup(), xsh_pfits_set_wcs(), and y.

Referenced by xsh_create_map(), and xsh_wavemap_list_save_poly().

◆ xsh_dispersol_list_to_wavemap()

cpl_frame * xsh_dispersol_list_to_wavemap ( xsh_dispersol_list list,
cpl_frame *  order_frame,
xsh_pre pre,
xsh_instrument instr,
const char *  tag 
)