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
00027 #ifdef HAVE_CONFIG_H
00028 #include <config.h>
00029 #endif
00030 #include <xsh_efficiency_response.h>
00031 #include <xsh_error.h>
00032
00033 HIGH_ABS_REGION NirHighAbsRegions[] = {
00034 {1060.0, 1232.9},
00035 {1247.4, 1500.0},
00036 {1549.0, 1588.5},
00037 {1595.0, 1625.0},
00038 {1630.0, 1983.5},
00039 {1984.2, 1988.1},
00040 {1988.9, 1991.1},
00041 {1991.7, 2138.0},
00042 {2145.0, 2191.0},
00043 {2218.0, 2271.0},
00044 {2351.0, 2431.0},
00045 {0., 0.}
00046 } ;
00047
00048 HIGH_ABS_REGION VisHighAbsRegions[] = {
00049 {585.0, 604.0},
00050 {684.5, 746.0},
00051 {755.5, 775.5},
00052 {783.7, 856.0},
00053 {887.5, 993.4},
00054 {0., 0.}
00055 } ;
00056
00057
00058
00059 HIGH_ABS_REGION *
00060 xsh_fill_high_abs_regions(
00061 xsh_instrument* instrument,
00062 cpl_frame* high_abs_frame)
00063 {
00064 HIGH_ABS_REGION * phigh=NULL;
00065 int nrow=0;
00066 double* pwmin=0;
00067 double* pwmax=0;
00068 int i=0;
00069 cpl_table* high_abs_tab=NULL;
00070 XSH_ARM the_arm;
00071
00072 if(high_abs_frame !=NULL) {
00073 high_abs_tab=cpl_table_load(cpl_frame_get_filename(high_abs_frame),1,0);
00074 }
00075 the_arm=xsh_instrument_get_arm(instrument);
00076
00077
00078
00079 if(high_abs_tab!=NULL) {
00080 nrow=cpl_table_get_nrow(high_abs_tab);
00081 check(pwmin=cpl_table_get_data_double(high_abs_tab,"LAMBDA_MIN"));
00082 check(pwmax=cpl_table_get_data_double(high_abs_tab,"LAMBDA_MAX"));
00083
00084 phigh = (HIGH_ABS_REGION *) cpl_calloc(nrow + 1, sizeof(HIGH_ABS_REGION));
00085 for(i=0;i<nrow;i++) {
00086 phigh[i].lambda_min=pwmin[i];
00087 phigh[i].lambda_max=pwmax[i];
00088 }
00089 phigh[nrow].lambda_min=0;
00090 phigh[nrow].lambda_max=0;
00091
00092 } else {
00093
00094
00095
00096
00097 if ( the_arm == XSH_ARM_VIS ) {
00098
00099 phigh = VisHighAbsRegions ;
00100 }
00101 else if ( the_arm == XSH_ARM_NIR ) {
00102
00103 phigh = NirHighAbsRegions ;
00104 }
00105
00106 }
00107 cleanup:
00108 xsh_free_table(&high_abs_tab);
00109 return phigh;
00110 }