X-shooter Pipeline Reference Manual 3.8.15
Functions

Functions

void xsh_order_list_dump (xsh_order_list *list, const char *fname)
 
void xsh_order_list_verify (xsh_order_list *list, int ny)
 
xsh_order_listxsh_order_list_new (int size)
 Create a new order list from size (no check)
 
xsh_order_listxsh_order_list_create (xsh_instrument *instr)
 create an empty order list
 
xsh_order_listxsh_order_list_load (cpl_frame *frame, xsh_instrument *instr)
 load an order list from a frame
 
void xsh_order_list_fit (xsh_order_list *list, int size, double *order, double *posx, double *posy, int deg_poly)
 fit the polynomial solution of given points
 
void xsh_order_list_free (xsh_order_list **list)
 free memory associated to an order_list
 
int xsh_order_list_get_index_by_absorder (xsh_order_list *list, double absorder)
 
cpl_propertylist * xsh_order_list_get_header (xsh_order_list *list)
 get header of the table
 
int xsh_order_list_get_starty (xsh_order_list *list, int i)
 get position on Y axis of first pixel detected on order
 
int xsh_order_list_get_endy (xsh_order_list *list, int i)
 get position on Y axis of last pixel detected on order
 
int xsh_order_list_get_order (xsh_order_list *list, int absorder)
 
xsh_order_listxsh_order_list_merge (xsh_order_list *lista, xsh_order_list *listb)
 
void xsh_order_list_set_bin_x (xsh_order_list *list, int bin)
 Set the bin of image in x.
 
void xsh_order_list_set_bin_y (xsh_order_list *list, int bin)
 Set the bin of image in y.
 
double xsh_order_list_eval (xsh_order_list *list, cpl_polynomial *poly, double y)
 Evaluate an order list poly.
 
int xsh_order_list_eval_int (xsh_order_list *list, cpl_polynomial *poly, double y)
 Evaluate an order list poly but return the central pixel position rounding the polynomial.
 
void xsh_order_list_apply_shift (xsh_order_list *list, double xshift, double yshift)
 Shift a order list.
 
cpl_frame * xsh_order_list_save (xsh_order_list *order_list, xsh_instrument *instrument, const char *filename, const char *tag, const int ny)
 Save an order list to a frame.
 
void xsh_order_split_qth_d2 (cpl_frame *order_tab_frame, cpl_frame *spectralformat_frame, cpl_frame **qth_order_tab_frame, cpl_frame **d2_order_tab_frame, xsh_instrument *instr)
 
xsh_spectrum1Dxsh_spectrum1D_create (double lambda_min, double lambda_max, double lambda_step)
 Create a 1D spectrum structure.
 
xsh_spectrum1Dxsh_spectrum1D_load (cpl_frame *s1d_frame, xsh_instrument *instr)
 Load a 1D spectrum structure.
 
int xsh_spectrum1D_get_size (xsh_spectrum1D *s)
 Get size of spectrum.
 
double xsh_spectrum1D_get_lambda_min (xsh_spectrum1D *s)
 Get minimum lambda of spectrum.
 
double xsh_spectrum1D_get_lambda_max (xsh_spectrum1D *s)
 Get maximum lambda of spectrum.
 
double xsh_spectrum1D_get_lambda_step (xsh_spectrum1D *s)
 Get bin in lambda of spectrum.
 
double * xsh_spectrum1D_get_flux (xsh_spectrum1D *s)
 Get flux of spectrum.
 
double * xsh_spectrum1D_get_errs (xsh_spectrum1D *s)
 Get errs of spectrum.
 
int * xsh_spectrum1D_get_qual (xsh_spectrum1D *s)
 Get qual of spectrum.
 
void xsh_spectrum1D_free (xsh_spectrum1D **s)
 free memory associated to an 1D spectrum
 
cpl_frame * xsh_spectrum1D_save (xsh_spectrum1D *s, const char *filename)
 save a 1D spectrum
 
