X-shooter Pipeline Reference Manual 3.8.15
Functions

Functions

xsh_spectrumxsh_spectrum_1D_create (double lambda_min, double lambda_max, double lambda_step)
 Create a 1D spectrum structure.
 
xsh_spectrumxsh_spectrum_2D_create (double lambda_min, double lambda_max, double lambda_step, double slit_min, double slit_max, double slit_step)
 Create a 2D spectrum structure.
 
xsh_spectrumxsh_spectrum_load (cpl_frame *s1d_frame)
 Load a 1D spectrum structure.
 
xsh_spectrumxsh_spectrum_load_order (cpl_frame *s1d_frame, xsh_instrument *instr, const int order)
 Load a 1D spectrum structure.
 
int xsh_spectrum_get_size (xsh_spectrum *s)
 Get size of spectrum.
 
int xsh_spectrum_get_size_lambda (xsh_spectrum *s)
 Get lambda axis size of spectrum.
 
int xsh_spectrum_get_size_slit (xsh_spectrum *s)
 Get slit axis ize of spectrum.
 
double xsh_spectrum_get_lambda_min (xsh_spectrum *s)
 Get minimum lambda of spectrum.
 
double xsh_spectrum_get_lambda_max (xsh_spectrum *s)
 Get maximum lambda of spectrum.
 
double xsh_spectrum_get_lambda_step (xsh_spectrum *s)
 Get bin in lambda of spectrum.
 
double * xsh_spectrum_get_flux (xsh_spectrum *s)
 Get flux of spectrum.
 
double * xsh_spectrum_get_errs (xsh_spectrum *s)
 Get errs of spectrum.
 
int * xsh_spectrum_get_qual (xsh_spectrum *s)
 Get qual of spectrum.
 
cpl_image * xsh_spectrum_get_flux_ima (xsh_spectrum *s)
 Get flux of spectrum as image.
 
cpl_image * xsh_spectrum_get_errs_ima (xsh_spectrum *s)
 Get flux of spectrum as image.
 
cpl_image * xsh_spectrum_get_qual_ima (xsh_spectrum *s)
 Get flux of spectrum as image.
 
void xsh_spectrum_free (xsh_spectrum **s)
 free memory associated to an 1D spectrum
 
cpl_frame * xsh_spectrum_save (xsh_spectrum *s, const char *filename, const char *tag)
 save a spectrum
 
cpl_frame * xsh_spectrum_save_order (xsh_spectrum *s, const char *filename, const char *tag, const int order)
 save a spectrum
 
xsh_spectrumxsh_spectrum_duplicate (xsh_spectrum *org)
 
xsh_spectrumxsh_spectrum_extract_range (xsh_spectrum *org, const double wmin, const double wmax)
 
cpl_error_code xsh_spectrum_cut_dichroic_uvb (cpl_frame *frame1d)
 
cpl_error_code xsh_spectrum_orders_cut_dichroic_uvb (cpl_frame *frame1d, xsh_instrument *instr)
 
cpl_frame * xsh_phys_spectrum_save (xsh_spectrum *s, const char *filename, xsh_instrument *instr)
 save a spectrum
 

Detailed Description

Function Documentation

◆ xsh_phys_spectrum_save()

cpl_frame * xsh_phys_spectrum_save ( xsh_spectrum s,
const char *  filename,
xsh_instrument instr 
)

save a spectrum

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

Definition at line 1052 of file xsh_data_spectrum.c.

References check, check_msg, s, XSH_ASSURE_NOT_NULL, xsh_free_frame(), xsh_free_vector(), XSH_GET_TAG_FROM_ARM, xsh_pfits_set_pcatg(), XSH_PHYS_MERGE1D, XSH_PHYS_MERGE2D, XSH_SPECTRUM_DATA_BPP, XSH_SPECTRUM_ERRS_BPP, and XSH_SPECTRUM_QUAL_BPP.

Referenced by xsh_calibrate_flux().

◆ xsh_spectrum_1D_create()

xsh_spectrum * xsh_spectrum_1D_create ( double  lambda_min,
double  lambda_max,
double  lambda_step 
)

◆ xsh_spectrum_2D_create()

xsh_spectrum * xsh_spectrum_2D_create ( double  lambda_min,
double  lambda_max,
double  lambda_step,
double  slit_min,
double  slit_max,
double  slit_step 
)

