X-shooter Pipeline Reference Manual 3.8.15
Macros | Functions

Macros

#define MODULE_ID   "XSH_UTILITY"
 
#define MODULE_ID   "CPL_IMAGE_FIT_GAUSSIAN"
 
#define MODULE_ID   "CPL_IMAGE_THRESHOLD"
 
#define MODULE_ID   "CPL_IMAGE_FIT_GAUSSIAN"
 
#define MODULE_ID   "CPL_IMAGE_FIT_GAUSSIAN"
 
#define MODULE_ID   "CPL_IMAGE_FIT_GAUSSIAN"
 
#define MODULE_ID   "XSH_CORRECT_VACUUM_TO_AIR"
 
#define MODULE_ID   "XSH_DETECT_LINE_FILE"
 
#define PI_NUMB   (3.1415926535897932384626433832795)
 
#define MODULE_ID   "XSH_DETECT_LINE_POS"
 
#define MODULE_ID   "XSH_DETECT_LINE_POS2"
 
#define MODULE_ID   "XSH_STARTUP"
 
#define MODULE_ID   "XSH_TELLURIC_COR"
 
#define MODULE_ID   "XSH_TOOLS_PERF"
 

Functions

static double xsh_resample_double (double wout, double *pw1, double *pf1, double wmin, double wmax, int size_obs)
 
static cpl_table * xsh_table_resample_table (cpl_table *tinp, const char *cwinp, const char *cfinp, cpl_table *tref, const char *cwref, const char *cfref)
 
static cpl_table * xsh_table_downsample_table (cpl_table *tinp, const char *cwinp, const char *cfinp, cpl_table *tref, const char *cwref, const char *cfref)
 
cpl_table * xsh_table_resample_uniform (cpl_table *tinp, const char *cwinp, const char *cfinp, const double wstp)
 
static cpl_table * xsh_spectrum_to_table (xsh_spectrum *s)
 
static cpl_error_code xsh_evaluate_tell_model (cpl_table *corr, xsh_instrument *instrument, const int ext, double *mean, double *rms)
 
static cpl_table * xsh_extract_ranges_to_fit (cpl_table *table_in, const char *cwav, xsh_instrument *instrument)
 
static cpl_error_code xsh_extract_points_to_fit (cpl_table *table, const char *cwav, const char *cratio, const int nsamples, xsh_instrument *instrument, cpl_vector **vec_wave, cpl_vector **vec_flux)
 
static cpl_error_code xsh_get_xcorrel_peak (cpl_vector *wcorr, cpl_vector *fcorr, XSH_GAUSSIAN_FIT *gfit, const double range, const int ext)
 
static cpl_table * xsh_table_select_range (cpl_table *table_in, const char *col, const double wmin, const double wmax)
 
cpl_error_code xsh_correl_spectra (double *flux_s, double *flux_m, const int size, const int hsearch, const double wlogstp, const int norm_xcorr, const double range, const int ext, XSH_GAUSSIAN_FIT *gfit)
 
static cpl_error_code xsh_align_model_to_spectrum (cpl_table *table_me, cpl_table *table_se, const double wlogstp, const int norm_xcorr, const int ext, cpl_table **table_mm)
 
cpl_table * xsh_telluric_model_eval (cpl_frame *frame_m, xsh_spectrum *s, xsh_instrument *instrument, cpl_size *model_idx)
 
static cpl_image * xsh_imagelist_collapse_create (cpl_imagelist *iml)
 
cpl_error_code test_mem (void)
 
static cpl_image * xsh_compute_scale (cpl_imagelist *iml_data, cpl_mask *bpm, const int mode, const int win_hsz)
 
static cpl_image * xsh_compute_scale_tab (cpl_imagelist *iml_data, cpl_mask *bpm, cpl_table *tab_bpm, const int mode, const int win_hsz)
 
