High-Level Data Reduction Library: hdrl_spectrum_resample.h Source File

High-Level Data Reduction Library 1.6.0 High-Level data reduction routines for ESO pipelines

Loading...
Searching...
No Matches
hdrl_spectrum_resample.h
Go to the documentation of this file.
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 */
51 typedef enum{
52 hdrl_spectrum1D_interp_linear,
53 hdrl_spectrum1D_interp_cspline,
54 hdrl_spectrum1D_interp_akima,
55}hdrl_spectrum1D_interpolation_method;
56
57
58 hdrl_parameter* hdrl_spectrum1D_resample_interpolate_parameter_create
59(const hdrl_spectrum1D_interpolation_method method);
60
61 hdrl_parameter* hdrl_spectrum1D_resample_integrate_parameter_create(void);
62
63 hdrl_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
68 hdrl_parameter*
69 hdrl_spectrum1D_resample_fit_parameter_create(const int k, const int nCoeff);
70
71#if defined HDRL_USE_EXPERIMENTAL || defined HDRL_USE_PRIVATE
72 hdrl_parameter*
73 hdrl_spectrum1D_resample_fit_windowed_parameter_create(
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
83 hdrl_spectrum1D *
84 hdrl_spectrum1D_resample(const hdrl_spectrum1D * self,
85 const hdrl_spectrum1D_wavelength* waves,
86 const hdrl_parameter* par);
87
88 hdrl_spectrum1D *
89 hdrl_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
95 void
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_spectrum.h
hdrl_spectrum1D_interpolation_method
hdrl_spectrum1D_interpolation_method
Definition hdrl_spectrum_resample.h:51
hdrl_spectrum1D_interp_akima
@ hdrl_spectrum1D_interp_akima
Definition hdrl_spectrum_resample.h:54
hdrl_spectrum1D_interp_cspline
@ hdrl_spectrum1D_interp_cspline
Definition hdrl_spectrum_resample.h:53
hdrl_spectrum1D_interp_linear
@ hdrl_spectrum1D_interp_linear
Definition hdrl_spectrum_resample.h:52
hdrl_parameter.h
hdrl_parameter
struct _hdrl_parameter_ hdrl_parameter
Definition hdrl_parameter.h:27
hdrl_spectrum1D_resample
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
Definition hdrl_spectrum_resample.c:429
hdrl_spectrum1D_resample_interpolate_parameter_create
hdrl_parameter * hdrl_spectrum1D_resample_interpolate_parameter_create(const hdrl_spectrum1D_interpolation_method method)
constructor for the hdrl_parameter in the case of interpolation
Definition hdrl_spectrum_resample.c:240
hdrl_spectrum1D_resample_fit_parameter_create
hdrl_parameter * hdrl_spectrum1D_resample_fit_parameter_create(const int k, const int nCoeff)
constructor for the hdrl_parameter in the case of interpolation
Definition hdrl_spectrum_resample.c:338
hdrl_spectrum1D_resample_filter_dups_and_substitute_with_median
cpl_size hdrl_spectrum1D_resample_filter_dups_and_substitute_with_median(double *x, double *y1, double *y2, cpl_size sample_len)
Definition hdrl_spectrum_resample.c:803
hdrl_spectrum1D_resample_on_array
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
Definition hdrl_spectrum_resample.c:484
hdrl_resample_parameter_verify
cpl_error_code hdrl_resample_parameter_verify(const hdrl_parameter *)
Definition hdrl_spectrum_resample.c:383
hdrl_spectrum1D_resample_fit_windowed_parameter_create
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
Definition hdrl_spectrum_resample.c:366
hdrl_spectrum1D_resample_interpolate_parameter_create_parlist
cpl_parameterlist * hdrl_spectrum1D_resample_interpolate_parameter_create_parlist(const char *, const char *, const char *)
Definition hdrl_spectrum_resample.c:303
hdrl_spectrum1D_resample_interpolate_parameter_parse_parlist
hdrl_parameter * hdrl_spectrum1D_resample_interpolate_parameter_parse_parlist(const cpl_parameterlist *, const char *)
Definition hdrl_spectrum_resample.c:263
hdrl_spectrum1D_resample_integrate_parameter_create
hdrl_parameter * hdrl_spectrum1D_resample_integrate_parameter_create(void)
constructor for the hdrl_parameter in the case of integration
Definition hdrl_spectrum_resample.c:255
hdrl_spectrum1D_wavelength
Definition hdrl_spectrum.h:93
hdrl_spectrum1D
Definition hdrl_spectrum_defs.h:44