X-shooter Pipeline Reference Manual 3.8.15
Functions

Functions

xsh_resid_tabxsh_resid_tab_create (int size, double *lambda, double *order, double *slit, double *sn, int *slit_index, double *thpre_x, double *thpre_y, double *corr_x, double *corr_y, double *gaussian_norm, double *gaussian_fit_x, double *gaussian_fit_y, double *gaussian_sigma_x, double *gaussian_sigma_y, double *gaussian_fwhm_x, double *gaussian_fwhm_y, int *flag, xsh_wavesol *wavesol, int wavesol_type)
 Create a residual tab structure.
 
xsh_resid_tabxsh_resid_tab_create_not_flagged (int size, double *lambda, double *order, double *slit, double *sn, int *slit_index, double *thpre_x, double *thpre_y, double *corr_x, double *corr_y, double *gaussian_norm, double *gaussian_fit_x, double *gaussian_fit_y, double *gaussian_sigma_x, double *gaussian_sigma_y, double *gaussian_fwhm_x, double *gaussian_fwhm_y, int *flag, xsh_wavesol *wavesol, int wavesol_type)
 
cpl_frame * xsh_resid_tab_erase_flagged (cpl_frame *resid, const char *name)
 
xsh_resid_tabxsh_resid_tab_load (cpl_frame *resid_tab_frame)
 Load a residual tab from a frame.
 
void xsh_resid_tab_free (xsh_resid_tab **resid)
 Free memory associated to a resid_tab.
 
void xsh_resid_tab_log (xsh_resid_tab *resid, const char *filename)
 Log the residual tab in a ASCII file

 
cpl_frame * xsh_resid_tab_save (xsh_resid_tab *resid, const char *filename, xsh_instrument *instr, const char *tag)
 Save a residual tab to a frame.
 
double * xsh_resid_tab_get_lambda_data (xsh_resid_tab *resid)
 Get the size of the residual tab.
 
double * xsh_resid_tab_get_order_data (xsh_resid_tab *resid)
 Get the Orders array of the residual tab.
 
double * xsh_resid_tab_get_slitpos_data (xsh_resid_tab *resid)
 Get the slit_pos array of the residual tab.
 
double * xsh_resid_tab_get_thpre_x_data (xsh_resid_tab *resid)
 Get the slit_index array of the residual tab.
 
double * xsh_resid_tab_get_thpre_y_data (xsh_resid_tab *resid)
 Get the thpre_y array of the residual tab.
 
double * xsh_resid_tab_get_xgauss_data (xsh_resid_tab *resid)
 Get the xgauss array of the residual tab.
 
double * xsh_resid_tab_get_ygauss_data (xsh_resid_tab *resid)
 Get the ygauss array of the residual tab.
 
cpl_error_code xsh_frame_table_resid_merge (cpl_frame *self, cpl_frame *right, const int solution_type)
 

Detailed Description

Function Documentation

◆ xsh_frame_table_resid_merge()

cpl_error_code xsh_frame_table_resid_merge ( cpl_frame *  self,
cpl_frame *  right,
const int  solution_type 
)

◆ xsh_resid_tab_create()

xsh_resid_tab * xsh_resid_tab_create ( int  size,
double *  lambda,
double *  order,
double *  slit,
double *  sn,
int *  slit_index,
double *  thpre_x,
double *  thpre_y,
double *  corr_x,
double *  corr_y,
double *  gaussian_norm,
double *  gaussian_fit_x,
double *  gaussian_fit_y,
double *  gaussian_sigma_x,
double *  gaussian_sigma_y,
double *  gaussian_fwhm_x,
double *  gaussian_fwhm_y,
int *  flag,
xsh_wavesol wavesol,
int  wavesol_type 
)

Create a residual tab structure.

