FORS Pipeline Reference Manual  5.3.9
fors_flat_normalise.h
1 /* $Id: fors_flat_normalise.h,v 1.3 2013-09-09 12:14:12 cgarcia Exp $
2  *
3  * This file is part of the VIMOS Pipeline
4  * Copyright (C) 2002-2010 European Southern Observatory
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, write to the Free Software
18  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19  */
20 
21 /*
22  * $Author: cgarcia $
23  * $Date: 2013-09-09 12:14:12 $
24  * $Revision: 1.3 $
25  * $Name: not supported by cvs2svn $
26  */
27 
28 #ifndef FORS_FLAT_NORMALISE_H
29 #define FORS_FLAT_NORMALISE_H
30 
31 #include <cpl.h>
32 #include "mosca_image.h"
33 #include "fors_detected_slits.h"
34 #include "wavelength_calibration.h"
35 
36 namespace fors
37 {
38 
40 {
41 
42 public:
43 
45  ~flat_normaliser();
46 
47  int mos_normalise(mosca::image& flat,
48  const mosca::wavelength_calibration& wave_cal,
49  cpl_image *spatial,
50  cpl_table *slits, cpl_table *polytraces,
51  double blue, double red,
52  double dispersion,
53  int spa_smooth_radius, int disp_smooth_radius,
54  int spa_fit_polyorder, int disp_fit_nknots,
55  double fit_threshold);
56 
57  int lss_normalise(mosca::image& flat,
58  const mosca::wavelength_calibration& wave_cal,
59  int spa_smooth_radius, int disp_smooth_radius,
60  int spa_fit_polyorder, int disp_fit_nknots,
61  double fit_threshold);
62 
63  const mosca::image& get_normalisation_image() const;
64 
65  const std::vector<std::vector<float> >& get_wave_profiles() const;
66 
67  std::vector<float> get_wave_profiles_norm(double mflat_exptime,
68  const std::vector<float>& slit_widths,
69  const std::vector<float>& slit_lengths) const;
70 
71  cpl_image * get_wave_profiles_im() const;
72 
73  cpl_image * get_wave_profiles_im_mapped(const fors::detected_slits& det_slits,
74  const mosca::wavelength_calibration& wave_cal,
75  double firstLambda,
76  double lastLambda,
77  double dispersion) const;
78 
79  static int get_middle_slit_valid_calib
80  (const mosca::wavelength_calibration& wave_cal,
81  int slit_end_pos, int slit_begin_pos);
82 
83 private:
84 
85  mosca::image m_normalisation_image;
86 
87  std::vector<std::vector<float> > m_wave_profiles;
88 
89  std::vector<float> m_wave_profiles_norm;
90 
91 };
92 
93 }
94 
95 #endif /* FORS_FLAT_NORMALISE_H */