static cpl_error_code xsh_compute_scale_tab2 (cpl_imagelist *iml_data, cpl_table *tab_bpm, cpl_imagelist *scale_frames, cpl_image **ima_corr)
 
cpl_error_code xsh_flag_bp_at_location (cpl_binary *pbpm, int pix, cpl_binary bp_code, const int mode, const int sx)
 
static cpl_image * xsh_define_gauss_profile (const int sx, const int sy, const double A, const double sigma, const double bkg, cpl_vector *trace, const int min, const int max, const int mode)
 
static cpl_error_code test_xsh_set_min_max (const int sx, const int sy, const int mode, int *min, int *max)
 
static cpl_vector * test_xsh_set_trace (const int sx, const int sy, const int mode)
 
static cpl_error_code test_xsh_fill_bpm (const int sx, const int sy, const int mode, const int i, cpl_image **ima, cpl_mask **bpm_tot)
 
static cpl_table * test_xsh_bpm2tab (const cpl_mask *bpm)
 
static cpl_imagelist * xsh_find_image_scale_factors (const cpl_imagelist *iml_in, cpl_image *ima_in)
 
static cpl_error_code test_combine_ima_gauss (const int mode, const int win_hsz)
 
static cpl_error_code test_combine_ima_gauss2 (const int mode)
 
static cpl_error_code test_combine_ima_gauss3 (const int mode)
 
static cpl_error_code test_combine_ima_uniform2 (const int mode)
 
static xsh_rec_listtest_xsh_create_list_from_image (const char *fname, const char *lname)
 
static cpl_error_code test_create_ima_uniform (const int sx, const int sy, const double bkg, const double RON, const double gain, const char *fname)
 
static cpl_error_code test_create_ima_gauss (const int sx, const int sy, const double bkg, const double RON, const double gain, const double A, const double sigma, const char *fname)
 
static cpl_error_code test_combine_lists (void)
 
static cpl_error_code test_combine_rec_list (const int mode, const int win_hsz)
 
int main (int argc, char **argv)
 Some test about performances.
 
int test_catalog ()
 Some test about performances.
 
int main (int argc, char *argv[])
 
static cpl_error_code xsh_add_fits_key_min_set (cpl_propertylist *plist)
 
int main ()
 Some test about performances.
 
static cpl_error_code xsh_line_group_stat (const int nbins, const int local_sz, const int nside, const double *xbin, cpl_table *tab, double *local_median, double *local_stdev, int *group_nbin, double *group_mean, double *group_median)
 
static cpl_error_code xsh_line_fill_xbin_ybin_ysig (const int nbins, const double wmin, const double bin, cpl_table *tab, const int *h, double *xbin, double *ybin, double *ysig)
 
double * xsh_find_em_lines (const int nbins, const int nside, const double min_bk_space, const double intermed_bk_space, const double *local_median, const double *local_stdev, const int *group_nbin, const double *group_mean, const double *group_median, int *pltype, double *bk_space_list)
 
double * xsh_find_abs_lines (const int nbins, const int nside, const double min_bk_space, const double intermed_bk_space, const double *local_median, const double *local_stdev, const int *group_nbin, const double *group_mean, const double *group_median, int *pltype, double *bk_space_list)
 
static cpl_error_code xsh_find_spectrum_slope_changes (const int nbins, const int nside, const double min_bk_space, const double *ybin, const double *ysig, int *pltype, double *bk_space_list)
 
static cpl_error_code xsh_lines_set_breakpoints (cpl_table *stab)
 
static void xsh_gfit_tests (void)
 
void test_tech_eval_perf (int indice, double val)
 Some test about performances.
 

Detailed Description

Test some tools functions for performances check

Apply formula: lam_air = lam_vac/(1.0002735182+131.4182/lam_vac2+2.76249E8/lam_vac4)

Macro Definition Documentation

◆ MODULE_ID [1/13]

#define MODULE_ID   "XSH_UTILITY"

