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_WAVEMAP_H
00026 #define XSH_DATA_WAVEMAP_H
00027
00028 #include <cpl.h>
00029 #include <xsh_data_instrument.h>
00030
00031 #define XSH_WAVEMAP_TABLE_NB_UVB_ORDERS 11
00032 #define XSH_WAVEMAP_TABLE_NB_VIS_ORDERS 14
00033 #define XSH_WAVEMAP_TABLE_NB_NIR_ORDERS 16
00034
00035 typedef struct {
00036 double lambda;
00037 double slit;
00038 float flux ;
00039 float sigma ;
00040 int ix;
00041 int iy;
00042 double fitted ;
00043 double fit_err ;
00044 } wavemap_item ;
00045
00046 typedef struct{
00047 int order ;
00048 int sky_size;
00049 int object_size;
00050 int max_size;
00051 double lambda_min, lambda_max ;
00052 wavemap_item *sky;
00053 wavemap_item *object;
00054 cpl_polynomial *pol_lambda;
00055 cpl_polynomial *pol_slit;
00056 cpl_polynomial *tcheb_pol_lambda;
00057 double xmin, xmax, ymin, ymax;
00058 } xsh_wavemap;
00059
00060 typedef struct{
00061 int size;
00062 int degx, degy ;
00063 xsh_wavemap * list;
00064 xsh_instrument * instrument;
00065 cpl_propertylist * header;
00066 } xsh_wavemap_list;
00067
00068 xsh_wavemap_list * xsh_wavemap_list_create(xsh_instrument* instr);
00069
00070 void xsh_wavemap_list_free(xsh_wavemap_list ** list);
00071
00072 void xsh_wavemap_list_dump( xsh_wavemap_list * list, const char * fname ) ;
00073
00074 void xsh_wavemap_list_set_max_size( xsh_wavemap_list * list, int idx,
00075 int ordnum, int ndata ) ;
00076
00077 void xsh_wavemap_list_compute( double * vlambda, double * xpos, double * ypos,
00078 int nitems, double * orders,
00079 xsh_dispersol_param * dispsol_param,
00080 xsh_wavemap_list * wmap ) ;
00081
00082 void xsh_wavemap_list_compute_poly( double * vlambda, double *vslit,
00083 double * xpos, double * ypos,
00084 int nitems, double * orders,
00085 xsh_dispersol_param * dispsol_param,
00086 xsh_wavemap_list * wmap );
00087
00088 cpl_frame * xsh_wavemap_list_save_poly( xsh_wavemap_list * wmap,
00089 cpl_frame * order_frame,
00090 xsh_pre * pre,
00091 xsh_instrument * instr, const char * fname,
00092 cpl_frame **dispersol_frame, cpl_frame **slitmap_frame);
00093
00094 cpl_frame * xsh_wavemap_list_save( xsh_wavemap_list * wmap,
00095 cpl_frame * order_frame,
00096 xsh_pre * pre,
00097 xsh_instrument * instr, const char * fname);
00098
00099 cpl_frame * xsh_wavemap_list_save2( xsh_wavemap_list * wmap,
00100 xsh_order_list * order_list,
00101 xsh_pre * pre,
00102 xsh_instrument * instr, const char * prefix);
00103 #endif