File: hdrl_response.h

package info (click to toggle)
cpl-plugin-amber 4.4.3%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 9,340 kB
  • sloc: ansic: 89,588; sh: 4,337; makefile: 620; python: 295
file content (137 lines) | stat: -rw-r--r-- 4,911 bytes parent folder | download | duplicates (12)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
/* $Id: hdrl_spectrum_response.h,v 0.1 2017-04-25 09:02:08 msalmist Exp $
 *
 * This file is part of the HDRL
 * Copyright (C) 2017 European Southern Observatory
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 */

/*
 * $Author: msalmist $
 * $Date: 2017-04-25 09:02:08 $
 * $Revision: 0.1 $
 * $Name: not supported by cvs2svn $
 */

#ifndef HDRL_RESPONSE_H_
#define HDRL_RESPONSE_H_

/*-----------------------------------------------------------------------------
                                   Includes
 -----------------------------------------------------------------------------*/

#include <cpl.h>
#include "hdrl_spectrum.h"
#include "hdrl_spectrumlist.h"
#include "hdrl_spectrum_shift.h"

CPL_BEGIN_DECLS

/*-----------------------------------------------------------------------------
                            		Functions
 -----------------------------------------------------------------------------*/
hdrl_parameter *
hdrl_response_telluric_evaluation_parameter_create(
									const hdrl_spectrum1Dlist * telluric_models,
									hdrl_data_t w_step,
									cpl_size half_win,
									cpl_boolean normalize,
									cpl_boolean shift_in_log_scale,
									const cpl_bivector * quality_areas,
									const cpl_bivector * fit_areas,
									hdrl_data_t lmin,
									hdrl_data_t lmax);

hdrl_parameter *
hdrl_response_fit_parameter_create(
		const cpl_size radius, const cpl_array * fit_points,
		const hdrl_data_t wrange, const cpl_bivector * high_abs_regions);

typedef struct{

	hdrl_spectrum1D * final_response;
	hdrl_spectrum1D * selected_response;
	hdrl_spectrum1D * raw_response;

	hdrl_spectrum1D * corrected_observed_spectrum;
	cpl_size best_telluric_model_idx;
    hdrl_data_t telluric_shift;
	hdrl_data_t avg_diff_from_1;
	hdrl_data_t stddev;

	hdrl_data_t doppler_shift;

}hdrl_response_result;

const hdrl_spectrum1D *
hdrl_response_result_get_final_response(const hdrl_response_result * res);
const hdrl_spectrum1D *
hdrl_response_result_get_selected_response(const hdrl_response_result * res);
const hdrl_spectrum1D *
hdrl_response_result_get_raw_response(const hdrl_response_result * res);
const hdrl_spectrum1D *
hdrl_response_result_get_corrected_obs_spectrum(const hdrl_response_result * res);
cpl_size
hdrl_response_result_get_best_telluric_model_idx(const hdrl_response_result * res);
hdrl_data_t
hdrl_response_result_get_avg_diff_from_1(const hdrl_response_result * res);
hdrl_data_t
hdrl_response_result_get_stddev(const hdrl_response_result * res);
hdrl_data_t
hdrl_response_result_get_telluric_shift(const hdrl_response_result * res);
hdrl_data_t
hdrl_response_result_get_doppler_shift(const hdrl_response_result * res);

void
hdrl_response_result_delete(hdrl_response_result *);

hdrl_response_result *
hdrl_response_compute(
        const hdrl_spectrum1D * obs_s,
		const hdrl_spectrum1D * ref_s,
		const hdrl_spectrum1D * E_x,
		const hdrl_parameter * telluric_par,
		const hdrl_parameter * velocity_par,
		const hdrl_parameter * calc_par,
		const hdrl_parameter * fit_par);


#if defined HDRL_USE_PRIVATE

hdrl_spectrum1D *
hdrl_response_evaluate_telluric_models(
								 const hdrl_spectrum1D * obs_s,
								 const hdrl_parameter * ev,
                                 hdrl_data_t * telluric_shift,
								 hdrl_data_t * mean_minus_1, hdrl_data_t * stddev,
								 cpl_size * best_model_index);

hdrl_spectrum1D *
hdrl_response_evaluate_telluric_model(const hdrl_spectrum1D * obs_s_arg,
                                        const hdrl_spectrum1D * telluric_s_arg,
                                        const hdrl_data_t w_step,
                                        const cpl_size half_win,
                                        const cpl_boolean normalize,
                                        const cpl_boolean shift_in_log_scale,
                                        const cpl_bivector * quality_areas,
                                        const cpl_bivector * fit_areas,
                                        const hdrl_data_t lmin, const hdrl_data_t lmax,
                                        double * mean_minus_1, double * stddev,
                                        double * telluric_shift);
#endif

CPL_END_DECLS

#endif /* HDRL_RESPONSE_H_ */