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_DATA_THE_MAP_H
00027 #define XSH_DATA_THE_MAP_H
00028
00029 #include <cpl.h>
00030
00031 #define XSH_THE_MAP_TABLE_NB_COL 6
00032 #define XSH_THE_MAP_TABLE_COLNAME_WAVELENGTH "Wavelength"
00033 #define XSH_THE_MAP_TABLE_UNIT_WAVELENGTH "nm"
00034 #define XSH_THE_MAP_TABLE_COLNAME_ORDER "Order"
00035 #define XSH_THE_MAP_TABLE_UNIT_ORDER "none"
00036 #define XSH_THE_MAP_TABLE_COLNAME_SLITPOSITION "slit_position"
00037 #define XSH_THE_MAP_TABLE_UNIT_SLITPOSITION "arcsec"
00038 #define XSH_THE_MAP_TABLE_COLNAME_SLITINDEX "slit_index"
00039 #define XSH_THE_MAP_TABLE_UNIT_SLITINDEX "none"
00040 #define XSH_THE_MAP_TABLE_COLNAME_DETECTORX "detector_x"
00041 #define XSH_THE_MAP_TABLE_UNIT_DETECTORX "pixel"
00042 #define XSH_THE_MAP_TABLE_COLNAME_DETECTORY "detector_y"
00043 #define XSH_THE_MAP_TABLE_UNIT_DETECTORY "pixel"
00044
00045 typedef struct{
00046
00047 float wavelength;
00048
00049 int order;
00050
00051 float slit_position;
00052
00053 int slit_index;
00054
00055 double detector_x;
00056
00057 double detector_y;
00058 }xsh_the_arcline;
00059
00060
00061 typedef struct{
00062 int size;
00063 xsh_the_arcline** list;
00064 cpl_propertylist * header ;
00065 } xsh_the_map;
00066
00067 xsh_the_map* xsh_the_map_create( int size);
00068 xsh_the_map* xsh_the_map_load(cpl_frame* frame);
00069 void xsh_the_arcline_free(xsh_the_arcline** arc);
00070 void xsh_the_map_free(xsh_the_map** list);
00071
00072 void xsh_the_map_set_arcline( xsh_the_map* list, int idx, float wavelength,
00073 int order, int slit_index, float slit_position, double detx, double dety);
00074
00075 int xsh_the_map_get_size(xsh_the_map* list);
00076 double xsh_the_map_get_detx(xsh_the_map* list, int idx);
00077 double xsh_the_map_get_dety(xsh_the_map* list, int idx);
00078 int xsh_the_map_get_slit_index( xsh_the_map* list, int idx);
00079 float xsh_the_map_get_wavelength(xsh_the_map* list, int idx);
00080 int xsh_the_map_get_order(xsh_the_map* list, int idx);
00081 float xsh_the_map_get_slit_position( xsh_the_map* list, int idx);
00082
00083 cpl_frame* xsh_the_map_save(xsh_the_map* list,const char* filename);
00084 void xsh_the_map_lambda_sort(xsh_the_map* list);
00085 void xsh_the_map_lambda_order_slit_sort(xsh_the_map* list);
00086 void xsh_dump_the_map( xsh_the_map* list ) ;
00087
00088 #endif