irplib_wavecal.h

00001 /* $Id: irplib_wavecal.h,v 1.18 2012/08/03 21:05:33 llundin Exp $
00002  *
00003  * This file is part of the IRPLIB Pipeline
00004  * Copyright (C) 2002,2003 European Southern Observatory
00005  *
00006  * This program is free software; you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation; either version 2 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * This program is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with this program; if not, write to the Free Software
00018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02111-1307  USA
00019  */
00020 
00021 /*
00022  * $Author: llundin $
00023  * $Date: 2012/08/03 21:05:33 $
00024  * $Revision: 1.18 $
00025  * $Name: naco-4_3_3 $
00026  */
00027 
00028 #ifndef IRPLIB_WAVECAL_H
00029 #define IRPLIB_WAVECAL_H
00030 
00031 /*-----------------------------------------------------------------------------
00032                                    Includes
00033  -----------------------------------------------------------------------------*/
00034 
00035 #include <cpl.h>
00036 
00037 
00038 /*-----------------------------------------------------------------------------
00039                                    Define
00040  -----------------------------------------------------------------------------*/
00041 
00042 #define IRPLIB_WAVECAL_MODEL_COEFFS       4
00043 /* The number of columns is 5 + IRPLIB_WAVECAL_MODEL_COEFFS */
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                                New Types
00062  -----------------------------------------------------------------------------*/
00063 
00064 /* Any spectrum model must have these members first! */
00065 typedef struct {
00066     cpl_size             cost;    /* May be incremented for cost counting */
00067     cpl_size             xcost;   /* Ditto (can exclude failed fills) */
00068     cpl_size             ulines;  /* May be set to number of lines used */
00069 
00070 } irplib_base_spectrum_model;
00071 
00072 typedef struct {
00073     cpl_size             cost;    /* May be incremented for cost counting */
00074     cpl_size             xcost;   /* Ditto (can exclude failed fills) */
00075     cpl_size             ulines;  /* May be set to number of lines used */
00076 
00077     double               wslit;  /* Slit Width */
00078     double               wfwhm;  /* FWHM of transfer function */
00079     double               xtrunc; /* Truncate transfer function beyond xtrunc,
00080                                     xtrunc > 0 */
00081     const cpl_bivector * lines;  /* Catalogue of intensities, with
00082                                     increasing X-vector elements */
00083     cpl_vector         * linepix;  /* Catalogue of line pixel positions
00084                                       - zero for uninitialized */
00085     cpl_vector         * erftmp;  /* Temporary storage for erf() values
00086                                       - zero for uninitialized */
00087 } irplib_line_spectrum_model;
00088 
00089 /*-----------------------------------------------------------------------------
00090                                    Function Prototypes
00091  -----------------------------------------------------------------------------*/
00092 
00093 cpl_error_code
00094 irplib_polynomial_find_1d_from_correlation_all(cpl_polynomial *,
00095                                                int,
00096                                                const cpl_vector *,
00097                                                int, int,
00098                                                irplib_base_spectrum_model *,
00099                                                cpl_error_code (*)
00100                                                (cpl_vector *,
00101                                                 const cpl_polynomial *,
00102                                                 irplib_base_spectrum_model *),
00103                                                double,
00104                                                double,
00105                                                int,
00106                                                int,
00107                                                int,
00108                                                int,
00109                                                cpl_boolean,
00110                                                double *);
00111 
00112 cpl_error_code
00113 irplib_bivector_find_shift_from_correlation(cpl_bivector *,
00114                                             const cpl_polynomial *,
00115                                             const cpl_vector *,
00116                                             irplib_base_spectrum_model *,
00117                                             cpl_error_code (*)
00118                                             (cpl_vector *,
00119                                              const cpl_polynomial *,
00120                                              irplib_base_spectrum_model *),
00121                                             int,
00122                                             cpl_boolean,
00123                                             double *);
00124 
00125 cpl_error_code
00126 irplib_polynomial_shift_1d_from_correlation(cpl_polynomial *,
00127                                             const cpl_vector *,
00128                                             irplib_base_spectrum_model *,
00129                                             cpl_error_code (*)
00130                                             (cpl_vector *,
00131                                              const cpl_polynomial *,
00132                                              irplib_base_spectrum_model *),
00133                                             int, cpl_boolean, double *);
00134 
00135 cpl_error_code
00136 irplib_polynomial_find_1d_from_correlation(cpl_polynomial *, int,
00137                                            const cpl_vector *,
00138                                            irplib_base_spectrum_model *,
00139                                            cpl_error_code (*)
00140                                            (cpl_vector *,
00141                                             const cpl_polynomial *,
00142                                             irplib_base_spectrum_model *),
00143                                            double, double,
00144                                            int, int, double *);
00145 
00146 cpl_error_code irplib_vector_fill_line_spectrum(cpl_vector *,
00147                                                 const cpl_polynomial *,
00148                                                 irplib_base_spectrum_model *);
00149 
00150 cpl_error_code irplib_vector_fill_logline_spectrum(cpl_vector *,
00151                                                    const cpl_polynomial *,
00152                                                    irplib_base_spectrum_model *);
00153 
00154 cpl_error_code
00155 irplib_vector_fill_line_spectrum_fast(cpl_vector *,
00156                                       const cpl_polynomial *,
00157                                       irplib_base_spectrum_model *);
00158 
00159 cpl_error_code
00160 irplib_vector_fill_logline_spectrum_fast(cpl_vector *,
00161                                          const cpl_polynomial *,
00162                                          irplib_base_spectrum_model *);
00163 
00164 cpl_error_code irplib_plot_spectrum_and_model(const cpl_vector *,
00165                                               const cpl_polynomial *,
00166                                               irplib_base_spectrum_model *,
00167                                               cpl_error_code (*)
00168                                               (cpl_vector *,
00169                                                const cpl_polynomial *,
00170                                                irplib_base_spectrum_model *));
00171 
00172 cpl_error_code irplib_polynomial_fit_2d_dispersion(cpl_polynomial *,
00173                                                    const cpl_image *,
00174                                                    int, double *);
00175 
00176 int irplib_bivector_count_positive(const cpl_bivector *, double, double);
00177 
00178 #endif

Generated on Tue Mar 12 15:19:53 2013 for NACO Pipeline Reference Manual by  doxygen 1.4.7