static cpl_error_code xsh_monitor_spectrum1D_flux_qc (xsh_spectrum *s, const double wave_s, const double wave_e, const int index)
 
cpl_error_code xsh_monitor_spectrum1D_flux (cpl_frame *in_frm, xsh_instrument *instrument)
 
cpl_error_code xsh_monitor_spectrum1D_extra_qc (cpl_frame *in_frm, xsh_instrument *instrument, cpl_propertylist *qclist)
 

Detailed Description

Function Documentation

◆ xsh_monitor_spectrum1D_extra_qc()

cpl_error_code xsh_monitor_spectrum1D_extra_qc ( cpl_frame *  in_frm,
xsh_instrument instrument,
cpl_propertylist *  qclist 
)

◆ xsh_monitor_spectrum1D_flux()

cpl_error_code xsh_monitor_spectrum1D_flux ( cpl_frame *  in_frm,
xsh_instrument instrument 
)

◆ xsh_monitor_spectrum1D_flux_qc()

static cpl_error_code xsh_monitor_spectrum1D_flux_qc ( xsh_spectrum s,
const double  wave_s,
const double  wave_e,
const int  index 
)
static

Definition at line 369 of file xsh_data_spectrum1D.c.

References check, s, size, xsh_free_image(), xsh_msg_warning, and XSH_QC_FLUX.

Referenced by xsh_monitor_spectrum1D_flux().

◆ xsh_order_list_apply_shift()

void xsh_order_list_apply_shift ( xsh_order_list list,
double  xshift,
double  yshift 
)

Shift a order list.

Parameters
[in]listThe order_list structure which contains polynomials coefficients of the orders
[in]xshiftX shift
[in]yshiftY shift

Definition at line 722 of file xsh_data_order.c.

References xsh_order::cenpoly, check, xsh_order::edglopoly, xsh_order::edguppoly, xsh_order_list::list, xsh_order_list::size, xsh_order::sliclopoly, xsh_order::slicuppoly, and XSH_ASSURE_NOT_NULL.

Referenced by xsh_flexcor().

◆ xsh_order_list_create()

xsh_order_list * xsh_order_list_create ( xsh_instrument instr)

◆ xsh_order_list_dump()

void xsh_order_list_dump ( xsh_order_list list,
const char *  fname 
)

Dump main info about an order table (for each order of the list)

Parameters
[in]listpointer to table list
[in]fnameFile name

Definition at line 67 of file xsh_data_order.c.

References xsh_order::absorder, xsh_order::cenpoly, degree, xsh_order::edglopoly, xsh_order::edguppoly, xsh_order::endy, xsh_order_list::list, xsh_order_list::size, and xsh_order::starty.

Referenced by main().

◆ xsh_order_list_eval()

double xsh_order_list_eval ( xsh_order_list list,
cpl_polynomial *  poly,
double  y 
)

Evaluate an order list poly.

Parameters
[in]listorder list structure
[in]polyAn order list poly
[in]yThe position to evaluate
Returns
The result

Definition at line 659 of file xsh_data_order.c.

References xsh_order_list::bin_x, xsh_order_list::bin_y, check, convert_bin_to_data(), convert_data_to_bin(), XSH_ASSURE_NOT_NULL, and y.

Referenced by find_tilt(), main(), xsh_compute_flat_edges(), xsh_crea_grid_from_mask(), xsh_create_master_flat_with_mask(), xsh_dispersol_list_to_slitmap(), xsh_dispersol_list_to_wavemap(), xsh_order_list_eval_int(), and xsh_wavemap_lambda_range().

◆ xsh_order_list_eval_int()

int xsh_order_list_eval_int ( xsh_order_list list,
cpl_polynomial *  poly,
double  y 
)

Evaluate an order list poly but return the central pixel position rounding the polynomial.

Parameters
[in]listThe order list to update
[in]polyAn order list poly
[in]yThe position to evaluate
Returns
The result