Definition at line 53 of file test-convert_wave_map_to_order_map.c.

◆ MODULE_ID [2/13]

#define MODULE_ID   "CPL_IMAGE_FIT_GAUSSIAN"

Definition at line 53 of file test-cpl_image_fit_gaussian.c.

◆ MODULE_ID [3/13]

#define MODULE_ID   "CPL_IMAGE_THRESHOLD"

Definition at line 51 of file test-cpl_image_threshold.c.

◆ MODULE_ID [4/13]

#define MODULE_ID   "CPL_IMAGE_FIT_GAUSSIAN"

Definition at line 53 of file test-spectrum_stat.c.

◆ MODULE_ID [5/13]

#define MODULE_ID   "CPL_IMAGE_FIT_GAUSSIAN"

Definition at line 53 of file test-tell_catalog.c.

◆ MODULE_ID [6/13]

#define MODULE_ID   "CPL_IMAGE_FIT_GAUSSIAN"

Definition at line 53 of file test-telluric_sampling.c.

◆ MODULE_ID [7/13]

#define MODULE_ID   "XSH_CORRECT_VACUUM_TO_AIR"

Definition at line 59 of file test-xsh_correct_vacuum_to_air.c.

◆ MODULE_ID [8/13]

#define MODULE_ID   "XSH_DETECT_LINE_FILE"

Definition at line 59 of file test-xsh_detect_line_file.c.

◆ MODULE_ID [9/13]

#define MODULE_ID   "XSH_DETECT_LINE_POS"

Definition at line 58 of file test-xsh_detect_line_pos.c.

◆ MODULE_ID [10/13]

#define MODULE_ID   "XSH_DETECT_LINE_POS2"

Definition at line 58 of file test-xsh_detect_line_pos2.c.

◆ MODULE_ID [11/13]

#define MODULE_ID   "XSH_STARTUP"

Definition at line 55 of file test-xsh_startup.c.

◆ MODULE_ID [12/13]

#define MODULE_ID   "XSH_TELLURIC_COR"

Definition at line 59 of file test-xsh_telluric_cor.c.

◆ MODULE_ID [13/13]

#define MODULE_ID   "XSH_TOOLS_PERF"

Definition at line 53 of file test-xsh_tools_perf.c.

◆ PI_NUMB

#define PI_NUMB   (3.1415926535897932384626433832795)

Definition at line 81 of file test-xsh_detect_line_file.c.

Function Documentation

◆ main() [1/3]

int main ( void  )

◆ main() [2/3]

int main ( int  argc,
char **  argv 
)

Some test about performances.

Unit test of XSH_DETECT_ARCLINES.

Unit test of xsh_resid_tab.

Unit test of xsh_remove_crh_single.

Unit test of XSH_PREPARE.

Unit test of xsh_localize_obj.

Unit test of xsh_opt_extract.

Unit test of PRE module.

Unit test of xsh_flat_merge.

Unit test of xsh_extract_clean.

Unit test of xsh_data_wave_tab_2d.

Unit test of xsh_data_star_flux.

Unit test of xsh_extract.

Unit test of xsh_rectify. Needs the PRE frame, order table, wave solution, instrument, rectify parameters, the map.

Create a SLITMAP and a WAVEMAP from Set Of Files (SOF)

Returns
0 if success

Test the Data Reduction Library function XSH_CREATE_MAP

Returns
0 if success
0 if tests passed successfully

Test the PRE module.

Returns
0 if tests passed successfully

Test the Data Reduction Library function XSH_PREPARE

Returns
0 if success

Test behaviour of xsh_remove_crh_single function.

Returns
0 if tests passed successfully

Test the Data Reduction Library function XSH_DETECT_ARCLINES

Definition at line 1724 of file test-combine_flux_with_scaling.c.

References mode, and test_combine_ima_gauss3().

◆ main() [3/3]

int main ( int  argc,
char *  argv[] 
)