Create a 2D spectrum structure.

Parameters
[in]lambda_minminimum wavelength of spectrum
[in]lambda_maxmaximum wavelength of spectrum
[in]lambda_steplambda binning
[in]slit_minminimum slit value
[in]slit_maxmaximum slit value
[in]slit_stepslit step
Returns
the spectrum structure

Definition at line 130 of file xsh_data_spectrum.c.

References check, xsh_spectrum::errs, xsh_spectrum::errs_header, xsh_spectrum::flux, xsh_spectrum::flux_header, xsh_spectrum::lambda_max, xsh_spectrum::lambda_min, lambda_step, xsh_spectrum::lambda_step, xsh_spectrum::qual, xsh_spectrum::qual_header, xsh_spectrum::size, xsh_spectrum::size_lambda, xsh_spectrum::size_slit, xsh_spectrum::slit_max, xsh_spectrum::slit_min, slit_step, xsh_spectrum::slit_step, XSH_ASSURE_NOT_ILLEGAL, XSH_CALLOC, XSH_NEW_PROPERTYLIST, xsh_pfits_set_extname(), xsh_pfits_set_wcs1(), xsh_pfits_set_wcs2(), xsh_set_cd_matrix2d(), and xsh_spectrum_free().

Referenced by main(), and xsh_merge_ord_with_tag().

◆ xsh_spectrum_cut_dichroic_uvb()

cpl_error_code xsh_spectrum_cut_dichroic_uvb ( cpl_frame *  frame1d)

◆ xsh_spectrum_duplicate()

xsh_spectrum * xsh_spectrum_duplicate ( xsh_spectrum org)

◆ xsh_spectrum_extract_range()

xsh_spectrum * xsh_spectrum_extract_range ( xsh_spectrum org,
const double  wmin,
const double  wmax 
)

◆ xsh_spectrum_free()

void xsh_spectrum_free ( xsh_spectrum **  s)

◆ xsh_spectrum_get_errs()

double * xsh_spectrum_get_errs ( xsh_spectrum s)

Get errs of spectrum.

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

Definition at line 510 of file xsh_data_spectrum.c.

References check, s, and XSH_ASSURE_NOT_NULL.

Referenced by xsh_localize_ifu_slitlet(), xsh_merge_ord_with_tag(), xsh_sdp_spectrum_create(), and xsh_spectrum_to_table().

◆ xsh_spectrum_get_errs_ima()

cpl_image * xsh_spectrum_get_errs_ima ( xsh_spectrum s)

Get flux of spectrum as image.

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

Definition at line 571 of file xsh_data_spectrum.c.

References s, and XSH_ASSURE_NOT_NULL.

◆ xsh_spectrum_get_flux()

double * xsh_spectrum_get_flux ( xsh_spectrum s)

◆ xsh_spectrum_get_flux_ima()

cpl_image * xsh_spectrum_get_flux_ima ( xsh_spectrum s)

Get flux of spectrum as image.

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

Definition at line 553 of file xsh_data_spectrum.c.

References s, and XSH_ASSURE_NOT_NULL.

◆ xsh_spectrum_get_lambda_max()

double xsh_spectrum_get_lambda_max ( xsh_spectrum s)

Get maximum lambda of spectrum.

Parameters
[in]sspectrum structure
Returns
maximum lambda of spectrum

Definition at line 445 of file xsh_data_spectrum.c.

References s, and XSH_ASSURE_NOT_NULL.

Referenced by xsh_response_calculate(), xsh_sdp_spectrum_create(), xsh_spectrum_correct(), and xsh_telluric_model_eval().

◆ xsh_spectrum_get_lambda_min()

double xsh_spectrum_get_lambda_min ( xsh_spectrum s)

Get minimum lambda of spectrum.

Parameters
[in]sspectrum structure
Returns
minimum lambda spectrum

Definition at line 424 of file xsh_data_spectrum.c.

References s, and XSH_ASSURE_NOT_NULL.

Referenced by do_calib_spectrum(), xsh_localize_ifu_slitlet(), xsh_response_calculate(), xsh_sdp_spectrum_create(), xsh_spectrum_correct(), xsh_spectrum_to_table(), and xsh_telluric_model_eval().