Parameters
[in]sizeThe numbers of lines in residual tab
[in]lambdaThe wavelength of the size lines
[in]orderorder array
[in]slitslit array
[in]slit_indexslit_index array (for each pinhole)
[in]thpre_xTHE X position
[in]thpre_yTHE Y position
[in]corr_xcorrective x factor
[in]corr_ycorrective y factor
[in]gaussian_fit_xx position after Gaussian fit
[in]gaussian_fit_yy position after Gaussian fit
[in]gaussian_sigma_xx sigma after Gaussian fit
[in]gaussian_sigma_yy sigma after Gaussian fit
[in]wavesolwavelength solution
[in]wavesol_typewavelength solution type
Returns
The resid_tab allocated structure

Definition at line 85 of file xsh_data_resid_tab.c.

References check, xsh_resid_tab::flag, xsh_resid_tab::fwhm_xgauss, xsh_resid_tab::fwhm_ygauss, xsh_resid_tab::header, xsh_resid_tab::lambda, xsh_resid_tab::norm_gauss, xsh_resid_tab::order, order, xsh_resid_tab::sig_xgauss, xsh_resid_tab::sig_ygauss, xsh_resid_tab::size, size, xsh_resid_tab::slit, xsh_resid_tab::slit_index, xsh_resid_tab::sn, xsh_resid_tab::solution_type, xsh_resid_tab::thcor_x, xsh_resid_tab::thcor_y, xsh_resid_tab::thpre_x, xsh_resid_tab::thpre_y, xsh_resid_tab::xgauss, xsh_resid_tab::xpoly, XSH_ASSURE_NOT_ILLEGAL, XSH_ASSURE_NOT_NULL, XSH_CALLOC, xsh_resid_tab_free(), XSH_WAVESOL_2D, xsh_wavesol_eval_polx(), xsh_wavesol_eval_poly(), xsh_wavesol_get_type(), XSH_WAVESOL_GUESS, XSH_WAVESOL_UNDEFINED, xsh_resid_tab::ygauss, and xsh_resid_tab::ypoly.

Referenced by xsh_detect_arclines(), and xsh_detect_arclines_dan().

◆ xsh_resid_tab_create_not_flagged()

xsh_resid_tab * xsh_resid_tab_create_not_flagged ( int  size,
double *  lambda,
double *  order,
double *  slit,
double *  sn,
int *  slit_index,
double *  thpre_x,
double *  thpre_y,
double *  corr_x,
double *  corr_y,
double *  gaussian_norm,
double *  gaussian_fit_x,
double *  gaussian_fit_y,
double *  gaussian_sigma_x,
double *  gaussian_sigma_y,
double *  gaussian_fwhm_x,
double *  gaussian_fwhm_y,
int *  flag,
xsh_wavesol wavesol,
int  wavesol_type 
)

◆ xsh_resid_tab_erase_flagged()

cpl_frame * xsh_resid_tab_erase_flagged ( cpl_frame *  resid,
const char *  name 
)

◆ xsh_resid_tab_free()

void xsh_resid_tab_free ( xsh_resid_tab **  resid)

Free memory associated to a resid_tab.

Parameters
[in,out]residThe resid_tab to free

Definition at line 629 of file xsh_data_resid_tab.c.

References XSH_FREE, and xsh_free_propertylist().

Referenced by xsh_create_order_table(), xsh_detect_arclines(), xsh_detect_arclines_dan(), xsh_flexcor(), xsh_model_pipe_anneal(), xsh_resid_tab_create(), xsh_resid_tab_create_not_flagged(), and xsh_resid_tab_load().

◆ xsh_resid_tab_get_lambda_data()

double * xsh_resid_tab_get_lambda_data ( xsh_resid_tab resid)

Get the size of the residual tab.

Parameters
residThe resid_tab structure
Returns
The size

Get the lambda array of the residual tab

Parameters
residThe resid_tab structure
Returns
Pointer to the lambda array

Definition at line 1035 of file xsh_data_resid_tab.c.

References XSH_ASSURE_NOT_NULL.

Referenced by xsh_create_order_table(), and xsh_model_pipe_anneal().

◆ xsh_resid_tab_get_order_data()

double * xsh_resid_tab_get_order_data ( xsh_resid_tab resid)

Get the Orders array of the residual tab.

Parameters
residThe resid_tab structure
Returns
Pointer to the order aray

Definition at line 1054 of file xsh_data_resid_tab.c.