Definition at line 134 of file test-tell_catalog.c.

◆ test_catalog()

int test_catalog ( )

Some test about performances.

Returns

Definition at line 62 of file test-tell_catalog.c.

References xsh_error_dump, xsh_free_propertylist(), xsh_free_table(), xsh_msg, and xsh_msg_warning.

◆ test_combine_ima_gauss()

static cpl_error_code test_combine_ima_gauss ( const int  mode,
const int  win_hsz 
)
static

◆ test_combine_ima_gauss2()

static cpl_error_code test_combine_ima_gauss2 ( const int  mode)
static

◆ test_combine_ima_gauss3()

static cpl_error_code test_combine_ima_gauss3 ( const int  mode)
static

◆ test_combine_ima_uniform2()

static cpl_error_code test_combine_ima_uniform2 ( const int  mode)
static

◆ test_combine_lists()

static cpl_error_code test_combine_lists ( void  )
static

◆ test_combine_rec_list()

static cpl_error_code test_combine_rec_list ( const int  mode,
const int  win_hsz 
)
static

Definition at line 1708 of file test-combine_flux_with_scaling.c.

References test_combine_lists().

◆ test_create_ima_gauss()

static cpl_error_code test_create_ima_gauss ( const int  sx,
const int  sy,
const double  bkg,
const double  RON,
const double  gain,
const double  A,
const double  sigma,
const char *  fname 
)
static

◆ test_create_ima_uniform()

static cpl_error_code test_create_ima_uniform ( const int  sx,
const int  sy,
const double  bkg,
const double  RON,
const double  gain,
const char *  fname 
)
static

◆ test_mem()

cpl_error_code test_mem ( void  )

Definition at line 133 of file test-combine_flux_with_scaling.c.

References niter.

◆ test_tech_eval_perf()

void test_tech_eval_perf ( int  indice,
double  val 
)

Some test about performances.

Returns

Definition at line 82 of file test-xsh_tools_perf.c.

References check, XSH_ASSURE_NOT_ILLEGAL, xsh_free_vector(), xsh_msg, and xsh_tools_tchebitchev_poly_eval().

◆ test_xsh_bpm2tab()

static cpl_table * test_xsh_bpm2tab ( const cpl_mask *  bpm)
static

◆ test_xsh_create_list_from_image()

static xsh_rec_list * test_xsh_create_list_from_image ( const char *  fname,
const char *  lname 
)
static

◆ test_xsh_fill_bpm()

static cpl_error_code test_xsh_fill_bpm ( const int  sx,
const int  sy,
const int  mode,
const int  i,
cpl_image **  ima,
cpl_mask **  bpm_tot 
)
static

◆ test_xsh_set_min_max()

static cpl_error_code test_xsh_set_min_max ( const int  sx,
const int  sy,
const int  mode,
int *  min,
int *  max 
)
static

◆ test_xsh_set_trace()

static cpl_vector * test_xsh_set_trace ( const int  sx,
const int  sy,
const int  mode 
)
static

◆ xsh_add_fits_key_min_set()

static cpl_error_code xsh_add_fits_key_min_set ( cpl_propertylist *  plist)
static

◆ xsh_align_model_to_spectrum()

static cpl_error_code xsh_align_model_to_spectrum ( cpl_table *  table_me,
cpl_table *  table_se,
const double  wlogstp,
const int  norm_xcorr,
const int  ext,
cpl_table **  table_mm 
)
static

◆ xsh_compute_scale()

static cpl_image * xsh_compute_scale ( cpl_imagelist *  iml_data,
cpl_mask *  bpm,
const int  mode,
const int  win_hsz 
)
static

Definition at line 164 of file test-combine_flux_with_scaling.c.

References mode, n, x, xsh_msg, xsh_print_rec_status(), and y.

◆ xsh_compute_scale_tab()