◆ xsh_spectrum_get_lambda_step()

double xsh_spectrum_get_lambda_step ( xsh_spectrum s)

Get bin in lambda of spectrum.

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

Definition at line 466 of file xsh_data_spectrum.c.

References s, and XSH_ASSURE_NOT_NULL.

Referenced by do_calib_spectrum(), xsh_localize_ifu_slitlet(), xsh_response_calculate(), xsh_sdp_spectrum_create(), xsh_spectrum_correct(), and xsh_spectrum_to_table().

◆ xsh_spectrum_get_qual()

int * xsh_spectrum_get_qual ( xsh_spectrum s)

Get qual of spectrum.

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

Definition at line 532 of file xsh_data_spectrum.c.

References check, s, and XSH_ASSURE_NOT_NULL.

Referenced by analyse_spectrum(), do_calib_spectrum(), xsh_localize_ifu_slitlet(), xsh_mark_tell(), xsh_merge_ord_with_tag(), xsh_response_calculate(), xsh_sdp_spectrum_create(), and xsh_spectrum_to_table().

◆ xsh_spectrum_get_qual_ima()

cpl_image * xsh_spectrum_get_qual_ima ( xsh_spectrum s)

Get flux of spectrum as image.

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

Definition at line 590 of file xsh_data_spectrum.c.

References s, and XSH_ASSURE_NOT_NULL.

◆ xsh_spectrum_get_size()

int xsh_spectrum_get_size ( xsh_spectrum s)

Get size of spectrum.

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

Definition at line 360 of file xsh_data_spectrum.c.

References s, and XSH_ASSURE_NOT_NULL.

Referenced by xsh_mark_tell(), xsh_response_calculate(), xsh_sdp_spectrum_create(), and xsh_spectrum_correct().

◆ xsh_spectrum_get_size_lambda()

int xsh_spectrum_get_size_lambda ( xsh_spectrum s)

Get lambda axis size of spectrum.

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

Definition at line 381 of file xsh_data_spectrum.c.

References s, and XSH_ASSURE_NOT_NULL.

Referenced by do_calib_spectrum(), main(), xsh_compute_absorp(), xsh_localize_obj_auto(), xsh_merge_ord_with_tag(), and xsh_spectrum_to_table().

◆ xsh_spectrum_get_size_slit()

int xsh_spectrum_get_size_slit ( xsh_spectrum s)

Get slit axis ize of spectrum.

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

Definition at line 403 of file xsh_data_spectrum.c.

References s, and XSH_ASSURE_NOT_NULL.

Referenced by do_calib_spectrum(), main(), xsh_localize_obj_auto(), and xsh_merge_ord_with_tag().

◆ xsh_spectrum_load()

xsh_spectrum * xsh_spectrum_load ( cpl_frame *  s1d_frame)

◆ xsh_spectrum_load_order()

xsh_spectrum * xsh_spectrum_load_order ( cpl_frame *  s1d_frame,
xsh_instrument instr,
const int  order 
)

◆ xsh_spectrum_orders_cut_dichroic_uvb()

cpl_error_code xsh_spectrum_orders_cut_dichroic_uvb ( cpl_frame *  frame1d,
xsh_instrument instr 
)

◆ xsh_spectrum_save()

cpl_frame * xsh_spectrum_save ( xsh_spectrum s,
const char *  filename,
const char *  tag 
)

◆ xsh_spectrum_save_order()

cpl_frame * xsh_spectrum_save_order ( xsh_spectrum s,
const char *  filename,
const char *  tag,
const int  order 
)

save a spectrum

Parameters
[in]sspectrum structure to save
[in]filenamename of the save file
[in]tagspectrum pro catg
[in]orderspectrum relative order (if >0 spectrum is saved as extend)
Returns
1D spectrum frame

Definition at line 756 of file xsh_data_spectrum.c.

References check, check_msg, order, s, XSH_ASSURE_NOT_NULL, xsh_free_frame(), xsh_free_vector(), xsh_pfits_set_pcatg(), XSH_SPECTRUM_DATA_BPP, XSH_SPECTRUM_ERRS_BPP, and XSH_SPECTRUM_QUAL_BPP.

Referenced by xsh_compute_response_ord(), and xsh_spectrum_orders_cut_dichroic_uvb().