irplib_wavecal.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 IRPLIB_WAVECAL_H
00029 #define IRPLIB_WAVECAL_H
00030
00031
00032
00033
00034
00035 #include <cpl.h>
00036
00037
00038
00039
00040
00041
00042 #define IRPLIB_WAVECAL_MODEL_COEFFS 4
00043
00044 #define IRPLIB_WAVECAL_MODEL_COLS 9
00045
00046 #define IRPLIB_WAVECAL_LAB_MODE "SpecMode"
00047 #define IRPLIB_WAVECAL_LAB_RESID "Residual"
00048 #define IRPLIB_WAVECAL_LAB_ORDER "Fit_Order"
00049 #define IRPLIB_WAVECAL_LAB_XMIN "XMin"
00050 #define IRPLIB_WAVECAL_LAB_XMAX "XMax"
00051 #define IRPLIB_WAVECAL_LAB_C1 "C_1"
00052 #define IRPLIB_WAVECAL_LAB_C2 "C_2"
00053 #define IRPLIB_WAVECAL_LAB_C3 "C_3"
00054 #define IRPLIB_WAVECAL_LAB_C4 "C_4"
00055
00056 #define IRPLIB_WAVECAL_LAB_WAVE "WAVELENGTH"
00057 #define IRPLIB_WAVECAL_LAB_INTENS "INTENSITY"
00058
00059
00060
00061
00062
00063
00064 typedef struct {
00065 double wslit;
00066 double wfwhm;
00067 double xtrunc;
00068
00069 const cpl_bivector * lines;
00070
00071 cpl_vector * linepix;
00072
00073 unsigned cost;
00074 } irplib_line_spectrum_model;
00075
00076
00077
00078
00079
00080 cpl_error_code
00081 irplib_polynomial_shift_1d_from_correlation(cpl_polynomial *,
00082 const cpl_vector *,
00083 void *,
00084 cpl_error_code (*)
00085 (cpl_vector *,
00086 const cpl_polynomial *,
00087 void *, int),
00088 int, cpl_boolean);
00089
00090 cpl_error_code
00091 irplib_polynomial_find_1d_from_correlation(cpl_polynomial *, int,
00092 const cpl_vector *,
00093 void *,
00094 cpl_error_code (*)
00095 (cpl_vector *,
00096 const cpl_polynomial *,
00097 void *, int),
00098 double, double,
00099 int, int, double *);
00100
00101 cpl_error_code irplib_vector_fill_line_spectrum(cpl_vector *,
00102 const cpl_polynomial *,
00103 void *,
00104 int);
00105
00106 cpl_error_code irplib_plot_spectrum_and_model(const cpl_vector *,
00107 const cpl_polynomial *,
00108 void *,
00109 cpl_error_code (*)
00110 (cpl_vector *,
00111 const cpl_polynomial *,
00112 void *, int));
00113
00114 cpl_error_code irplib_polynomial_fit_2d_dispersion(cpl_polynomial *,
00115 const cpl_image *,
00116 int, double *);
00117 #endif