00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026 #ifndef XSH_UTILS_EFFICIENCY_H
00027 #define XSH_UTILS_EFFICIENCY_H
00028 #include <cpl.h>
00029
00030
00031 typedef enum {
00032 XSH_GD71,
00033 XSH_Feige110,
00034 XSH_GD153,
00035 XSH_LTT3218,
00036 XSH_LTT7987,
00037 XSH_BD17,
00038 XSH_EG274
00039 } xsh_std_star_id;
00040
00041 typedef struct {
00042 double wguess ;
00043 double range_wmin;
00044 double range_wmax;
00045 double ipol_wmin_max;
00046 double ipol_wmax_min;
00047 double ipol_hbox;
00048
00049 } xsh_rv_ref_wave_param ;
00050
00051
00052 double xsh_get_std_star_vel(xsh_std_star_id std_star_id ,XSH_ARM arm);
00053
00054
00055 void
00056 xsh_load_ref_table(cpl_frameset* frames,
00057 double dRA,
00058 double dDEC,
00059 double EPSILON,
00060 xsh_instrument* instrument,
00061 cpl_table** pptable);
00062
00063
00064
00065 cpl_frame*
00066 xsh_utils_efficiency(
00067 cpl_frameset * frames,
00068 double dGain,
00069 double dEpsilon,
00070 double aimprim,
00071 xsh_instrument* inst,
00072 const char* col_name_atm_wave,
00073 const char* col_name_atm_abs,
00074 const char* col_name_ref_wave,
00075 const char* col_name_ref_flux,
00076 const char* col_name_ref_bin,
00077 const char* col_name_obj_wave,
00078 const char* col_name_obj_flux
00079 );
00080
00081 cpl_table*
00082 xsh_utils_efficiency_internal(
00083 cpl_table* tbl_obj_spectrum,
00084 cpl_table* tbl_atmext,
00085 cpl_table* tbl_ref,
00086 double exptime,
00087 double airmass,
00088 double aimprim,
00089 double gain,
00090 int biny,
00091 double src2ref_wave_sampling,
00092 const char* col_name_atm_wave,
00093 const char* col_name_atm_abs,
00094 const char* col_name_ref_wave,
00095 const char* col_name_ref_flux,
00096 const char* col_name_ref_bin,
00097 const char* col_name_obj_wave,
00098 const char* col_name_obj_flux,
00099 int* ntot, int* nclip
00100 );
00101
00102
00103
00104 cpl_frame*
00105 xsh_efficiency_compute(cpl_frame* frm_sci,
00106 cpl_frame* frm_cat,
00107 cpl_frame* frm_atmext,
00108 cpl_frame* high_abs_win,
00109 xsh_instrument* instrument);
00110
00111 cpl_frame*
00112 xsh_catalog_extract_spectrum_frame(cpl_frame* frm_cat,
00113 cpl_frame* frm_sci);
00114
00115
00116 cpl_error_code
00117 xsh_parse_catalog_std_stars(cpl_frame* cat,
00118 double dRA,
00119 double dDEC,
00120 double EPSILON,
00121 cpl_table** pptable,
00122 xsh_std_star_id* std_star_id);
00123
00124 cpl_error_code
00125 xsh_rv_ref_wave_init(xsh_std_star_id std_star_id ,XSH_ARM arm,xsh_rv_ref_wave_param* rv_ref_wave);
00126
00127 void
00128 xsh_frame_sci_get_ra_dec_airmass(cpl_frame* frm_sci,double* ra, double* dec, double* airmass);
00129
00130 double
00131 xsh_utils_compute_airm(cpl_frameset* raws);
00132 double
00133 xsh_utils_compute_airm_eff(cpl_frameset* raws);
00134
00135 xsh_rv_ref_wave_param * xsh_rv_ref_wave_param_create(void);
00136 void xsh_rv_ref_wave_param_destroy(xsh_rv_ref_wave_param * rv_ref_wave);
00137 #endif