Definition at line 692 of file xsh_data_order.c.

References check, XSH_ASSURE_NOT_NULL, xsh_order_list_eval(), and y.

Referenced by xsh_combine_flats(), xsh_compute_flat_edges(), xsh_create_blaze(), xsh_detect_edges(), xsh_detect_max_y(), xsh_detect_order_edge(), xsh_flat_merge_qth_d2(), xsh_flat_merge_qth_d2_smooth(), xsh_get_edge_x_max(), and xsh_get_edge_x_min().

◆ xsh_order_list_fit()

void xsh_order_list_fit ( xsh_order_list list,
int  size,
double *  order,
double *  posx,
double *  posy,
int  deg_poly 
)

fit the polynomial solution of given points

Parameters
[in]listThe order list
[in]sizeNb of elements in the list
[in]orderArray of orders
[in]posxArray of X positions
[in]posyArray of Y positions
[in]deg_polyDegree of the polynomial

Definition at line 351 of file xsh_data_order.c.

References xsh_order::absorder, xsh_order_list::absorder_max, xsh_order_list::absorder_min, xsh_order::cenpoly, check, xsh_order_list::list, xsh_order::order, order, xsh_order_list::size, size, XSH_ASSURE_NOT_ILLEGAL, XSH_ASSURE_NOT_ILLEGAL_MSG, XSH_ASSURE_NOT_NULL, xsh_msg, xsh_msg_dbg_high, xsh_msg_dbg_low, xsh_polynomial_fit_1d_create(), and xsh_unwrap_vector().

Referenced by fit_order_list(), and xsh_create_order_table().

◆ xsh_order_list_free()

void xsh_order_list_free ( xsh_order_list **  list)

◆ xsh_order_list_get_endy()

int xsh_order_list_get_endy ( xsh_order_list list,
int  i 
)

◆ xsh_order_list_get_header()

cpl_propertylist * xsh_order_list_get_header ( xsh_order_list list)

get header of the table

Parameters
[in]listthe order_list
Returns
the header associated to the table

Definition at line 477 of file xsh_data_order.c.

References xsh_order_list::header, and XSH_ASSURE_NOT_NULL.

Referenced by set_qc_parameters(), and xsh_create_order_table().

◆ xsh_order_list_get_index_by_absorder()

int xsh_order_list_get_index_by_absorder ( xsh_order_list list,
double  absorder 
)

◆ xsh_order_list_get_order()

int xsh_order_list_get_order ( xsh_order_list list,
int  absorder 
)

◆ xsh_order_list_get_starty()

int xsh_order_list_get_starty ( xsh_order_list list,
int  i 
)

◆ xsh_order_list_load()

xsh_order_list * xsh_order_list_load ( cpl_frame *  frame,
xsh_instrument instr 
)

load an order list from a frame

Parameters
[in]framethe table wich contains polynomials coefficients of the orders
[in]instrinstrument in use
Returns
the order list structure

Definition at line 190 of file xsh_data_order.c.

References xsh_order::absorder, xsh_order_list::bin_x, xsh_order_list::bin_y, xsh_order::cenpoly, check, xsh_order::edglopoly, xsh_order::edguppoly, xsh_order::endy, xsh_order_list::header, xsh_order_list::list, xsh_order::order, xsh_order::pol_degree, xsh_order_list::size, xsh_order::sliclopoly, xsh_order::slicuppoly, xsh_order::starty, XSH_ASSURE_NOT_NULL, xsh_error_msg, xsh_free_propertylist(), xsh_get_table_value(), xsh_instrument_get_binx(), xsh_instrument_get_biny(), xsh_msg_dbg_medium, xsh_order_list_create(), xsh_order_list_free(), XSH_ORDER_TABLE_COLNAME_ABSORDER, XSH_ORDER_TABLE_COLNAME_CENTER, XSH_ORDER_TABLE_COLNAME_EDGLO, XSH_ORDER_TABLE_COLNAME_EDGUP, XSH_ORDER_TABLE_COLNAME_ENDY, XSH_ORDER_TABLE_COLNAME_ORDER, XSH_ORDER_TABLE_COLNAME_SLICLO, XSH_ORDER_TABLE_COLNAME_SLICUP, XSH_ORDER_TABLE_COLNAME_STARTY, XSH_ORDER_TABLE_DEGY, XSH_TABLE_FREE, and XSH_TABLE_LOAD.

