CR2RE Pipeline Reference Manual 1.6.8
hdrl_spectrum_resample.h
1/* $Id: hdrl_spectrum_resample.h,v 0.1 2017-03-14 16:49:00 msalmist Exp $
2 *
3 * This file is part of the HDRL
4 * Copyright (C) 2017 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: msalmist $
23 * $Date: 2017-03-14 16:49:00 $
24 * $Revision: 0.1 $
25 * $Name: not supported by cvs2svn $
26 */
27
28#ifndef HDRL_SPECTRUM_RESAMPLE_H
29#define HDRL_SPECTRUM_RESAMPLE_H
30
31/*-----------------------------------------------------------------------------
32 New types
33 -----------------------------------------------------------------------------*/
34
35
36/*-----------------------------------------------------------------------------
37 Includes
38 -----------------------------------------------------------------------------*/
39
40#include "hdrl_spectrum.h"
41#include "hdrl_parameter.h"
42
43#include <cpl.h>
44
45CPL_BEGIN_DECLS
46
47/*-----------------------------------------------------------------------------
48 Data structures
49 -----------------------------------------------------------------------------*/
50/* Possible methods for interpolation possible */
51typedef enum{
52 hdrl_spectrum1D_interp_linear,
53 hdrl_spectrum1D_interp_cspline,
54 hdrl_spectrum1D_interp_akima,
55}hdrl_spectrum1D_interpolation_method;
56
57
59(const hdrl_spectrum1D_interpolation_method method);
60
62
63hdrl_parameter * hdrl_spectrum1D_resample_interpolate_parameter_parse_parlist(
64 const cpl_parameterlist *, const char *);
65cpl_parameterlist * hdrl_spectrum1D_resample_interpolate_parameter_create_parlist(
66 const char *, const char *, const char *) ;
67
68hdrl_parameter*
69hdrl_spectrum1D_resample_fit_parameter_create(const int k, const int nCoeff);
70
71#if defined HDRL_USE_EXPERIMENTAL || defined HDRL_USE_PRIVATE
72hdrl_parameter*
74 const int k, const int nCoeff, const long window, const double factor);
75#endif
76
77cpl_error_code hdrl_resample_parameter_verify(const hdrl_parameter *);
78
79/*-----------------------------------------------------------------------------
80 Functions
81 -----------------------------------------------------------------------------*/
82
83hdrl_spectrum1D *
84hdrl_spectrum1D_resample(const hdrl_spectrum1D * self,
85 const hdrl_spectrum1D_wavelength* waves,
86 const hdrl_parameter* par);
87
88hdrl_spectrum1D *
89hdrl_spectrum1D_resample_on_array(const hdrl_spectrum1D * self,
90 const cpl_array* waves,
91 const hdrl_parameter* par);
92
93#if defined HDRL_USE_EXPERIMENTAL || defined HDRL_USE_PRIVATE
94
95void
96hdrl_spectrum1D_resample_sort_on_x(double * x, double * y1, double * y2, cpl_size sample_len);
97
98cpl_size hdrl_spectrum1D_resample_filter_dups_and_substitute_with_median(double * x, double * y1,
99 double * y2, const cpl_size sample_len);
100
101
102cpl_boolean hdrl_spectrum1D_resample_is_strictly_monotonic_increasing(double * x, cpl_size l);
103
104#endif
105
106CPL_END_DECLS
107
108#endif
hdrl_spectrum1D * hdrl_spectrum1D_resample(const hdrl_spectrum1D *self, const hdrl_spectrum1D_wavelength *waves, const hdrl_parameter *par)
resample a hdrl_spectrum1D on the wavelengths contained in waves
hdrl_parameter * hdrl_spectrum1D_resample_interpolate_parameter_create(const hdrl_spectrum1D_interpolation_method method)
constructor for the hdrl_parameter in the case of interpolation
hdrl_parameter * hdrl_spectrum1D_resample_fit_parameter_create(const int k, const int nCoeff)
constructor for the hdrl_parameter in the case of interpolation
hdrl_spectrum1D * hdrl_spectrum1D_resample_on_array(const hdrl_spectrum1D *self, const cpl_array *waves, const hdrl_parameter *par)
resample a hdrl_spectrum1D on the wavelengths contained in waves
hdrl_parameter * hdrl_spectrum1D_resample_fit_windowed_parameter_create(const int k, const int nCoeff, const long window, const double factor)
constructor for the hdrl_parameter in the case of interpolation
hdrl_parameter * hdrl_spectrum1D_resample_integrate_parameter_create(void)
constructor for the hdrl_parameter in the case of integration