girebinning.h
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
00028 #ifndef GIREBINNING_H
00029 #define GIREBINNING_H
00030
00031 #include <cxtypes.h>
00032
00033 #include <cpl_macros.h>
00034 #include <cpl_matrix.h>
00035 #include <cpl_parameterlist.h>
00036
00037 #include <giimage.h>
00038 #include <girange.h>
00039 #include <gilocalization.h>
00040 #include <giextraction.h>
00041
00042
00043 #ifdef __cplusplus
00044 extern "C" {
00045 #endif
00046
00047
00048 #define O_NX 0
00049 #define O_PXSIZ 1
00050 #define O_FCOLL 2
00051 #define O_CFACT 3
00052 #define O_SOFFX 4
00053 #define O_SOFFY 5
00054 #define O_SPHI 6
00055 #define O_OPT_NPRMS 7
00056
00057 #define G_THETA 0
00058 #define G_ORDER 1
00059 #define G_WLMIN 2
00060 #define G_WLEN0 3
00061 #define G_WLMAX 4
00062 #define G_RESOL 5
00063 #define G_SPACE 6
00064 #define G_GRAT_NPRMS 7
00065
00066
00067
00068 #define OG_NX 0
00069 #define OG_PXSIZ 1
00070 #define OG_FCOLL 2
00071 #define OG_CFACT 3
00072 #define OG_THETA 4
00073 #define OG_ORDER 5
00074 #define OG_SPACE 6
00075 #define OG_SOFFX 7
00076 #define OG_SOFFY 8
00077 #define OG_SPHI 9
00078 #define OG_OPTM_NPRMS 10
00079
00080 #define GIREBIN_SIZE_Y_DEFAULT 5600
00081
00082 enum GiRebinMethod {
00083 GIREBIN_METHOD_UNDEFINED,
00084 GIREBIN_METHOD_LINEAR,
00085 GIREBIN_METHOD_SPLINE
00086 };
00087
00088 typedef enum GiRebinMethod GiRebinMethod;
00089
00090 enum GiRebinScale {
00091 GIREBIN_SCALE_UNDEFINED,
00092 GIREBIN_SCALE_LOG,
00093 GIREBIN_SCALE_LINEAR
00094 };
00095
00096 typedef enum GiRebinScale GiRebinScale;
00097
00098 enum GiRebinRange {
00099 GIREBIN_RANGE_UNDEFINED,
00100 GIREBIN_RANGE_SETUP,
00101 GIREBIN_RANGE_COMMON
00102 };
00103
00104 typedef enum GiRebinRange GiRebinRange;
00105
00106 struct GiRebinConfig {
00107 GiRebinMethod rmethod;
00108 cxbool xresiduals;
00109 cxdouble lstep;
00110 GiRebinScale scmethod;
00111 cxint size;
00112 GiRebinRange range;
00113 };
00114
00115 typedef struct GiRebinConfig GiRebinConfig;
00116
00117 struct GiRebinning {
00118 GiImage *spectra;
00119 GiImage *errors;
00120 };
00121
00122 typedef struct GiRebinning GiRebinning;
00123
00124 struct GiRebinParams {
00125 cxdouble min;
00126 cxdouble step;
00127 cxint log;
00128 cxint xres;
00129 cxint size;
00130 };
00131
00132 typedef struct GiRebinParams GiRebinParams;
00133
00134
00135 GiRange *giraffe_rebin_get_wavelength_range(GiImage *spectra,
00136 GiTable *wlsolution,
00137 GiTable *grating,
00138 GiTable *slitgeometry,
00139 cxbool common);
00140
00141 cxint giraffe_rebin_spectra(GiRebinning *rebinning,
00142 const GiExtraction *extraction,
00143 const GiTable *fibers,
00144 const GiLocalization *localization,
00145 const GiTable *grating,
00146 const GiTable *slitgeo,
00147 const GiTable *solution,
00148 const GiRebinConfig *config);
00149
00150
00151
00152
00153
00154
00155 GiRebinning *giraffe_rebinning_new(void);
00156 GiRebinning *giraffe_rebinning_create(GiImage *spectra, GiImage *errors);
00157 void giraffe_rebinning_delete(GiRebinning *rebinning);
00158 void giraffe_rebinning_destroy(GiRebinning *rebinning);
00159
00160 GiRebinConfig *giraffe_rebin_config_create(cpl_parameterlist *list);
00161 void giraffe_rebin_config_destroy(GiRebinConfig *config);
00162
00163 void giraffe_rebin_config_add(cpl_parameterlist *list);
00164
00165
00166 #ifdef __cplusplus
00167 }
00168 #endif
00169
00170 #endif