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