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

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

Loading...
Searching...
No Matches
hdrl_correlation.h
Go to the documentation of this file.
1/* $Id: hdrl_correlation.h,v 0.1 2017-04-12 16:49:47 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-04-12 16:49:47 $
24 * $Revision: 0.1 $
25 * $Name: not supported by cvs2svn $
26 */
27
28#ifndef HDRL_CORRELATION_H
29#define HDRL_CORRELATION_H
30
31/*-----------------------------------------------------------------------------
32 Includes
33 -----------------------------------------------------------------------------*/
34
35#include <cpl.h>
36#include "hdrl_types.h"
37
38CPL_BEGIN_DECLS
39
40
41 typedef struct{
42 double peakpos; /* Position of the peak of the gaussian fitted to the cross correlation */
43 double sigma; /* Width of the gaussian fitted to the cross correlation */
44 double area; /* Area of the gaussian fitted to the cross correlation */
45 double offset; /* Fitted background level */
46 double mse; /* Mean squared error of the best fit */
47 cpl_array * xcorr; /* Cross-correlation */
48 cpl_size pix_peakpos; /* Pixel position of the peak */
49 cpl_size half_window;
50}hdrl_xcorrelation_result;
51
52 hdrl_xcorrelation_result *
53 hdrl_xcorrelation_result_wrap(cpl_array * x_corr, const cpl_size max_idx,
54 const cpl_size half_window);
55
56 void hdrl_xcorrelation_result_delete(hdrl_xcorrelation_result * self);
57
58cpl_size
59 hdrl_xcorrelation_result_get_peak_pixel(const hdrl_xcorrelation_result * self);
60
61 double
62 hdrl_xcorrelation_result_get_peak_subpixel(const hdrl_xcorrelation_result * self);
63
64cpl_size
65 hdrl_xcorrelation_result_get_half_window (const hdrl_xcorrelation_result * self);
66
67 double
68 hdrl_xcorrelation_result_get_sigma(const hdrl_xcorrelation_result * self);
69
70 const cpl_array *
71 hdrl_xcorrelation_result_get_correlation(const hdrl_xcorrelation_result * self);
72
73
74 hdrl_xcorrelation_result * hdrl_compute_xcorrelation(
75 const cpl_array * arr1,
76 const cpl_array * arr2,
77 const cpl_size half_window, const cpl_boolean normalize);
78
79 hdrl_xcorrelation_result * hdrl_compute_offset_gaussian(
80 const cpl_array * arr1,
81 const cpl_array * arr2,
82 const cpl_size half_win, const cpl_boolean normalize,
83 const double bin, const double wrange);
84
85#if defined HDRL_USE_PRIVATE
86
87 hdrl_xcorrelation_result *
88 hdrl_compute_offset_gaussian_internal(
89 const cpl_array * arr1, const cpl_array * arr2,
90 const cpl_size half_win, const cpl_boolean normalize,
91 const double bin, const double wrange);
92
93#endif
94
95CPL_END_DECLS
96
97#endif
hdrl_types.h
hdrl_xcorrelation_result_delete
void hdrl_xcorrelation_result_delete(hdrl_xcorrelation_result *self)
Destructor for hdrl_xcorrelation_result.
Definition hdrl_correlation.c:101
hdrl_compute_xcorrelation
hdrl_xcorrelation_result * hdrl_compute_xcorrelation(const cpl_array *arr1, const cpl_array *arr2, const cpl_size half_window, const cpl_boolean normalize)
Calculate cross-correlation.
Definition hdrl_correlation.c:209
hdrl_xcorrelation_result_get_correlation
const cpl_array * hdrl_xcorrelation_result_get_correlation(const hdrl_xcorrelation_result *self)
Getter for the cross correlation.
Definition hdrl_correlation.c:188
hdrl_xcorrelation_result_get_peak_pixel
cpl_size hdrl_xcorrelation_result_get_peak_pixel(const hdrl_xcorrelation_result *self)
Get the index where the cross correlation reaches its maximum.
Definition hdrl_correlation.c:118
hdrl_xcorrelation_result_get_half_window
cpl_size hdrl_xcorrelation_result_get_half_window(const hdrl_xcorrelation_result *self)
Get the half_window used to calculate the cross-correlation.
Definition hdrl_correlation.c:154
hdrl_compute_offset_gaussian_internal
hdrl_xcorrelation_result * hdrl_compute_offset_gaussian_internal(const cpl_array *arr1, const cpl_array *arr2, const cpl_size half_win, const cpl_boolean normalize, const double bin, const double wrange)
Calculate gaussian fit on cross-correlation.
Definition hdrl_correlation.c:338
hdrl_compute_offset_gaussian
hdrl_xcorrelation_result * hdrl_compute_offset_gaussian(const cpl_array *arr1, const cpl_array *arr2, const cpl_size half_win, const cpl_boolean normalize, const double bin, const double wrange)
Calculate gaussian fit on cross-correlation, does a second fitting for refinement.
Definition hdrl_correlation.c:297
hdrl_xcorrelation_result_get_peak_subpixel
double hdrl_xcorrelation_result_get_peak_subpixel(const hdrl_xcorrelation_result *self)
Get the index where the cross correlation reaches its maximum, with sub-pixel precision.
Definition hdrl_correlation.c:137
hdrl_xcorrelation_result_get_sigma
double hdrl_xcorrelation_result_get_sigma(const hdrl_xcorrelation_result *self)
Get the estimated standard deviation of the correlation.
Definition hdrl_correlation.c:171
hdrl_xcorrelation_result_wrap
hdrl_xcorrelation_result * hdrl_xcorrelation_result_wrap(cpl_array *x_corr, const cpl_size max_idx, const cpl_size half_window)
Constructor for hdrl_xcorrelation_result.
Definition hdrl_correlation.c:79
hdrl_xcorrelation_result
Definition hdrl_correlation.h:41
hdrl_xcorrelation_result::area
double area
Definition hdrl_correlation.h:44
hdrl_xcorrelation_result::sigma
double sigma
Definition hdrl_correlation.h:43
hdrl_xcorrelation_result::half_window
cpl_size half_window
Definition hdrl_correlation.h:49
hdrl_xcorrelation_result::offset
double offset
Definition hdrl_correlation.h:45
hdrl_xcorrelation_result::xcorr
cpl_array * xcorr
Definition hdrl_correlation.h:47
hdrl_xcorrelation_result::mse
double mse
Definition hdrl_correlation.h:46
hdrl_xcorrelation_result::peakpos
double peakpos
Definition hdrl_correlation.h:42
hdrl_xcorrelation_result::pix_peakpos
cpl_size pix_peakpos
Definition hdrl_correlation.h:48