References xsh_resid_tab::order, and XSH_ASSURE_NOT_NULL.

Referenced by xsh_create_order_table(), and xsh_model_pipe_anneal().

◆ xsh_resid_tab_get_slitpos_data()

double * xsh_resid_tab_get_slitpos_data ( xsh_resid_tab resid)

Get the slit_pos array of the residual tab.

Parameters
residThe resid_tab structure
Returns
Pointer to the lambda aray

Definition at line 1073 of file xsh_data_resid_tab.c.

References xsh_resid_tab::slit, and XSH_ASSURE_NOT_NULL.

◆ xsh_resid_tab_get_thpre_x_data()

double * xsh_resid_tab_get_thpre_x_data ( xsh_resid_tab resid)

Get the slit_index array of the residual tab.

Parameters
residThe resid_tab structure
Returns
Pointer to the slit_index array

Get the thpre_x array of the residual tab

Parameters
residThe resid_tab structure
Returns
Pointer to the lambda aray

Definition at line 1102 of file xsh_data_resid_tab.c.

References XSH_ASSURE_NOT_NULL.

Referenced by xsh_model_pipe_anneal().

◆ xsh_resid_tab_get_thpre_y_data()

double * xsh_resid_tab_get_thpre_y_data ( xsh_resid_tab resid)

Get the thpre_y array of the residual tab.

Parameters
residThe resid_tab structure
Returns
Pointer to the thpre_y aray

Definition at line 1121 of file xsh_data_resid_tab.c.

References xsh_resid_tab::thpre_y, and XSH_ASSURE_NOT_NULL.

Referenced by xsh_model_pipe_anneal().

◆ xsh_resid_tab_get_xgauss_data()

double * xsh_resid_tab_get_xgauss_data ( xsh_resid_tab resid)

Get the xgauss array of the residual tab.

Parameters
residThe resid_tab structure
Returns
Pointer to the diff_x aray

Definition at line 1140 of file xsh_data_resid_tab.c.

References xsh_resid_tab::xgauss, and XSH_ASSURE_NOT_NULL.

Referenced by xsh_create_order_table(), and xsh_model_pipe_anneal().

◆ xsh_resid_tab_get_ygauss_data()

double * xsh_resid_tab_get_ygauss_data ( xsh_resid_tab resid)

Get the ygauss array of the residual tab.

Parameters
residThe resid_tab structure
Returns
Pointer to the diff_y aray

Definition at line 1159 of file xsh_data_resid_tab.c.

References XSH_ASSURE_NOT_NULL, and xsh_resid_tab::ygauss.

Referenced by xsh_create_order_table(), and xsh_model_pipe_anneal().

◆ xsh_resid_tab_load()

xsh_resid_tab * xsh_resid_tab_load ( cpl_frame *  resid_tab_frame)

Load a residual tab from a frame.

Parameters
[in]resid_tab_frameThe residual tab to load
Returns
a new allocated resid_tab structure

Definition at line 389 of file xsh_data_resid_tab.c.