Referenced by main(), xsh_blaze_image(), xsh_cfg_recover_add_peaks_xpos(), xsh_cfg_recover_guess_tab_corr_by_ordpos(), xsh_cfg_recover_linear_ext(), xsh_create_master_flat_with_mask(), xsh_data_check_spectralformat(), xsh_detect_arclines(), xsh_detect_arclines_dan(), xsh_detect_continuum(), xsh_detect_order_edge(), xsh_dispersol_list_to_slitmap(), xsh_dispersol_list_to_wavemap(), xsh_flat_merge_qth_d2(), xsh_flat_merge_qth_d2_smooth(), xsh_flat_merge_qth_d2_tabs(), xsh_flexcor(), xsh_follow_arclines(), xsh_model_reduce(), xsh_opt_extract_orders(), xsh_rectify(), xsh_rectify_and_shift(), xsh_rectify_ifu(), xsh_subtract_background(), xsh_wavemap_list_new(), and xsh_wavemap_list_save().

◆ xsh_order_list_merge()

xsh_order_list * xsh_order_list_merge ( xsh_order_list lista,
xsh_order_list listb 
)

◆ xsh_order_list_new()

xsh_order_list * xsh_order_list_new ( int  size)

Create a new order list from size (no check)

Parameters
[in]sizeThe size of list
Returns
A new ALLOCATED order list

Definition at line 130 of file xsh_data_order.c.

References xsh_order_list::header, xsh_order_list::list, xsh_order_list::size, size, XSH_ASSURE_NOT_ILLEGAL, XSH_CALLOC, XSH_NEW_PROPERTYLIST, and xsh_order_list_free().

Referenced by xsh_order_list_create(), and xsh_order_list_merge().

◆ xsh_order_list_save()

cpl_frame * xsh_order_list_save ( xsh_order_list order_list,
xsh_instrument instrument,
const char *  filename,
const char *  tag,
const int  ny 
)

Save an order list to a frame.

Parameters
[in]order_listThe order_list structure wich contains polynomials coefficients of the orders
[in]instrumentThe instrument setting
[in]filenameThe name of the save file on disk
[in]tagThe frame tag
[in]nyy size of frame
Returns
A newly allocated frame

Definition at line 789 of file xsh_data_order.c.

References xsh_order::absorder, xsh_order::cenpoly, check, xsh_order::edglopoly, xsh_order::edguppoly, endy, xsh_order::endy, xsh_order_list::header, instrument, xsh_order_list::list, norder, ny, xsh_order::order, PointStep, xsh_order_list::size, xsh_order::sliclopoly, xsh_order::slicuppoly, starty, xsh_order::starty, XSH_ASSURE_NOT_ILLEGAL_MSG, XSH_ASSURE_NOT_NULL, XSH_CMP_TAG_LAMP, xsh_frame_product(), xsh_free_table(), xsh_msg, xsh_msg_dbg_high, XSH_ORDER_TAB_EDGES, XSH_ORDER_TABLE_COLNAME_ABSORDER, XSH_ORDER_TABLE_COLNAME_CENTER, XSH_ORDER_TABLE_COLNAME_CENTERX, XSH_ORDER_TABLE_COLNAME_CENTERY, XSH_ORDER_TABLE_COLNAME_EDGLO, XSH_ORDER_TABLE_COLNAME_EDGLOX, XSH_ORDER_TABLE_COLNAME_EDGUP, XSH_ORDER_TABLE_COLNAME_EDGUPX, XSH_ORDER_TABLE_COLNAME_ENDY, XSH_ORDER_TABLE_COLNAME_ORDER, XSH_ORDER_TABLE_COLNAME_SLICLO, XSH_ORDER_TABLE_COLNAME_SLICLOX, XSH_ORDER_TABLE_COLNAME_SLICUP, XSH_ORDER_TABLE_COLNAME_SLICUPX, XSH_ORDER_TABLE_COLNAME_STARTY, XSH_ORDER_TABLE_DEGY, xsh_pfits_set_pcatg(), and XSH_QC_ORD_EDGE_NDET.