static cpl_image * xsh_compute_scale_tab ( cpl_imagelist *  iml_data,
cpl_mask *  bpm,
cpl_table *  tab_bpm,
const int  mode,
const int  win_hsz 
)
static

Definition at line 423 of file test-combine_flux_with_scaling.c.

References m, mode, n, size, x, xsh_msg, xsh_print_rec_status(), and y.

Referenced by test_combine_ima_gauss().

◆ xsh_compute_scale_tab2()

static cpl_error_code xsh_compute_scale_tab2 ( cpl_imagelist *  iml_data,
cpl_table *  tab_bpm,
cpl_imagelist *  scale_frames,
cpl_image **  ima_corr 
)
static

◆ xsh_correl_spectra()

cpl_error_code xsh_correl_spectra ( double *  flux_s,
double *  flux_m,
const int  size,
const int  hsearch,
const double  wlogstp,
const int  norm_xcorr,
const double  range,
const int  ext,
XSH_GAUSSIAN_FIT gfit 
)

◆ xsh_define_gauss_profile()

static cpl_image * xsh_define_gauss_profile ( const int  sx,
const int  sy,
const double  A,
const double  sigma,
const double  bkg,
cpl_vector *  trace,
const int  min,
const int  max,
const int  mode 
)
static

◆ xsh_evaluate_tell_model()

static cpl_error_code xsh_evaluate_tell_model ( cpl_table *  corr,
xsh_instrument instrument,
const int  ext,
double *  mean,
double *  rms 
)
static

◆ xsh_extract_points_to_fit()

static cpl_error_code xsh_extract_points_to_fit ( cpl_table *  table,
const char *  cwav,
const char *  cratio,
const int  nsamples,
xsh_instrument instrument,
cpl_vector **  vec_wave,
cpl_vector **  vec_flux 
)
static

◆ xsh_extract_ranges_to_fit()

static cpl_table * xsh_extract_ranges_to_fit ( cpl_table *  table_in,
const char *  cwav,
xsh_instrument instrument 
)
static

◆ xsh_find_abs_lines()

double * xsh_find_abs_lines ( const int  nbins,
const int  nside,
const double  min_bk_space,
const double  intermed_bk_space,
const double *  local_median,
const double *  local_stdev,
const int *  group_nbin,
const double *  group_mean,
const double *  group_median,
int *  pltype,
double *  bk_space_list 
)

Definition at line 190 of file test-xsh_sky_lines_sampling.c.

References xsh_msg_warning.

Referenced by xsh_lines_set_breakpoints().

◆ xsh_find_em_lines()

double * xsh_find_em_lines ( const int  nbins,
const int  nside,
const double  min_bk_space,
const double  intermed_bk_space,
const double *  local_median,
const double *  local_stdev,
const int *  group_nbin,
const double *  group_mean,
const double *  group_median,
int *  pltype,
double *  bk_space_list 
)

Definition at line 145 of file test-xsh_sky_lines_sampling.c.

References xsh_msg_warning.

Referenced by xsh_lines_set_breakpoints().

◆ xsh_find_image_scale_factors()

static cpl_imagelist * xsh_find_image_scale_factors ( const cpl_imagelist *  iml_in,
cpl_image *  ima_in 
)
static

◆ xsh_find_spectrum_slope_changes()

static cpl_error_code xsh_find_spectrum_slope_changes ( const int  nbins,
const int  nside,
const double  min_bk_space,
const double *  ybin,
const double *  ysig,
int *  pltype,
double *  bk_space_list 
)
static

Definition at line 234 of file test-xsh_sky_lines_sampling.c.

References xsh_msg_warning.

Referenced by xsh_lines_set_breakpoints().

◆ xsh_flag_bp_at_location()

cpl_error_code xsh_flag_bp_at_location ( cpl_binary *  pbpm,
int  pix,
cpl_binary  bp_code,
const int  mode,
const int  sx 
)

Definition at line 762 of file test-combine_flux_with_scaling.c.