References check, xsh_resid_tab::flag, xsh_resid_tab::fwhm_xgauss, xsh_resid_tab::fwhm_ygauss, xsh_resid_tab::header, xsh_resid_tab::lambda, xsh_resid_tab::norm_gauss, xsh_resid_tab::order, order, xsh_resid_tab::sig_xgauss, xsh_resid_tab::sig_ygauss, xsh_resid_tab::size, size, xsh_resid_tab::slit, xsh_resid_tab::slit_index, xsh_resid_tab::solution_type, xsh_resid_tab::thanneal_x, xsh_resid_tab::thanneal_y, xsh_resid_tab::thcor_x, xsh_resid_tab::thcor_y, xsh_resid_tab::thpre_x, xsh_resid_tab::thpre_y, xsh_resid_tab::xgauss, xsh_resid_tab::xpoly, XSH_ASSURE_NOT_NULL, XSH_CALLOC, XSH_DETECT_ARCLINES_TYPE_MODEL, XSH_DETECT_ARCLINES_TYPE_POLY, xsh_error_msg, xsh_get_table_value(), xsh_msg, xsh_pfits_get_wavesoltype(), xsh_resid_tab_free(), XSH_RESID_TAB_TABLE_COLNAME_FLAG, XSH_RESID_TAB_TABLE_COLNAME_FWHMXGAUSS, XSH_RESID_TAB_TABLE_COLNAME_FWHMYGAUSS, XSH_RESID_TAB_TABLE_COLNAME_NORMGAUSS, XSH_RESID_TAB_TABLE_COLNAME_ORDER, XSH_RESID_TAB_TABLE_COLNAME_SIGMAXGAUSS, XSH_RESID_TAB_TABLE_COLNAME_SIGMAYGAUSS, XSH_RESID_TAB_TABLE_COLNAME_SLITINDEX, XSH_RESID_TAB_TABLE_COLNAME_SLITPOSITION, XSH_RESID_TAB_TABLE_COLNAME_WAVELENGTH, XSH_RESID_TAB_TABLE_COLNAME_XGAUSS, XSH_RESID_TAB_TABLE_COLNAME_XPOLY, XSH_RESID_TAB_TABLE_COLNAME_XTHANNEAL, XSH_RESID_TAB_TABLE_COLNAME_XTHPRE, XSH_RESID_TAB_TABLE_COLNAME_YGAUSS, XSH_RESID_TAB_TABLE_COLNAME_YPOLY, XSH_RESID_TAB_TABLE_COLNAME_YTHANNEAL, XSH_RESID_TAB_TABLE_COLNAME_YTHPRE, XSH_TABLE_FREE, XSH_TABLE_LOAD, XSH_WAVESOLTYPE, XSH_WAVESOLTYPE_MODEL, xsh_resid_tab::ygauss, and xsh_resid_tab::ypoly.

Referenced by xsh_create_order_table(), xsh_flexcor(), and xsh_model_pipe_anneal().

◆ xsh_resid_tab_log()

void xsh_resid_tab_log ( xsh_resid_tab resid,
const char *  filename 
)

◆ xsh_resid_tab_save()

cpl_frame * xsh_resid_tab_save ( xsh_resid_tab resid,
const char *  filename,
xsh_instrument instr,
const char *  tag 
)

Save a residual tab to a frame.

Parameters
residThe resid_tab structure to save
[in]filenameThe name of the save file on disk
Returns
A newly allocated residual tab frame

Definition at line 733 of file xsh_data_resid_tab.c.

