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_SPECTRUM_H
00027 #define XSH_DATA_SPECTRUM_H
00028
00029 #include <cpl.h>
00030 #include <xsh_data_instrument.h>
00031
00032 #define XSH_SPECTRUM_DATA_TYPE CPL_TYPE_FLOAT
00033 #define XSH_SPECTRUM_DATA_BPP CPL_BPP_IEEE_FLOAT
00034 #define XSH_SPECTRUM_ERRS_TYPE CPL_TYPE_FLOAT
00035 #define XSH_SPECTRUM_ERRS_BPP CPL_BPP_IEEE_FLOAT
00036 #define XSH_SPECTRUM_QUAL_TYPE CPL_TYPE_INT
00037 #define XSH_SPECTRUM_QUAL_BPP CPL_BPP_32_SIGNED
00038
00039 typedef struct{
00040
00041 int size;
00042
00043 double lambda_min;
00044
00045 double lambda_max;
00046
00047 double lambda_step;
00048
00049 double slit_min;
00050
00051 double slit_max;
00052
00053 double slit_step;
00054
00055 int size_lambda;
00056
00057 int size_slit;
00058
00059 cpl_propertylist* flux_header;
00060 cpl_image *flux;
00061
00062 cpl_propertylist* errs_header;
00063 cpl_image *errs;
00064
00065 cpl_propertylist* qual_header;
00066 cpl_image *qual;
00067 }xsh_spectrum;
00068
00069 xsh_spectrum* xsh_spectrum_1D_create( double lambda_min, double lambda_max,
00070 double lambda_step);
00071 xsh_spectrum* xsh_spectrum_2D_create( double lambda_min, double lambda_max,
00072 double lambda_step, double slit_min, double slit_max, double slit_step);
00073
00074 xsh_spectrum* xsh_spectrum_load( cpl_frame* s1d_frame,
00075 xsh_instrument* instr);
00076 xsh_spectrum* xsh_spectrum_load_order( cpl_frame* s1d_frame,
00077 xsh_instrument* instr,
00078 const int order);
00079
00080 int xsh_spectrum_get_size( xsh_spectrum* s);
00081 int xsh_spectrum_get_size_lambda( xsh_spectrum* s);
00082 int xsh_spectrum_get_size_slit( xsh_spectrum* s);
00083 double xsh_spectrum_get_lambda_min( xsh_spectrum* s);
00084 double xsh_spectrum_get_lambda_max( xsh_spectrum* s);
00085 double xsh_spectrum_get_lambda_step( xsh_spectrum* s);
00086 double* xsh_spectrum_get_flux( xsh_spectrum* s);
00087 double* xsh_spectrum_get_errs( xsh_spectrum* s);
00088 int* xsh_spectrum_get_qual( xsh_spectrum* s);
00089 cpl_frame* xsh_spectrum_save( xsh_spectrum* s, const char* filename,
00090 const char* tag);
00091 cpl_frame* xsh_spectrum_save_order( xsh_spectrum* s, const char* filename,
00092 const char* tag,const int order);
00093
00094 void xsh_spectrum_free( xsh_spectrum** list);
00095
00096 cpl_frame * xsh_phys_spectrum_save( xsh_spectrum* s, const char* filename,
00097 xsh_instrument* instr) ;
00098 xsh_spectrum * xsh_spectrum_duplicate( xsh_spectrum * org ) ;
00099
00100 #endif