Functions | |
xsh_spectrum * | xsh_spectrum_1D_create (double lambda_min, double lambda_max, double lambda_step) |
Create a 1D spectrum structure. | |
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. | |
xsh_spectrum * | xsh_spectrum_load (cpl_frame *s1d_frame) |
Load a 1D spectrum structure. | |
xsh_spectrum * | xsh_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_spectrum * | xsh_spectrum_duplicate (xsh_spectrum *org) |
cpl_frame * | xsh_phys_spectrum_save (xsh_spectrum *s, const char *filename, xsh_instrument *instr) |
save a spectrum |
cpl_frame* xsh_phys_spectrum_save | ( | xsh_spectrum * | s, | |
const char * | filename, | |||
xsh_instrument * | instr | |||
) |
save a spectrum
[in] | s | spectrum structure to save |
[in] | filename | name of the save file |
[in] | instr | instrument |
Definition at line 818 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_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* xsh_spectrum_1D_create | ( | double | lambda_min, | |
double | lambda_max, | |||
double | lambda_step | |||
) |
Create a 1D spectrum structure.
[in] | lambda_min | minimum wavelength of spectrum |
[in] | lambda_max | maximum wavelength of spectrum |
[in] | lambda_step | lambda binning |
Definition at line 69 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, 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, XSH_ASSURE_NOT_ILLEGAL, XSH_CALLOC, XSH_NEW_PROPERTYLIST, xsh_pfits_set_cdelt1(), xsh_pfits_set_crpix1(), xsh_pfits_set_crval1(), xsh_pfits_set_ctype1(), xsh_pfits_set_extname(), and xsh_spectrum_free().
Referenced by xsh_merge_ord_with_tag().
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.
[in] | lambda_min | minimum wavelength of spectrum |
[in] | lambda_max | maximum wavelength of spectrum |
[in] | lambda_step | lambda binning |
[in] | slit_min | minimum slit value |
[in] | slit_max | maximum slit value |
[in] | slit_step | slit step |
Definition at line 136 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, 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, xsh_spectrum::slit_step, XSH_ASSURE_NOT_ILLEGAL, XSH_CALLOC, XSH_NEW_PROPERTYLIST, xsh_pfits_set_cdelt1(), xsh_pfits_set_cdelt2(), xsh_pfits_set_crpix1(), xsh_pfits_set_crpix2(), xsh_pfits_set_crval1(), xsh_pfits_set_crval2(), xsh_pfits_set_ctype1(), xsh_pfits_set_ctype2(), xsh_pfits_set_extname(), xsh_set_cd_matrix2d(), and xsh_spectrum_free().
Referenced by xsh_merge_ord_with_tag().
xsh_spectrum* xsh_spectrum_duplicate | ( | xsh_spectrum * | org | ) |
Definition at line 779 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, 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, XSH_ASSURE_NOT_NULL, and XSH_CALLOC.
Referenced by do_calib_spectrum().
void xsh_spectrum_free | ( | xsh_spectrum ** | s | ) |
free memory associated to an 1D spectrum
[in] | s | spectrum structure to free |
Definition at line 562 of file xsh_data_spectrum.c.
References XSH_FREE, xsh_free_image(), and xsh_free_propertylist().
Referenced by analyse_localization(), analyse_merge_ord(), analyse_spectrum(), xsh_add_product_spectrum(), xsh_compute_absorp(), xsh_compute_resampling_accuracy(), xsh_compute_response(), xsh_compute_response_ord(), xsh_compute_wavelength_resampling_accuracy(), xsh_localize_ifu_slitlet(), xsh_localize_obj_auto(), xsh_mark_tell(), xsh_merge_ord_with_tag(), xsh_monitor_spectrum1D_flux(), xsh_obs_std_correct(), xsh_spectrum_1D_create(), xsh_spectrum_2D_create(), xsh_spectrum_load(), xsh_spectrum_load_order(), and xsh_star_flux_list_load_spectrum().
double* xsh_spectrum_get_errs | ( | xsh_spectrum * | s | ) |
Get errs of spectrum.
[in] | s | spectrum structure |
Definition at line 521 of file xsh_data_spectrum.c.
References check, xsh_spectrum::errs, and XSH_ASSURE_NOT_NULL.
Referenced by xsh_localize_ifu_slitlet(), xsh_merge_ord_with_tag(), and xsh_spectrum_to_table().
double* xsh_spectrum_get_flux | ( | xsh_spectrum * | s | ) |
Get flux of spectrum.
[in] | s | spectrum structure |
Definition at line 499 of file xsh_data_spectrum.c.
References check, xsh_spectrum::flux, and XSH_ASSURE_NOT_NULL.
Referenced by analyse_merge_ord(), analyse_spectrum(), do_calib_spectrum(), xsh_compute_absorp(), xsh_localize_ifu_slitlet(), xsh_merge_ord_with_tag(), xsh_response_calculate(), xsh_spectrum_correct(), xsh_spectrum_to_table(), and xsh_star_flux_list_to_frame().
double xsh_spectrum_get_lambda_max | ( | xsh_spectrum * | s | ) |
Get maximum lambda of spectrum.
[in] | s | spectrum structure |
Definition at line 456 of file xsh_data_spectrum.c.
References xsh_spectrum::lambda_max, and XSH_ASSURE_NOT_NULL.
Referenced by do_calib_spectrum(), xsh_response_calculate(), xsh_spectrum_correct(), and xsh_telluric_model_eval().
double xsh_spectrum_get_lambda_min | ( | xsh_spectrum * | s | ) |
Get minimum lambda of spectrum.
[in] | s | spectrum structure |
Definition at line 435 of file xsh_data_spectrum.c.
References xsh_spectrum::lambda_min, and XSH_ASSURE_NOT_NULL.
Referenced by do_calib_spectrum(), xsh_localize_ifu_slitlet(), xsh_response_calculate(), xsh_spectrum_correct(), xsh_spectrum_to_table(), and xsh_telluric_model_eval().
double xsh_spectrum_get_lambda_step | ( | xsh_spectrum * | s | ) |
Get bin in lambda of spectrum.
[in] | s | spectrum structure |
Definition at line 477 of file xsh_data_spectrum.c.
References xsh_spectrum::lambda_step, and XSH_ASSURE_NOT_NULL.
Referenced by do_calib_spectrum(), xsh_localize_ifu_slitlet(), xsh_response_calculate(), xsh_spectrum_correct(), and xsh_spectrum_to_table().
int* xsh_spectrum_get_qual | ( | xsh_spectrum * | s | ) |
Get qual of spectrum.
[in] | s | spectrum structure |
Definition at line 543 of file xsh_data_spectrum.c.
References check, xsh_spectrum::qual, 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(), and xsh_spectrum_to_table().
int xsh_spectrum_get_size | ( | xsh_spectrum * | s | ) |
Get size of spectrum.
[in] | s | spectrum structure |
Definition at line 371 of file xsh_data_spectrum.c.
References xsh_spectrum::size, and XSH_ASSURE_NOT_NULL.
Referenced by xsh_mark_tell(), xsh_response_calculate(), and xsh_spectrum_correct().
int xsh_spectrum_get_size_lambda | ( | xsh_spectrum * | s | ) |
Get lambda axis size of spectrum.
[in] | s | spectrum structure |
Definition at line 392 of file xsh_data_spectrum.c.
References xsh_spectrum::size_lambda, and XSH_ASSURE_NOT_NULL.
Referenced by do_calib_spectrum(), xsh_compute_absorp(), xsh_localize_obj_auto(), xsh_merge_ord_with_tag(), and xsh_spectrum_to_table().
int xsh_spectrum_get_size_slit | ( | xsh_spectrum * | s | ) |
Get slit axis ize of spectrum.
[in] | s | spectrum structure |
Definition at line 414 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 | ) |
Load a 1D spectrum structure.
[in] | s1d_frame | the 1D spectrum frame |
Definition at line 200 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, xsh_spectrum::lambda_step, xsh_spectrum::qual, xsh_spectrum::qual_header, size, xsh_spectrum::size, xsh_spectrum::size_lambda, xsh_spectrum::size_slit, xsh_spectrum::slit_max, xsh_spectrum::slit_min, xsh_spectrum::slit_step, XSH_ASSURE_NOT_ILLEGAL, XSH_ASSURE_NOT_NULL, XSH_CALLOC, xsh_free_vector(), xsh_pfits_get_cdelt1(), xsh_pfits_get_cdelt2(), xsh_pfits_get_crval1(), xsh_pfits_get_crval2(), xsh_pfits_get_naxis(), xsh_pfits_get_naxis1(), xsh_pfits_get_naxis2(), xsh_spectrum_free(), and xsh_unwrap_vector().
Referenced by analyse_localization(), analyse_merge_ord(), analyse_spectrum(), xsh_add_product_spectrum(), xsh_calibrate_flux(), xsh_compute_absorp(), xsh_compute_resampling_accuracy(), xsh_compute_response(), xsh_compute_response2(), xsh_compute_wavelength_resampling_accuracy(), xsh_localize_ifu_slitlet(), xsh_localize_obj_auto(), xsh_mark_tell(), xsh_monitor_spectrum1D_flux(), xsh_obs_std_correct(), xsh_star_flux_list_load_spectrum(), and xsh_star_flux_list_to_frame().
xsh_spectrum* xsh_spectrum_load_order | ( | cpl_frame * | s1d_frame, | |
xsh_instrument * | instr, | |||
const int | order | |||
) |
Load a 1D spectrum structure.
[in] | s1d_frame | the 1D spectrum frame |
[in] | instr | instrument structure |
[in] | order | order to be loaded |
Definition at line 285 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, xsh_spectrum::lambda_step, xsh_spectrum::qual, xsh_spectrum::qual_header, size, xsh_spectrum::size, xsh_spectrum::size_lambda, xsh_spectrum::size_slit, xsh_spectrum::slit_max, xsh_spectrum::slit_min, xsh_spectrum::slit_step, XSH_ASSURE_NOT_NULL, XSH_CALLOC, xsh_free_vector(), xsh_pfits_get_cdelt1(), xsh_pfits_get_cdelt2(), xsh_pfits_get_crval1(), xsh_pfits_get_crval2(), xsh_pfits_get_naxis(), xsh_pfits_get_naxis1(), xsh_pfits_get_naxis2(), xsh_spectrum_free(), and xsh_unwrap_vector().
Referenced by xsh_compute_response_ord().
cpl_frame* xsh_spectrum_save | ( | xsh_spectrum * | s, | |
const char * | filename, | |||
const char * | tag | |||
) |
save a spectrum
[in] | s | spectrum structure to save |
[in] | filename | name of the save file |
[in] | tag | spectrum pro catg |
Definition at line 586 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_BUNIT_NONE_C, xsh_free_frame(), xsh_free_vector(), xsh_pfits_get_cdelt1(), xsh_pfits_get_cdelt2(), xsh_pfits_get_crpix1(), xsh_pfits_get_crpix2(), xsh_pfits_get_crval1(), xsh_pfits_get_crval2(), xsh_pfits_set_bunit(), xsh_pfits_set_cdelt1(), xsh_pfits_set_crpix1(), xsh_pfits_set_crval1(), xsh_pfits_set_ctype1(), xsh_pfits_set_cunit1(), xsh_pfits_set_extname(), xsh_pfits_set_pcatg(), xsh_pfits_set_wcs(), xsh_plist_set_extra_keys(), XSH_SPECTRUM_DATA_BPP, XSH_SPECTRUM_ERRS_BPP, and XSH_SPECTRUM_QUAL_BPP.
Referenced by xsh_add_product_spectrum(), xsh_compute_resampling_accuracy(), xsh_compute_response(), xsh_compute_wavelength_resampling_accuracy(), xsh_mark_tell(), xsh_merge_ord_with_tag(), xsh_monitor_spectrum1D_flux(), and xsh_star_flux_list_to_frame().
cpl_frame* xsh_spectrum_save_order | ( | xsh_spectrum * | s, | |
const char * | filename, | |||
const char * | tag, | |||
const int | order | |||
) |
save a spectrum
[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) |
Definition at line 713 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().