Referenced by main(), xsh_create_order_table(), xsh_detect_continuum(), xsh_detect_order_edge(), xsh_flat_merge_qth_d2(), xsh_flat_merge_qth_d2_smooth(), xsh_flat_merge_qth_d2_tabs(), xsh_flexcor(), xsh_model_order_edges_tab_create(), and xsh_order_table_from_fmtchk().

◆ xsh_order_list_set_bin_x()

void xsh_order_list_set_bin_x ( xsh_order_list list,
int  bin 
)

Set the bin of image in x.

Parameters
[in]listThe order list to update
[in]binThe binning value in x

Definition at line 618 of file xsh_data_order.c.

References xsh_order_list::bin_x, and XSH_ASSURE_NOT_NULL.

Referenced by main(), xsh_flat_merge_qth_d2(), xsh_flat_merge_qth_d2_smooth(), xsh_flat_merge_qth_d2_tabs(), and xsh_subtract_background().

◆ xsh_order_list_set_bin_y()

void xsh_order_list_set_bin_y ( xsh_order_list list,
int  bin 
)

Set the bin of image in y.

Parameters
[in]listThe order list to update
[in]binThe binning value in y

Definition at line 637 of file xsh_data_order.c.

References xsh_order_list::bin_y, and XSH_ASSURE_NOT_NULL.

Referenced by main(), xsh_flat_merge_qth_d2(), xsh_flat_merge_qth_d2_smooth(), xsh_flat_merge_qth_d2_tabs(), and xsh_subtract_background().

◆ xsh_order_list_verify()

void xsh_order_list_verify ( xsh_order_list list,
int  ny 
)

Check that end and starty are coherent. If not, set starty at 0 and endy at the Y size of the image.

Parameters
listOrder list to check
nyImage size (Y)

Definition at line 105 of file xsh_data_order.c.

References xsh_order::endy, xsh_order_list::list, ny, xsh_order_list::size, and xsh_order::starty.

Referenced by xsh_detect_continuum().

◆ xsh_order_split_qth_d2()

void xsh_order_split_qth_d2 ( cpl_frame *  order_tab_frame,
cpl_frame *  spectralformat_frame,
cpl_frame **  qth_order_tab_frame,
cpl_frame **  d2_order_tab_frame,
xsh_instrument instr 
)

◆ xsh_spectrum1D_create()

xsh_spectrum1D * xsh_spectrum1D_create ( double  lambda_min,
double  lambda_max,
double  lambda_step 
)

Create a 1D spectrum structure.

Parameters
[in]lambda_minminimum wavelength of spectrum
[in]lambda_maxmaximum wavelength of spectrum
[in]lambda_steplambda binning
Returns
the spectrum1D structure

Definition at line 70 of file xsh_data_spectrum1D.c.

References check, xsh_spectrum1D::errs, xsh_spectrum1D::errs_header, xsh_spectrum1D::flux, xsh_spectrum1D::flux_header, xsh_spectrum1D::lambda_max, xsh_spectrum1D::lambda_min, lambda_step, xsh_spectrum1D::lambda_step, xsh_spectrum1D::qual, xsh_spectrum1D::qual_header, xsh_spectrum1D::size, XSH_ASSURE_NOT_ILLEGAL, XSH_CALLOC, XSH_NEW_PROPERTYLIST, xsh_pfits_set_extname(), xsh_pfits_set_wcs1(), and xsh_spectrum1D_free().

