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

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

Loading...
Searching...
No Matches
hdrl_collapse.h
Go to the documentation of this file.
1/* $Id: hdrl_collapse.h,v 1.11 2013-10-17 15:44:14 jtaylor Exp $
2 *
3 * This file is part of the HDRL
4 * Copyright (C) 2013 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: jtaylor $
23 * $Date: 2013-10-17 15:44:14 $
24 * $Revision: 1.11 $
25 * $Name: not supported by cvs2svn $
26 */
27
28#ifndef HDRL_COLLAPSE_H
29#define HDRL_COLLAPSE_H
30
31/*-----------------------------------------------------------------------------
32 Includes
33 -----------------------------------------------------------------------------*/
34
35#include "hdrl_parameter.h"
36#include "hdrl_mode.h"
37
38#include <cpl.h>
39
40CPL_BEGIN_DECLS
41
42/*-----------------------------------------------------------------------------
43 Define
44 -----------------------------------------------------------------------------*/
45
46/*-----------------------------------------------------------------------------
47 Functions prototypes
48 -----------------------------------------------------------------------------*/
49
50 hdrl_parameter * hdrl_collapse_mean_parameter_create(void);
51cpl_boolean hdrl_collapse_parameter_is_mean(const hdrl_parameter *);
52 extern hdrl_parameter * HDRL_COLLAPSE_MEAN;
53 hdrl_parameter * hdrl_collapse_median_parameter_create(void);
54cpl_boolean hdrl_collapse_parameter_is_median(const hdrl_parameter *);
55 extern hdrl_parameter * HDRL_COLLAPSE_MEDIAN;
56 hdrl_parameter * hdrl_collapse_weighted_mean_parameter_create(void);
57cpl_boolean hdrl_collapse_parameter_is_weighted_mean(const hdrl_parameter *);
58 extern hdrl_parameter * HDRL_COLLAPSE_WEIGHTED_MEAN;
59 hdrl_parameter * hdrl_collapse_sigclip_parameter_create(double, double, int);
60cpl_boolean hdrl_collapse_parameter_is_sigclip(const hdrl_parameter *);
61 double hdrl_collapse_sigclip_parameter_get_kappa_high(const hdrl_parameter *);
62 double hdrl_collapse_sigclip_parameter_get_kappa_low(const hdrl_parameter *);
63 int hdrl_collapse_sigclip_parameter_get_niter(const hdrl_parameter *);
64
65 hdrl_parameter * hdrl_collapse_minmax_parameter_create(double, double);
66cpl_boolean hdrl_collapse_parameter_is_minmax(const hdrl_parameter *);
67 double hdrl_collapse_minmax_parameter_get_nhigh(const hdrl_parameter *);
68 double hdrl_collapse_minmax_parameter_get_nlow(const hdrl_parameter *);
69
70 hdrl_parameter * hdrl_collapse_mode_parameter_create(double, double, double,
71 hdrl_mode_type, cpl_size);
72cpl_boolean hdrl_collapse_parameter_is_mode(const hdrl_parameter *);
73 double hdrl_collapse_mode_parameter_get_histo_min(const hdrl_parameter *);
74 double hdrl_collapse_mode_parameter_get_histo_max(const hdrl_parameter *);
75 double hdrl_collapse_mode_parameter_get_bin_size(const hdrl_parameter *);
76 hdrl_mode_type hdrl_collapse_mode_parameter_get_method(const hdrl_parameter *);
77cpl_size hdrl_collapse_mode_parameter_get_error_niter(const hdrl_parameter *);
78
79 hdrl_parameter * hdrl_collapse_parameter_parse_parlist(
80 const cpl_parameterlist *, const char *);
81cpl_parameterlist * hdrl_collapse_parameter_create_parlist(const char *,
82 const char *, const char *, hdrl_parameter *, hdrl_parameter *,
83 hdrl_parameter *) ;
84
85/*-----------------------------------------------------------------------------
86 Private declarations - must not be used outside of hdrl
87 -----------------------------------------------------------------------------*/
88
89#ifdef HDRL_USE_PRIVATE
90cpl_error_code hdrl_collapse_mode_parameter_verify(const hdrl_parameter *);
91cpl_error_code hdrl_collapse_minmax_parameter_verify(const hdrl_parameter *);
92cpl_error_code hdrl_collapse_sigclip_parameter_verify(const hdrl_parameter *);
93
94 typedef struct hdrl_collapse_imagelist_to_image_s
95 hdrl_collapse_imagelist_to_image_t;
96 typedef struct hdrl_collapse_imagelist_to_vector_s
97 hdrl_collapse_imagelist_to_vector_t;
98
99 typedef struct {
100 cpl_image * reject_low;
101 cpl_image * reject_high;
102} hdrl_sigclip_image_output;
103 typedef hdrl_sigclip_image_output hdrl_minmax_image_output;
104
105 typedef struct {
106 cpl_vector * reject_low;
107 cpl_vector * reject_high;
108} hdrl_sigclip_vector_output;
109 typedef hdrl_sigclip_vector_output hdrl_minmax_vector_output;
110
111hdrl_collapse_imagelist_to_image_t *
112 hdrl_collapse_imagelist_to_image_mean(void);
113hdrl_collapse_imagelist_to_image_t *
114 hdrl_collapse_imagelist_to_image_weighted_mean(void);
115hdrl_collapse_imagelist_to_image_t *
116 hdrl_collapse_imagelist_to_image_median(void);
117hdrl_collapse_imagelist_to_image_t *
118 hdrl_collapse_imagelist_to_image_sigclip(double, double, int);
119hdrl_collapse_imagelist_to_image_t *
120 hdrl_collapse_imagelist_to_image_minmax(double, double);
121hdrl_collapse_imagelist_to_image_t *
122 hdrl_collapse_imagelist_to_image_mode(double, double, double,
123 hdrl_mode_type, cpl_size);
124cpl_error_code hdrl_collapse_imagelist_to_image_call(
125 hdrl_collapse_imagelist_to_image_t * f,
126 const cpl_imagelist * data,
127 const cpl_imagelist * errors,
128 cpl_image ** out,
129 cpl_image ** err,
130 cpl_image ** contrib,
131 void ** eout);
132 void *
133hdrl_collapse_imagelist_to_image_create_eout(
134 hdrl_collapse_imagelist_to_image_t * f,
135 const cpl_image * data);
136 void
137hdrl_collapse_imagelist_to_image_delete_eout(
138 hdrl_collapse_imagelist_to_image_t * f,
139 void * eout);
140 void
141hdrl_collapse_imagelist_to_image_unwrap_eout(
142 hdrl_collapse_imagelist_to_image_t * f,
143 void * eout);
144cpl_error_code
145hdrl_collapse_imagelist_to_image_move_eout(
146 hdrl_collapse_imagelist_to_image_t * f,
147 void * dst,
148 void * src,
149 cpl_size y);
150 void hdrl_collapse_imagelist_to_image_delete(hdrl_collapse_imagelist_to_image_t *);
151
152hdrl_collapse_imagelist_to_vector_t *
153 hdrl_collapse_imagelist_to_vector_mean(void);
154hdrl_collapse_imagelist_to_vector_t *
155 hdrl_collapse_imagelist_to_vector_weighted_mean(void);
156hdrl_collapse_imagelist_to_vector_t *
157 hdrl_collapse_imagelist_to_vector_median(void);
158hdrl_collapse_imagelist_to_vector_t *
159 hdrl_collapse_imagelist_to_vector_sigclip(double, double, int);
160hdrl_collapse_imagelist_to_vector_t *
161hdrl_collapse_imagelist_to_vector_minmax(double, double);
162hdrl_collapse_imagelist_to_vector_t *
163hdrl_collapse_imagelist_to_vector_mode(double, double, double, hdrl_mode_type, cpl_size);
164
165cpl_error_code hdrl_collapse_imagelist_to_vector_call(
166 hdrl_collapse_imagelist_to_vector_t * f,
167 const cpl_imagelist * data,
168 const cpl_imagelist * errors,
169 cpl_vector ** out,
170 cpl_vector ** err,
171 cpl_array ** contrib,
172 void ** eout);
173
174 void * hdrl_collapse_imagelist_to_vector_create_eout(
175 hdrl_collapse_imagelist_to_vector_t * f,
176 cpl_size);
177 void hdrl_collapse_imagelist_to_vector_delete_eout(
178 hdrl_collapse_imagelist_to_vector_t * f,
179 void * eout);
180 void hdrl_collapse_imagelist_to_vector_unwrap_eout(
181 hdrl_collapse_imagelist_to_vector_t * f,
182 void * eout);
183cpl_error_code hdrl_collapse_imagelist_to_vector_move_eout(
184 hdrl_collapse_imagelist_to_vector_t * f,
185 void * dst,
186 void * src,
187 cpl_size y);
188 void hdrl_collapse_imagelist_to_vector_delete(
189 hdrl_collapse_imagelist_to_vector_t *);
190
191#endif
192
193CPL_END_DECLS
194
195#endif
hdrl_mode.h
hdrl_mode_type
hdrl_mode_type
Define the type of the mode that should be computed.
Definition hdrl_mode_defs.h:33
HDRL_COLLAPSE_MEAN
hdrl_parameter * HDRL_COLLAPSE_MEAN
HDRL_COLLAPSE_MEDIAN
hdrl_parameter * HDRL_COLLAPSE_MEDIAN
HDRL_COLLAPSE_WEIGHTED_MEAN
hdrl_parameter * HDRL_COLLAPSE_WEIGHTED_MEAN
hdrl_parameter.h
hdrl_parameter
struct _hdrl_parameter_ hdrl_parameter
Definition hdrl_parameter.h:27
hdrl_collapse_mode_parameter_get_bin_size
double hdrl_collapse_mode_parameter_get_bin_size(const hdrl_parameter *)
get size of the histogram bins
Definition hdrl_collapse.c:690
hdrl_collapse_mode_parameter_get_histo_min
double hdrl_collapse_mode_parameter_get_histo_min(const hdrl_parameter *)
get min value
Definition hdrl_collapse.c:658
hdrl_collapse_parameter_is_weighted_mean
cpl_boolean hdrl_collapse_parameter_is_weighted_mean(const hdrl_parameter *)
check if parameter is a weighted mean parameter
Definition hdrl_collapse.c:316
hdrl_collapse_sigclip_parameter_get_kappa_low
double hdrl_collapse_sigclip_parameter_get_kappa_low(const hdrl_parameter *)
get low kappa
Definition hdrl_collapse.c:419
hdrl_collapse_mean_parameter_create
CPL_BEGIN_DECLS hdrl_parameter * hdrl_collapse_mean_parameter_create(void)
create a parameter object for mean
Definition hdrl_collapse.c:255
hdrl_collapse_sigclip_parameter_create
hdrl_parameter * hdrl_collapse_sigclip_parameter_create(double, double, int)
create a parameter object for sigclipped mean
Definition hdrl_collapse.c:333
hdrl_collapse_weighted_mean_parameter_create
hdrl_parameter * hdrl_collapse_weighted_mean_parameter_create(void)
create a parameter object for weighted mean
Definition hdrl_collapse.c:303
hdrl_collapse_parameter_is_mean
cpl_boolean hdrl_collapse_parameter_is_mean(const hdrl_parameter *)
check if parameter is a mean parameter
Definition hdrl_collapse.c:268
hdrl_collapse_parameter_is_median
cpl_boolean hdrl_collapse_parameter_is_median(const hdrl_parameter *)
check if parameter is a median parameter
Definition hdrl_collapse.c:292
hdrl_collapse_mode_parameter_get_histo_max
double hdrl_collapse_mode_parameter_get_histo_max(const hdrl_parameter *)
get high value
Definition hdrl_collapse.c:674
hdrl_collapse_sigclip_parameter_get_niter
int hdrl_collapse_sigclip_parameter_get_niter(const hdrl_parameter *)
get maximum number of clipping iterations
Definition hdrl_collapse.c:435
hdrl_collapse_mode_parameter_get_error_niter
cpl_size hdrl_collapse_mode_parameter_get_error_niter(const hdrl_parameter *)
get the error type of the mode
Definition hdrl_collapse.c:722
hdrl_collapse_parameter_is_minmax
cpl_boolean hdrl_collapse_parameter_is_minmax(const hdrl_parameter *)
check if parameter is a minmax mean parameter
Definition hdrl_collapse.c:475
hdrl_collapse_parameter_is_mode
cpl_boolean hdrl_collapse_parameter_is_mode(const hdrl_parameter *)
check if parameter is a mode parameter
Definition hdrl_collapse.c:594
hdrl_collapse_parameter_is_sigclip
cpl_boolean hdrl_collapse_parameter_is_sigclip(const hdrl_parameter *)
check if parameter is a sigclip mean parameter
Definition hdrl_collapse.c:355
hdrl_collapse_sigclip_parameter_get_kappa_high
double hdrl_collapse_sigclip_parameter_get_kappa_high(const hdrl_parameter *)
get high kappa
Definition hdrl_collapse.c:403
hdrl_collapse_minmax_parameter_get_nlow
double hdrl_collapse_minmax_parameter_get_nlow(const hdrl_parameter *)
get low value
Definition hdrl_collapse.c:545
hdrl_collapse_median_parameter_create
hdrl_parameter * hdrl_collapse_median_parameter_create(void)
create a parameter object for median
Definition hdrl_collapse.c:279
hdrl_collapse_mode_parameter_create
hdrl_parameter * hdrl_collapse_mode_parameter_create(double, double, double, hdrl_mode_type, cpl_size)
create a parameter object for the mode
Definition hdrl_collapse.c:567
hdrl_collapse_parameter_create_parlist
cpl_parameterlist * hdrl_collapse_parameter_create_parlist(const char *, const char *, const char *, hdrl_parameter *, hdrl_parameter *, hdrl_parameter *)
Create parameters for the collapse.
Definition hdrl_collapse.c:748
hdrl_collapse_mode_parameter_get_method
hdrl_mode_type hdrl_collapse_mode_parameter_get_method(const hdrl_parameter *)
get the mode determination method
Definition hdrl_collapse.c:706
hdrl_collapse_minmax_parameter_create
hdrl_parameter * hdrl_collapse_minmax_parameter_create(double, double)
create a parameter object for min-max rejected mean
Definition hdrl_collapse.c:454
hdrl_collapse_parameter_parse_parlist
hdrl_parameter * hdrl_collapse_parameter_parse_parlist(const cpl_parameterlist *, const char *)
parse parameterlist for imagelist reduction method
Definition hdrl_collapse.c:845
hdrl_collapse_minmax_parameter_get_nhigh
double hdrl_collapse_minmax_parameter_get_nhigh(const hdrl_parameter *)
get high value
Definition hdrl_collapse.c:529
hdrl_collapse_imagelist_to_image_s
Definition hdrl_collapse.c:53
hdrl_collapse_imagelist_to_vector_s
Definition hdrl_collapse.c:78