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 #ifndef XSH_DATA_REC_H
00026 #define XSH_DATA_REC_H
00027
00028 #include <cpl.h>
00029 #include <xsh_data_instrument.h>
00030 #include <xsh_data_pre.h>
00031 #include <xsh_data_spectralformat.h>
00032 #include <xsh_parameters.h>
00033
00034 #define XSH_REC_TABLE_NB_UVB_ORDERS 11
00035 #define XSH_REC_TABLE_NB_VIS_ORDERS 14
00036 #define XSH_REC_TABLE_NB_NIR_ORDERS 16
00037
00038
00039 #define XSH_REC_TABLE_COLNAME_ORDER "ORDER"
00040 #define XSH_REC_TABLE_COLNAME_NLAMBDA "NLAMBDA"
00041 #define XSH_REC_TABLE_COLNAME_NSLIT "NSLIT"
00042
00043
00044
00045
00046 #define XSH_REC_TABLE_COLNAME_LAMBDA "LAMBDA"
00047 #define XSH_REC_TABLE_COLNAME_SLIT "SLIT"
00048
00049
00050
00051
00052 #define XSH_REC_TABLE_COLNAME_FLUX1 "FLUX1"
00053 #define XSH_REC_TABLE_COLNAME_FLUX2 "FLUX2"
00054 #define XSH_REC_TABLE_COLNAME_FLUX3 "FLUX3"
00055 #define XSH_REC_TABLE_COLNAME_ERRS1 "ERRS1"
00056 #define XSH_REC_TABLE_COLNAME_ERRS2 "ERRS2"
00057 #define XSH_REC_TABLE_COLNAME_ERRS3 "ERRS3"
00058 #define XSH_REC_TABLE_COLNAME_QUAL1 "QUAL1"
00059 #define XSH_REC_TABLE_COLNAME_QUAL2 "QUAL2"
00060 #define XSH_REC_TABLE_COLNAME_QUAL3 "QUAL3"
00061
00062 typedef struct{
00063 int order ;
00064 int nlambda;
00065 int nslit ;
00066 float * slit ;
00067 double * lambda ;
00068 float * data1 ;
00069 float * data2 ;
00070 float * data3 ;
00071 float * errs1 ;
00072
00073 float * errs2 ;
00074 float * errs3 ;
00075 int * qual1 ;
00076 int * qual2 ;
00077 int * qual3 ;
00078 } xsh_rec ;
00079
00080 typedef struct{
00081 int size;
00082 double slit_min;
00083 double slit_max;
00084 int nslit;
00085
00086
00087 xsh_rec * list;
00088 xsh_instrument * instrument;
00089 cpl_propertylist * header;
00090 } xsh_rec_list;
00091
00092
00093
00094 xsh_rec_list * xsh_rec_list_create( xsh_instrument* instr);
00095
00096 xsh_rec_list* xsh_rec_list_create_with_size( int size, xsh_instrument *instr);
00097
00098 xsh_rec_list * xsh_rec_list_load( cpl_frame *frame, xsh_instrument *instr);
00099 xsh_rec_list * xsh_rec_list_load_eso( cpl_frame *frame, xsh_instrument *instr);
00100
00101
00102
00103 cpl_frame* xsh_rec_list_save( xsh_rec_list * list, const char* filename,
00104 const char* tag,int is_temp);
00105
00106 cpl_frame* xsh_rec_list_save_table(xsh_rec_list* list, const char* filename,
00107 const char* tag, int is_temp );
00108
00109 cpl_frame* xsh_rec_list_save2(xsh_rec_list* list, const char* filename,
00110 const char* tag);
00111
00112
00113
00114 void xsh_rec_list_free( xsh_rec_list ** list);
00115
00116 xsh_rec_list * xsh_rec_list_duplicate( xsh_rec_list * old,
00117 xsh_instrument * instrument ) ;
00118 cpl_frame * xsh_rec_list_frame_invert( cpl_frame * rec_frame,
00119 const char * tag,
00120 xsh_instrument * instrument ) ;
00121
00122 void xsh_rec_list_dump( xsh_rec_list * list, const char * fname) ;
00123
00124 void xsh_rec_list_set_data_size( xsh_rec_list * list, int idx, int ordnum,
00125 int nlambda, int ns);
00126
00127 void xsh_rec_list_update_header( xsh_rec_list *list, xsh_pre *pre,
00128 xsh_rectify_param *rec_par,
00129 const char* pro_catg);
00130
00131
00132
00133 cpl_propertylist * xsh_rec_list_get_header( xsh_rec_list * list);
00134
00135 float* xsh_rec_list_get_slit( xsh_rec_list * list, int idx);
00136
00137 double* xsh_rec_list_get_lambda( xsh_rec_list * list, int idx);
00138
00139 float* xsh_rec_list_get_data1( xsh_rec_list * list, int idx);
00140
00141 float * xsh_rec_list_get_errs1( xsh_rec_list * list, int idx);
00142
00143 int * xsh_rec_list_get_qual1( xsh_rec_list * list, int idx);
00144
00145 int xsh_rec_list_get_order( xsh_rec_list * list, int idx);
00146
00147 int xsh_rec_list_get_nslit( xsh_rec_list * list, int idx);
00148
00149 int xsh_rec_list_get_nlambda( xsh_rec_list * list, int idx);
00150
00151 void xsh_rec_get_nod_kw( cpl_frame * rec_frame, double * throw,
00152 double * jitter, double * reloffset,
00153 double * cumoffset ) ;
00154
00155 double xsh_rec_list_get_slit_min( xsh_rec_list* list);
00156 double xsh_rec_list_get_slit_max( xsh_rec_list* list);
00157
00158 double xsh_rec_list_get_lambda_min( xsh_rec_list* list);
00159 double xsh_rec_list_get_lambda_max( xsh_rec_list* list);
00160
00161
00162 cpl_error_code xsh_rec_list_set_slit_min( xsh_rec_list* list,const double val);
00163 cpl_error_code xsh_rec_list_set_slit_max( xsh_rec_list* list,const double val);
00164
00165 #endif