References mode.

Referenced by test_xsh_fill_bpm().

◆ xsh_get_xcorrel_peak()

static cpl_error_code xsh_get_xcorrel_peak ( cpl_vector *  wcorr,
cpl_vector *  fcorr,
XSH_GAUSSIAN_FIT gfit,
const double  range,
const int  ext 
)
static

◆ xsh_gfit_tests()

static void xsh_gfit_tests ( void  )
static

Definition at line 85 of file test-xsh_startup.c.

References check, max, size, xsh_free_image(), xsh_image_find_barycenter(), and xsh_msg.

◆ xsh_imagelist_collapse_create()

static cpl_image * xsh_imagelist_collapse_create ( cpl_imagelist *  iml)
static

◆ xsh_line_fill_xbin_ybin_ysig()

static cpl_error_code xsh_line_fill_xbin_ybin_ysig ( const int  nbins,
const double  wmin,
const double  bin,
cpl_table *  tab,
const int *  h,
double *  xbin,
double *  ybin,
double *  ysig 
)
static

Definition at line 104 of file test-xsh_sky_lines_sampling.c.

References xsh_free_table(), and xsh_msg_warning.

Referenced by xsh_lines_set_breakpoints().

◆ xsh_line_group_stat()

static cpl_error_code xsh_line_group_stat ( const int  nbins,
const int  local_sz,
const int  nside,
const double *  xbin,
cpl_table *  tab,
double *  local_median,
double *  local_stdev,
int *  group_nbin,
double *  group_mean,
double *  group_median 
)
static

Definition at line 52 of file test-xsh_sky_lines_sampling.c.

References xsh_free_table(), and xsh_msg_warning.

Referenced by xsh_lines_set_breakpoints().

◆ xsh_lines_set_breakpoints()

static cpl_error_code xsh_lines_set_breakpoints ( cpl_table *  stab)
static

◆ xsh_resample_double()

static double xsh_resample_double ( double  wout,
double *  pw1,
double *  pf1,
double  wmin,
double  wmax,
int  size_obs 
)
static

◆ xsh_spectrum_to_table()

static cpl_table * xsh_spectrum_to_table ( xsh_spectrum s)
static

◆ xsh_table_downsample_table()

static cpl_table * xsh_table_downsample_table ( cpl_table *  tinp,
const char *  cwinp,
const char *  cfinp,
cpl_table *  tref,
const char *  cwref,
const char *  cfref 
)
static

Definition at line 134 of file xsh_utils_response.c.

References check, and xsh_resample_double().

Referenced by xsh_align_model_to_spectrum(), and xsh_telluric_model_eval().

◆ xsh_table_resample_table()

static cpl_table * xsh_table_resample_table ( cpl_table *  tinp,
const char *  cwinp,
const char *  cfinp,
cpl_table *  tref,
const char *  cwref,
const char *  cfref 
)
static

Definition at line 90 of file xsh_utils_response.c.

References check, and xsh_resample_double().

Referenced by xsh_telluric_model_eval().

◆ xsh_table_resample_uniform()

cpl_table * xsh_table_resample_uniform ( cpl_table *  tinp,
const char *  cwinp,
const char *  cfinp,
const double  wstp 
)

Definition at line 189 of file xsh_utils_response.c.

References check, size, and xsh_resample_double().

Referenced by xsh_align_model_to_spectrum().

◆ xsh_table_select_range()

static cpl_table * xsh_table_select_range ( cpl_table *  table_in,
const char *  col,
const double  wmin,
const double  wmax 
)
static

Definition at line 682 of file xsh_utils_response.c.

Referenced by xsh_telluric_model_eval().

◆ xsh_telluric_model_eval()

cpl_table * xsh_telluric_model_eval ( cpl_frame *  frame_m,
xsh_spectrum s,
xsh_instrument instrument,
cpl_size *  model_idx 
)