References check, xsh_resid_tab::flag, xsh_resid_tab::fwhm_xgauss, xsh_resid_tab::fwhm_ygauss, xsh_resid_tab::header, xsh_resid_tab::lambda, xsh_resid_tab::mean_diff_poly_fit_x, xsh_resid_tab::mean_diff_poly_fit_y, xsh_resid_tab::median_diff_poly_fit_x, xsh_resid_tab::median_diff_poly_fit_y, xsh_resid_tab::norm_gauss, xsh_resid_tab::order, order, xsh_resid_tab::sig_xgauss, xsh_resid_tab::sig_ygauss, xsh_resid_tab::size, size, xsh_resid_tab::slit, xsh_resid_tab::slit_index, xsh_resid_tab::sn, xsh_resid_tab::solution_type, xsh_resid_tab::stdev_diff_poly_fit_x, xsh_resid_tab::stdev_diff_poly_fit_y, xsh_resid_tab::thpre_x, xsh_resid_tab::thpre_y, xsh_resid_tab::xgauss, xsh_resid_tab::xpoly, XSH_ASSURE_NOT_NULL, XSH_DETECT_ARCLINES_TYPE_POLY, xsh_frame_product(), xsh_free_frame(), xsh_pfits_set_pcatg(), xsh_pfits_set_qc(), xsh_pfits_set_qc_nlinefound_clean_fib4(), xsh_pfits_set_qc_nlinefound_fib4(), xsh_pfits_set_wavesoltype(), XSH_QC_FMTCHK_POLY_DIFFXAVG, XSH_QC_FMTCHK_POLY_DIFFXMED, XSH_QC_FMTCHK_POLY_DIFFXSTD, XSH_QC_FMTCHK_POLY_DIFFYAVG, XSH_QC_FMTCHK_POLY_DIFFYMED, XSH_QC_FMTCHK_POLY_DIFFYSTD, XSH_REGDEBUG, XSH_RESID_TAB_TABLE_COLNAME_FLAG, XSH_RESID_TAB_TABLE_COLNAME_FWHMXGAUSS, XSH_RESID_TAB_TABLE_COLNAME_FWHMYGAUSS, XSH_RESID_TAB_TABLE_COLNAME_NORMGAUSS, XSH_RESID_TAB_TABLE_COLNAME_ORDER, XSH_RESID_TAB_TABLE_COLNAME_RESIDXMODEL, XSH_RESID_TAB_TABLE_COLNAME_RESIDXPOLY, XSH_RESID_TAB_TABLE_COLNAME_RESIDYMODEL, XSH_RESID_TAB_TABLE_COLNAME_RESIDYPOLY, XSH_RESID_TAB_TABLE_COLNAME_SIGMAXGAUSS, XSH_RESID_TAB_TABLE_COLNAME_SIGMAYGAUSS, XSH_RESID_TAB_TABLE_COLNAME_SLITINDEX, XSH_RESID_TAB_TABLE_COLNAME_SLITPOSITION, XSH_RESID_TAB_TABLE_COLNAME_SN, XSH_RESID_TAB_TABLE_COLNAME_WAVELENGTH, XSH_RESID_TAB_TABLE_COLNAME_XGAUSS, XSH_RESID_TAB_TABLE_COLNAME_XPOLY, XSH_RESID_TAB_TABLE_COLNAME_XTHANNEAL, XSH_RESID_TAB_TABLE_COLNAME_XTHPRE, XSH_RESID_TAB_TABLE_COLNAME_YGAUSS, XSH_RESID_TAB_TABLE_COLNAME_YPOLY, XSH_RESID_TAB_TABLE_COLNAME_YTHANNEAL, XSH_RESID_TAB_TABLE_COLNAME_YTHPRE, XSH_RESID_TAB_TABLE_NB_COL, XSH_RESID_TAB_TABLE_UNIT_FLAG, XSH_RESID_TAB_TABLE_UNIT_NORMGAUSS, XSH_RESID_TAB_TABLE_UNIT_ORDER, XSH_RESID_TAB_TABLE_UNIT_RESIDXMODEL, XSH_RESID_TAB_TABLE_UNIT_RESIDXPOLY, XSH_RESID_TAB_TABLE_UNIT_RESIDYMODEL, XSH_RESID_TAB_TABLE_UNIT_RESIDYPOLY, XSH_RESID_TAB_TABLE_UNIT_SIGMAXGAUSS, XSH_RESID_TAB_TABLE_UNIT_SIGMAYGAUSS, XSH_RESID_TAB_TABLE_UNIT_SLITINDEX, XSH_RESID_TAB_TABLE_UNIT_SLITPOSITION, XSH_RESID_TAB_TABLE_UNIT_SN, XSH_RESID_TAB_TABLE_UNIT_WAVELENGTH, XSH_RESID_TAB_TABLE_UNIT_XGAUSS, XSH_RESID_TAB_TABLE_UNIT_XPOLY, XSH_RESID_TAB_TABLE_UNIT_XTHANNEAL, XSH_RESID_TAB_TABLE_UNIT_XTHPRE, XSH_RESID_TAB_TABLE_UNIT_YGAUSS, XSH_RESID_TAB_TABLE_UNIT_YPOLY, XSH_RESID_TAB_TABLE_UNIT_YTHANNEAL, XSH_RESID_TAB_TABLE_UNIT_YTHPRE, XSH_TABLE_FREE, XSH_TABLE_NEW_COL, XSH_WAVESOLTYPE_MODEL, XSH_WAVESOLTYPE_POLYNOMIAL, xsh_resid_tab::ygauss, and xsh_resid_tab::ypoly.

Referenced by xsh_detect_arclines(), and xsh_detect_arclines_dan().