◆ xsh_spectrum1D_free()

void xsh_spectrum1D_free ( xsh_spectrum1D **  s)

free memory associated to an 1D spectrum

Parameters
[in]sspectrum structure to free

Definition at line 311 of file xsh_data_spectrum1D.c.

References s, XSH_FREE, xsh_free_image(), and xsh_free_propertylist().

Referenced by xsh_spectrum1D_create(), and xsh_spectrum1D_load().

◆ xsh_spectrum1D_get_errs()

double * xsh_spectrum1D_get_errs ( xsh_spectrum1D s)

Get errs of spectrum.

Parameters
[in]sspectrum structure
Returns
the errs data of spectrum

Definition at line 270 of file xsh_data_spectrum1D.c.

References check, s, and XSH_ASSURE_NOT_NULL.

◆ xsh_spectrum1D_get_flux()

double * xsh_spectrum1D_get_flux ( xsh_spectrum1D s)

Get flux of spectrum.

Parameters
[in]sspectrum structure
Returns
the flux data of spectrum

Definition at line 248 of file xsh_data_spectrum1D.c.

References check, s, and XSH_ASSURE_NOT_NULL.

◆ xsh_spectrum1D_get_lambda_max()

double xsh_spectrum1D_get_lambda_max ( xsh_spectrum1D s)

Get maximum lambda of spectrum.

Parameters
[in]sspectrum structure
Returns
maximum lambda of spectrum

Definition at line 205 of file xsh_data_spectrum1D.c.

References s, and XSH_ASSURE_NOT_NULL.

◆ xsh_spectrum1D_get_lambda_min()

double xsh_spectrum1D_get_lambda_min ( xsh_spectrum1D s)

Get minimum lambda of spectrum.

Parameters
[in]sspectrum structure
Returns
minimum lambda spectrum

Definition at line 184 of file xsh_data_spectrum1D.c.

References s, and XSH_ASSURE_NOT_NULL.

◆ xsh_spectrum1D_get_lambda_step()

double xsh_spectrum1D_get_lambda_step ( xsh_spectrum1D s)

Get bin in lambda of spectrum.

Parameters
[in]sspectrum structure
Returns
bin in lambda of spectrum

Definition at line 226 of file xsh_data_spectrum1D.c.

References s, and XSH_ASSURE_NOT_NULL.

◆ xsh_spectrum1D_get_qual()

int * xsh_spectrum1D_get_qual ( xsh_spectrum1D s)

Get qual of spectrum.

Parameters
[in]sspectrum structure
Returns
the qual data of spectrum

Definition at line 292 of file xsh_data_spectrum1D.c.

References check, s, and XSH_ASSURE_NOT_NULL.

◆ xsh_spectrum1D_get_size()

int xsh_spectrum1D_get_size ( xsh_spectrum1D s)

Get size of spectrum.

Parameters
[in]sspectrum structure
Returns
the size of flux data in spectrum

Definition at line 163 of file xsh_data_spectrum1D.c.

References s, and XSH_ASSURE_NOT_NULL.

◆ xsh_spectrum1D_load()

xsh_spectrum1D * xsh_spectrum1D_load ( cpl_frame *  s1d_frame,
xsh_instrument instr 
)

◆ xsh_spectrum1D_save()

cpl_frame * xsh_spectrum1D_save ( xsh_spectrum1D s,
const char *  filename 
)

save a 1D spectrum

Parameters
[in]sspectrum structure to save
[in]filenamename of the save file
Returns
1D spectrum frame

Definition at line 334 of file xsh_data_spectrum1D.c.

References check, check_msg, s, XSH_ASSURE_NOT_NULL, xsh_frame_product(), xsh_free_frame(), XSH_SPECTRUM1D_DATA_BPP, XSH_SPECTRUM1D_ERRS_BPP, and XSH_SPECTRUM1D_QUAL_BPP.