Spectrum 1D and 2D
[Data Format Handling 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, xsh_instrument *instr)
 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.
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)
cpl_frame * xsh_phys_spectrum_save (xsh_spectrum *s, const char *filename, xsh_instrument *instr)
 save a spectrum

Function Documentation

cpl_frame* xsh_phys_spectrum_save ( xsh_spectrum s,
const char *  filename,
xsh_instrument instr 
)
xsh_spectrum* xsh_spectrum_1D_create ( double  lambda_min,
double  lambda_max,
double  lambda_step 
)
xsh_spectrum* xsh_spectrum_2D_create ( double  lambda_min,
double  lambda_max,
double  lambda_step,
double  slit_min,
double  slit_max,
double  slit_step 
)
xsh_spectrum* xsh_spectrum_duplicate ( xsh_spectrum org  ) 
void xsh_spectrum_free ( xsh_spectrum **  s  ) 
double* xsh_spectrum_get_errs ( xsh_spectrum s  ) 

Get errs of spectrum.

Parameters:
[in] s spectrum structure
Returns:
the errs data of spectrum

Definition at line 525 of file xsh_data_spectrum.c.

References check, xsh_spectrum::errs, and XSH_ASSURE_NOT_NULL.

Referenced by xsh_merge_ord_with_tag().

double* xsh_spectrum_get_flux ( xsh_spectrum s  ) 

Get flux of spectrum.

Parameters:
[in] s spectrum structure
Returns:
the flux data of spectrum

Definition at line 503 of file xsh_data_spectrum.c.

References check, xsh_spectrum::flux, and XSH_ASSURE_NOT_NULL.

Referenced by analyse_merge_ord(), do_calib_spectrum(), do_compute(), xsh_merge_ord_with_tag(), and xsh_response_calculate().

double xsh_spectrum_get_lambda_max ( xsh_spectrum s  ) 

Get maximum lambda of spectrum.

Parameters:
[in] s spectrum structure
Returns:
maximum lambda of spectrum

Definition at line 460 of file xsh_data_spectrum.c.

References xsh_spectrum::lambda_max, and XSH_ASSURE_NOT_NULL.

Referenced by do_calib_spectrum(), do_compute(), and xsh_response_calculate().

double xsh_spectrum_get_lambda_min ( xsh_spectrum s  ) 

Get minimum lambda of spectrum.

Parameters:
[in] s spectrum structure
Returns:
minimum lambda spectrum

Definition at line 439 of file xsh_data_spectrum.c.

References xsh_spectrum::lambda_min, and XSH_ASSURE_NOT_NULL.

Referenced by do_calib_spectrum(), do_compute(), and xsh_response_calculate().

double xsh_spectrum_get_lambda_step ( xsh_spectrum s  ) 

Get bin in lambda of spectrum.

Parameters:
[in] s spectrum structure
Returns:
bin in lambda of spectrum

Definition at line 481 of file xsh_data_spectrum.c.

References xsh_spectrum::lambda_step, and XSH_ASSURE_NOT_NULL.

Referenced by do_calib_spectrum(), do_compute(), and xsh_response_calculate().

int* xsh_spectrum_get_qual ( xsh_spectrum s  ) 

Get qual of spectrum.

Parameters:
[in] s spectrum structure
Returns:
the qual data of spectrum

Definition at line 547 of file xsh_data_spectrum.c.

References check, xsh_spectrum::qual, and XSH_ASSURE_NOT_NULL.

Referenced by do_calib_spectrum(), do_compute(), xsh_merge_ord_with_tag(), and xsh_response_calculate().

int xsh_spectrum_get_size ( xsh_spectrum s  ) 

Get size of spectrum.

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

Definition at line 375 of file xsh_data_spectrum.c.

References xsh_spectrum::size, and XSH_ASSURE_NOT_NULL.

Referenced by xsh_response_calculate().

int xsh_spectrum_get_size_lambda ( xsh_spectrum s  ) 

Get lambda axis size of spectrum.

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

Definition at line 396 of file xsh_data_spectrum.c.

References xsh_spectrum::size_lambda, and XSH_ASSURE_NOT_NULL.

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

int xsh_spectrum_get_size_slit ( xsh_spectrum s  ) 

Get slit axis ize of spectrum.

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

Definition at line 418 of file xsh_data_spectrum.c.

References xsh_spectrum::size_slit, and XSH_ASSURE_NOT_NULL.

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

xsh_spectrum* xsh_spectrum_load ( cpl_frame *  s1d_frame,
xsh_instrument instr 
)
xsh_spectrum* xsh_spectrum_load_order ( cpl_frame *  s1d_frame,
xsh_instrument instr,
const int  order 
)
cpl_frame* xsh_spectrum_save ( xsh_spectrum s,
const char *  filename,
const char *  tag 
)
cpl_frame* xsh_spectrum_save_order ( xsh_spectrum s,
const char *  filename,
const char *  tag,
const int  order 
)

save a spectrum

Parameters:
[in] s spectrum structure to save
[in] filename name of the save file
[in] tag spectrum pro catg
[in] order spectrum relative order (if >0 spectrum is saved as extend)
Returns:
1D spectrum frame

Definition at line 662 of file xsh_data_spectrum.c.

References check, check_msg, xsh_spectrum::errs, xsh_spectrum::errs_header, xsh_spectrum::flux, xsh_spectrum::flux_header, xsh_spectrum::qual, xsh_spectrum::qual_header, xsh_spectrum::size_slit, 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().


Generated on 9 Mar 2011 for X-shooter Pipeline Reference Manual by  doxygen 1.6.1