#include <string.h>
#include <math.h>
#include <cpl.h>
#include <xsh_irplib_utils.h>
#include <xsh_pfits.h>
#include <xsh_msg.h>
#include <xsh_dfs.h>
#include <xsh_error.h>
#include <xsh_utils.h>
#include <xsh_utils_table.h>
#include <xsh_utils_wrappers.h>
#include <xsh_utils_efficiency.h>
#include <xsh_efficiency_response.h>
#include <xsh_star_index.h>
#include <xsh_data_atmos_ext.h>
Go to the source code of this file.
Defines | |
#define | PRO_STD_STAR_SPECTRA "STD_STAR_SPECTRA" |
Functions | |
xsh_xcorrelate | |
static int | xsh_column_to_double (cpl_table *ptable, const char *column) |
static double * | xsh_create_column_double (cpl_table *tbl, const char *col_name, int nrow) |
static cpl_error_code | xsh_get_std_obs_values (cpl_propertylist *plist, double *exptime, double *airmass, double *dRA, double *dDEC) |
get STD star observation exptime, airmass, RA, DEC | |
void | xsh_load_ref_table (cpl_frameset *frames, double dRA, double dDEC, double EPSILON, xsh_instrument *instrument, cpl_table **pptable) |
load reference table | |
cpl_error_code | xsh_rv_ref_wave_init (xsh_std_star_id std_star_id, XSH_ARM arm, xsh_rv_ref_wave_param *w) |
xsh_rv_ref_wave_param * | xsh_rv_ref_wave_param_create (void) |
void | xsh_rv_ref_wave_param_destroy (xsh_rv_ref_wave_param *p) |
cpl_error_code | xsh_parse_catalog_std_stars (cpl_frame *cat, double dRA, double dDEC, double EPSILON, cpl_table **pptable, xsh_std_star_id *std_star_id) |
parse referece std stars catalog | |
cpl_error_code | xsh_efficiency_add_high_abs_regions (cpl_table **eff, HIGH_ABS_REGION *phigh) |
cpl_frame * | xsh_utils_efficiency (cpl_frameset *frames, double dGain, double dEpsilon, double aimprim, xsh_instrument *inst, const char *col_name_atm_wave, const char *col_name_atm_abs, const char *col_name_ref_wave, const char *col_name_ref_flux, const char *col_name_ref_bin, const char *col_name_obj_wave, const char *col_name_obj_flux) |
Compute efficiency. | |
cpl_table * | xsh_utils_efficiency_internal (cpl_table *tbl_obj_spectrum, cpl_table *tbl_atmext, cpl_table *tbl_ref, double exptime, double airmass, double aimprim, double gain, int biny, double src2ref_wave_sampling, const char *col_name_atm_wave, const char *col_name_atm_abs, const char *col_name_ref_wave, const char *col_name_ref_flux, const char *col_name_ref_bin, const char *col_name_obj_wave, const char *col_name_obj_flux, int *ntot, int *nclip) |
Compute efficiency. | |
void | xsh_frame_sci_get_ra_dec_airmass (cpl_frame *frm_sci, double *ra, double *dec, double *airmass) |
get RA, DEC, airmass (mean) of a frame | |
static void | xsh_frame_sci_get_gain_airmass_exptime_naxis1_biny (cpl_frame *frm_sci, xsh_instrument *instrument, double *gain, double *airmass, double *exptime, int *naxis1, int *biny) |
cpl_frame * | xsh_catalog_extract_spectrum_frame (cpl_frame *frm_cat, cpl_frame *frm_sci) |
extract spectrum | |
cpl_frame * | xsh_efficiency_compute (cpl_frame *frm_sci, cpl_frame *frm_cat, cpl_frame *frm_atmext, cpl_frame *high_abs_win, xsh_instrument *instrument) |
computes efficiency | |
static double | slaAirmas (double zd) |
void | slaAoppat (double date, double aoprms[14]) |
static double | xsh_utils_get_airm (cpl_propertylist *plist) |
double | xsh_utils_compute_airm_eff (cpl_frameset *raws) |
double | xsh_utils_compute_airm (cpl_frameset *raws) |
Variables | |
static const char | COL_NAME_HIGH_ABS [] = "HIGH_ABS" |
static const char | COL_NAME_WAVELENGTH [] = "WAVELENGTH" |
static const char | COL_NAME_WAVELENGTH_C [] = "WAVELENGTH" |
static const char | COL_NAME_WAVE_ATMDISP [] = "LAMBDA" |
static const char | COL_NAME_ABS_ATMDISP [] = XSH_ATMOS_EXT_LIST_COLNAME_K |
static const char | COL_NAME_REF [] = "REF" |
static const char | COL_NAME_COR [] = "COR" |
static const char | COL_NAME_SRC_COR [] = "SRC_COR" |
static const char | COL_NAME_WAVE_OBJ [] = "WAVELENGTH" |
static const char | COL_NAME_INT_OBJ [] = "INT_OBJ" |
static const char | COL_NAME_ORD_OBJ [] = "ORD" |
static const char | COL_NAME_WAVE_REF [] = "LAMBDA" |
static const char | COL_NAME_FLUX_REF [] = "FLUX" |
static const char | COL_NAME_BINWIDTH_REF [] = "BIN_WIDTH" |
static const char | COL_NAME_EPHOT [] = "EPHOT" |
static const char | COL_NAME_EXT [] = "EXT" |
static const char | COL_NAME_SRC_EFF [] = "EFF" |
static const char | PAR_NAME_DIT [] = "ESO DET DIT" |
static const double | UVES_flux_factor = 1.e16 |
static char | FRM_EXTCOEFF_TAB [] = XSH_EXTCOEFF_TAB |
#define PRO_STD_STAR_SPECTRA "STD_STAR_SPECTRA" |
Definition at line 49 of file xsh_utils_efficiency.c.
static double slaAirmas | ( | double | zd | ) | [static] |
Definition at line 1173 of file xsh_utils_efficiency.c.
void slaAoppat | ( | double | date, | |
double | aoprms[14] | |||
) |
Definition at line 1253 of file xsh_utils_efficiency.c.
cpl_frame* xsh_catalog_extract_spectrum_frame | ( | cpl_frame * | frm_cat, | |
cpl_frame * | frm_sci | |||
) |
extract spectrum
frm_cat | catalog frame | |
frm_sci | science frame |
Definition at line 836 of file xsh_utils_efficiency.c.
References check, COL_NAME_BINWIDTH_REF, COL_NAME_FLUX_REF, COL_NAME_WAVE_REF, STAR_MATCH_DEPSILON, XSH_ASSURE_NOT_NULL_MSG, xsh_frame_product(), xsh_frame_sci_get_ra_dec_airmass(), and xsh_parse_catalog_std_stars().
static int xsh_column_to_double | ( | cpl_table * | ptable, | |
const char * | column | |||
) | [static] |
Definition at line 477 of file xsh_utils_efficiency.c.
References check, and xsh_msg.
Referenced by xsh_utils_efficiency_internal().
static double * xsh_create_column_double | ( | cpl_table * | tbl, | |
const char * | col_name, | |||
int | nrow | |||
) | [static] |
Definition at line 289 of file xsh_utils_efficiency.c.
References check.
Referenced by xsh_utils_efficiency_internal().
cpl_error_code xsh_efficiency_add_high_abs_regions | ( | cpl_table ** | eff, | |
HIGH_ABS_REGION * | phigh | |||
) |
Definition at line 331 of file xsh_utils_efficiency.c.
References COL_NAME_HIGH_ABS, COL_NAME_WAVELENGTH, HIGH_ABS_REGION::lambda_max, and HIGH_ABS_REGION::lambda_min.
Referenced by xsh_efficiency_compute(), and xsh_utils_efficiency().
cpl_frame* xsh_efficiency_compute | ( | cpl_frame * | frm_sci, | |
cpl_frame * | frm_cat, | |||
cpl_frame * | frm_atmext, | |||
cpl_frame * | high_abs_win, | |||
xsh_instrument * | instrument | |||
) |
computes efficiency
frm_sci | science frame | |
frm_cat | catalog frame | |
frm_atmext | atmos[heric extinction frame | |
instrument | instrument arm setting |
Definition at line 878 of file xsh_utils_efficiency.c.
References biny, check, COL_NAME_ABS_ATMDISP, COL_NAME_BINWIDTH_REF, COL_NAME_FLUX_REF, COL_NAME_INT_OBJ, COL_NAME_ORD_OBJ, COL_NAME_WAVE_ATMDISP, COL_NAME_WAVE_OBJ, COL_NAME_WAVE_REF, exptime, rec_profile, STAR_MATCH_DEPSILON, XSH_ASSURE_NOT_NULL_MSG, XSH_ATMOS_EXT_LIST_COLNAME_K, XSH_ATMOS_EXT_LIST_COLNAME_OLD, xsh_efficiency_add_high_abs_regions(), xsh_fill_high_abs_regions(), xsh_frame_product(), xsh_frame_sci_get_gain_airmass_exptime_naxis1_biny(), xsh_frame_sci_get_ra_dec_airmass(), xsh_free_image(), xsh_free_propertylist(), xsh_free_table(), xsh_free_vector(), xsh_instrument_arm_tostring(), xsh_instrument_mode_tostring(), xsh_msg, xsh_msg_dbg_medium, xsh_msg_error, xsh_msg_warning, xsh_parse_catalog_std_stars(), xsh_pfits_get_cdelt1(), xsh_pfits_get_crval1(), xsh_pfits_set_qc_eff_fclip(), xsh_pfits_set_qc_eff_nclip(), XSH_QC_EFF_MED_ORD, XSH_QC_EFF_PEAK_ORD, and xsh_utils_efficiency_internal().
Referenced by xsh_compute_efficiency(), and xsh_util_efficiency1d().
static void xsh_frame_sci_get_gain_airmass_exptime_naxis1_biny | ( | cpl_frame * | frm_sci, | |
xsh_instrument * | instrument, | |||
double * | gain, | |||
double * | airmass, | |||
double * | exptime, | |||
int * | naxis1, | |||
int * | biny | |||
) | [static] |
Definition at line 797 of file xsh_utils_efficiency.c.
References check, XSH_ARM_NIR, xsh_free_propertylist(), xsh_instrument_get_arm(), xsh_pfits_get_airm_mean(), xsh_pfits_get_biny(), xsh_pfits_get_conad(), xsh_pfits_get_dit(), xsh_pfits_get_naxis1(), and xsh_pfits_get_win1_dit1().
Referenced by xsh_efficiency_compute().
void xsh_frame_sci_get_ra_dec_airmass | ( | cpl_frame * | frm_sci, | |
double * | ra, | |||
double * | dec, | |||
double * | airmass | |||
) |
get RA, DEC, airmass (mean) of a frame
frm_sci | input frame | |
ra | right ascension | |
dec | declination | |
airmass | airmass (mean) |
Definition at line 773 of file xsh_utils_efficiency.c.
References check, xsh_free_propertylist(), xsh_pfits_get_airm_mean(), xsh_pfits_get_dec(), and xsh_pfits_get_ra().
Referenced by xsh_catalog_extract_spectrum_frame(), xsh_compute_response(), xsh_compute_response2(), xsh_compute_response_ord(), xsh_efficiency_compute(), and xsh_obs_std_correct().
cpl_error_code xsh_get_std_obs_values | ( | cpl_propertylist * | plist, | |
double * | exptime, | |||
double * | airmass, | |||
double * | dRA, | |||
double * | dDEC | |||
) | [static] |
get STD star observation exptime, airmass, RA, DEC
plist | (input) property list | |
exptime | (output) exposure time | |
airmass | (output) airmass (average of start and end) | |
dRA | (output) Right Ascension | |
dDEC | (output) Declination |
Definition at line 314 of file xsh_utils_efficiency.c.
References xsh_pfits_get_airm_mean(), xsh_pfits_get_dec(), xsh_pfits_get_exptime(), and xsh_pfits_get_ra().
Referenced by xsh_utils_efficiency().
void xsh_load_ref_table | ( | cpl_frameset * | frames, | |
double | dRA, | |||
double | dDEC, | |||
double | EPSILON, | |||
xsh_instrument * | instrument, | |||
cpl_table ** | pptable | |||
) |
load reference table
frames | input frames list | |
dRA | Right Ascension | |
dDEC | Declination | |
EPSILON | tolerance to find ref spectra on catalog on (ra,dec) | |
instrument | xsh instrument | |
pptable | pointer to new table |
Definition at line 108 of file xsh_utils_efficiency.c.
References check, star_index_get(), star_index_load(), xsh_find_frame_with_tag(), XSH_FLUX_STD_CAT, XSH_FLUX_STD_TAB, and xsh_msg.
Referenced by xsh_utils_efficiency().
cpl_error_code xsh_parse_catalog_std_stars | ( | cpl_frame * | cat, | |
double | dRA, | |||
double | dDEC, | |||
double | EPSILON, | |||
cpl_table ** | pptable, | |||
xsh_std_star_id * | std_star_id | |||
) |
parse referece std stars catalog
cat | input frame catalog | |
dRA | Right Ascension | |
dDEC | Declination | |
EPSILON | tolerance to find ref spectra on catalog on (ra,dec) | |
pptable | pointer to new table |
Definition at line 244 of file xsh_utils_efficiency.c.
References check, star_index_delete(), star_index_get(), star_index_load(), XSH_ASSURE_NOT_NULL_MSG, XSH_BD17, XSH_EG274, XSH_Feige110, XSH_GD153, XSH_GD71, XSH_LTT3218, XSH_LTT7987, and xsh_msg.
Referenced by xsh_catalog_extract_spectrum_frame(), xsh_compute_response(), xsh_compute_response2(), xsh_compute_response_ord(), and xsh_efficiency_compute().
cpl_error_code xsh_rv_ref_wave_init | ( | xsh_std_star_id | std_star_id, | |
XSH_ARM | arm, | |||
xsh_rv_ref_wave_param * | w | |||
) |
Definition at line 167 of file xsh_utils_efficiency.c.
References xsh_rv_ref_wave_param::ipol_hbox, xsh_rv_ref_wave_param::ipol_wmax_min, xsh_rv_ref_wave_param::ipol_wmin_max, xsh_rv_ref_wave_param::range_wmax, xsh_rv_ref_wave_param::range_wmin, xsh_rv_ref_wave_param::wguess, XSH_ARM_NIR, XSH_ARM_UNDEFINED, XSH_ARM_UVB, and XSH_ARM_VIS.
Referenced by xsh_compute_response2().
xsh_rv_ref_wave_param* xsh_rv_ref_wave_param_create | ( | void | ) |
Definition at line 212 of file xsh_utils_efficiency.c.
Referenced by xsh_compute_response2().
void xsh_rv_ref_wave_param_destroy | ( | xsh_rv_ref_wave_param * | p | ) |
Definition at line 224 of file xsh_utils_efficiency.c.
Referenced by xsh_compute_response2().
double xsh_utils_compute_airm | ( | cpl_frameset * | raws | ) |
Definition at line 1444 of file xsh_utils_efficiency.c.
References exptime, size, XSH_ASSURE_NOT_NULL_MSG, xsh_pfits_get_airm_mean(), and xsh_pfits_get_exptime().
double xsh_utils_compute_airm_eff | ( | cpl_frameset * | raws | ) |
Definition at line 1391 of file xsh_utils_efficiency.c.
References exptime, size, XSH_ASSURE_NOT_NULL_MSG, xsh_free_propertylist(), xsh_msg, xsh_pfits_get_airm_end(), xsh_pfits_get_airm_start(), xsh_pfits_get_exptime(), and xsh_utils_get_airm().
cpl_frame* xsh_utils_efficiency | ( | cpl_frameset * | frames, | |
double | dGain, | |||
double | dEpsilon, | |||
double | aimprim, | |||
xsh_instrument * | inst, | |||
const char * | col_name_atm_wave, | |||
const char * | col_name_atm_abs, | |||
const char * | col_name_ref_wave, | |||
const char * | col_name_ref_flux, | |||
const char * | col_name_ref_bin, | |||
const char * | col_name_obj_wave, | |||
const char * | col_name_obj_flux | |||
) |
Compute efficiency.
frames | input frameset | |
dGain | detector's gain value | |
dEpsilon | tolerance to find ref spectra on catalog on (ra,dec) | |
aimprim | airmass | |
inst | instrument (arm) setting | |
col_name_atm_wave | atmospheric extinction table wave column name | |
col_name_atm_abs | atmospheric extinction table absorption column name | |
col_name_ref_wave | reference flux std table wave column name | |
col_name_ref_flux | reference flux std table flux column name | |
col_name_ref_bin | reference flux std table sampling bin value | |
col_name_obj_wave | observed std table wave column name | |
col_name_obj_flux | observed std table flux column name |
Definition at line 377 of file xsh_utils_efficiency.c.
References check, exptime, FRM_EXTCOEFF_TAB, xsh_efficiency_add_high_abs_regions(), xsh_find_frame_with_tag(), xsh_frame_product(), xsh_free_propertylist(), xsh_free_table(), xsh_get_std_obs_values(), xsh_instrument_arm_tostring(), xsh_load_ref_table(), XSH_STD_FLUX_SLIT_STARE_ORDER1D, and xsh_utils_efficiency_internal().
cpl_table* xsh_utils_efficiency_internal | ( | cpl_table * | tbl_obj_spectrum, | |
cpl_table * | tbl_atmext, | |||
cpl_table * | tbl_ref, | |||
double | exptime, | |||
double | airmass, | |||
double | aimprim, | |||
double | gain, | |||
int | biny, | |||
double | src2ref_wave_sampling, | |||
const char * | col_name_atm_wave, | |||
const char * | col_name_atm_abs, | |||
const char * | col_name_ref_wave, | |||
const char * | col_name_ref_flux, | |||
const char * | col_name_ref_bin, | |||
const char * | col_name_obj_wave, | |||
const char * | col_name_obj_flux, | |||
int * | ntot, | |||
int * | nclip | |||
) |
Compute efficiency.
tbl_obj_spectrum | input object spectrum | |
tbl_atmext | input atmospheric extinction table | |
tbl_ref | input reference flux STD table | |
exptime | input exposure time | |
airmass | input observed frame airmass | |
aimprim | input airmass corrective factor | |
gain | input gain | |
biny | bin on Y (spatial) direction | |
src2ref_wave_sampling | input cnversion factor to pass from src 2 ref units | |
col_name_atm_wave | atmospheric extinction table wave column name | |
col_name_atm_abs | atmospheric extinction table absorption column name | |
col_name_ref_wave | reference flux std table wave column name | |
col_name_ref_flux | reference flux std table flux column name | |
col_name_ref_bin | reference flux std table bin value | |
col_name_obj_wave | observed std table wave column name | |
col_name_obj_flux | observed std table flux column name |
Definition at line 516 of file xsh_utils_efficiency.c.
References check, COL_NAME_COR, COL_NAME_EPHOT, COL_NAME_EXT, COL_NAME_ORD_OBJ, COL_NAME_REF, COL_NAME_SRC_COR, COL_NAME_SRC_EFF, irplib_isinf(), kappa, TEL_AREA, xsh_column_to_double(), xsh_create_column_double(), xsh_free_table(), xsh_msg_dbg_medium, and xsh_table_interpolate().
Referenced by xsh_efficiency_compute(), and xsh_utils_efficiency().
static double xsh_utils_get_airm | ( | cpl_propertylist * | plist | ) | [static] |
Definition at line 1292 of file xsh_utils_efficiency.c.
References xsh_msg, xsh_pfits_get_dec(), xsh_pfits_get_lst(), xsh_pfits_get_ra(), and xsh_pfits_get_telescop().
Referenced by xsh_utils_compute_airm_eff().
const char COL_NAME_ABS_ATMDISP[] = XSH_ATMOS_EXT_LIST_COLNAME_K [static] |
Definition at line 54 of file xsh_utils_efficiency.c.
Referenced by xsh_efficiency_compute().
const char COL_NAME_BINWIDTH_REF[] = "BIN_WIDTH" [static] |
Definition at line 65 of file xsh_utils_efficiency.c.
Referenced by xsh_catalog_extract_spectrum_frame(), and xsh_efficiency_compute().
const char COL_NAME_COR[] = "COR" [static] |
Definition at line 57 of file xsh_utils_efficiency.c.
Referenced by xsh_utils_efficiency_internal().
const char COL_NAME_EPHOT[] = "EPHOT" [static] |
Definition at line 66 of file xsh_utils_efficiency.c.
Referenced by xsh_utils_efficiency_internal().
const char COL_NAME_EXT[] = "EXT" [static] |
Definition at line 67 of file xsh_utils_efficiency.c.
Referenced by xsh_utils_efficiency_internal().
const char COL_NAME_FLUX_REF[] = "FLUX" [static] |
Definition at line 64 of file xsh_utils_efficiency.c.
Referenced by xsh_catalog_extract_spectrum_frame(), and xsh_efficiency_compute().
const char COL_NAME_HIGH_ABS[] = "HIGH_ABS" [static] |
Definition at line 50 of file xsh_utils_efficiency.c.
Referenced by xsh_efficiency_add_high_abs_regions().
const char COL_NAME_INT_OBJ[] = "INT_OBJ" [static] |
Definition at line 61 of file xsh_utils_efficiency.c.
Referenced by xsh_efficiency_compute().
const char COL_NAME_ORD_OBJ[] = "ORD" [static] |
Definition at line 62 of file xsh_utils_efficiency.c.
Referenced by xsh_efficiency_compute(), and xsh_utils_efficiency_internal().
const char COL_NAME_REF[] = "REF" [static] |
Definition at line 56 of file xsh_utils_efficiency.c.
Referenced by xsh_utils_efficiency_internal().
const char COL_NAME_SRC_COR[] = "SRC_COR" [static] |
Definition at line 58 of file xsh_utils_efficiency.c.
Referenced by xsh_utils_efficiency_internal().
const char COL_NAME_SRC_EFF[] = "EFF" [static] |
Definition at line 68 of file xsh_utils_efficiency.c.
Referenced by xsh_utils_efficiency_internal().
const char COL_NAME_WAVE_ATMDISP[] = "LAMBDA" [static] |
Definition at line 53 of file xsh_utils_efficiency.c.
Referenced by xsh_efficiency_compute().
const char COL_NAME_WAVE_OBJ[] = "WAVELENGTH" [static] |
Definition at line 60 of file xsh_utils_efficiency.c.
Referenced by xsh_efficiency_compute().
const char COL_NAME_WAVE_REF[] = "LAMBDA" [static] |
Definition at line 63 of file xsh_utils_efficiency.c.
Referenced by xsh_catalog_extract_spectrum_frame(), and xsh_efficiency_compute().
const char COL_NAME_WAVELENGTH[] = "WAVELENGTH" [static] |
Definition at line 51 of file xsh_utils_efficiency.c.
Referenced by xsh_efficiency_add_high_abs_regions().
const char COL_NAME_WAVELENGTH_C[] = "WAVELENGTH" [static] |
Definition at line 52 of file xsh_utils_efficiency.c.
char FRM_EXTCOEFF_TAB[] = XSH_EXTCOEFF_TAB [static] |
Definition at line 72 of file xsh_utils_efficiency.c.
Referenced by xsh_utils_efficiency().
const char PAR_NAME_DIT[] = "ESO DET DIT" [static] |
Definition at line 69 of file xsh_utils_efficiency.c.
const double UVES_flux_factor = 1.e16 [static] |
Definition at line 70 of file xsh_utils_efficiency.c.