CR2RE Pipeline Reference Manual 1.6.2
Functions
Hdrl_correlation

Functions

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.
 
void hdrl_xcorrelation_result_delete (hdrl_xcorrelation_result *self)
 Destructor for hdrl_xcorrelation_result.
 
cpl_size hdrl_xcorrelation_result_get_peak_pixel (const hdrl_xcorrelation_result *self)
 Get the index where the cross correlation reaches its maximum.
 
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.
 
cpl_size hdrl_xcorrelation_result_get_half_window (const hdrl_xcorrelation_result *self)
 Get the half_window used to calculate the cross-correlation.
 
double hdrl_xcorrelation_result_get_sigma (const hdrl_xcorrelation_result *self)
 Get the estimated standard deviation of the correlation.
 
const cpl_array * hdrl_xcorrelation_result_get_correlation (const hdrl_xcorrelation_result *self)
 Getter for the cross correlation.
 
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.
 
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.
 
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.
 

Detailed Description

Function Documentation

◆ 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.

Parameters
arr1First array
arr2Second array
half_winhalf search window where the correlation is calculated
normalizeCPL_TRUE normalize correlation in mean and rms
binwavelength bin
wrangehalf window wavelength range where the fit is going to be done
Returns
gaussian fit for cross correlation.

Definition at line 299 of file hdrl_correlation.c.

References hdrl_compute_offset_gaussian_internal(), and hdrl_xcorrelation_result_delete().

Referenced by hdrl_spectrum1D_compute_shift_xcorrelation().

◆ 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.

Parameters
arr1First array
arr2Second array
half_winhalf search window where the correlation is calculated
normalizeCPL_TRUE normalize correlation in mean and rms
binwavelength bin
wrangehalf window wavelength range where the fit is going to be done
Returns
gaussian fit for cross correlation.

Definition at line 340 of file hdrl_correlation.c.

References hdrl_compute_xcorrelation(), and hdrl_xcorrelation_result_delete().

Referenced by hdrl_compute_offset_gaussian().

◆ 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.

Parameters
arr1First array
arr2Second array
half_windowhalf search window where the correlation is calculated
normalizeCPL_TRUE normalize correlation in mean and rms
Returns
cross correlation and index where the peak is. NULL in case of error.
Note
: elements marked as invalid in arr1 or arr2 will be treated as they were out-of-boudary pixels.

Definition at line 211 of file hdrl_correlation.c.

References hdrl_xcorrelation_result_wrap().

Referenced by hdrl_compute_offset_gaussian_internal().

◆ hdrl_xcorrelation_result_delete()

void hdrl_xcorrelation_result_delete ( hdrl_xcorrelation_result *  self)

Destructor for hdrl_xcorrelation_result.

Parameters
selfhdrl_xcorrelation_result to be deleted
Returns
nothing

Definition at line 103 of file hdrl_correlation.c.

Referenced by hdrl_compute_offset_gaussian(), and hdrl_compute_offset_gaussian_internal().

◆ hdrl_xcorrelation_result_get_correlation()

const cpl_array * hdrl_xcorrelation_result_get_correlation ( const hdrl_xcorrelation_result *  self)

Getter for the cross correlation.

Parameters
selfhdrl_xcorrelation_result the getter will extract the data from
Returns
the cross correlation

Definition at line 190 of file hdrl_correlation.c.

◆ 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.

Parameters
selfhdrl_xcorrelation_result the getter will extract the data from
Returns
the half_window used to calculate the cross-correlation.

Definition at line 155 of file hdrl_correlation.c.

◆ 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.

Parameters
selfhdrl_xcorrelation_result the getter will extract the data from
Returns
the index where the cross correlation reaches its maximum

Definition at line 120 of file hdrl_correlation.c.

◆ 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.

Parameters
selfhdrl_xcorrelation_result the getter will extract the data from
Returns
the index where the cross correlation reaches its maximum, with sub-pixel precision

Definition at line 138 of file hdrl_correlation.c.

◆ hdrl_xcorrelation_result_get_sigma()

double hdrl_xcorrelation_result_get_sigma ( const hdrl_xcorrelation_result *  self)

Get the estimated standard deviation of the correlation.

Parameters
selfhdrl_xcorrelation_result the getter will extract the data from
Returns
the estimated standard deviation of the correlation

Definition at line 173 of file hdrl_correlation.c.

◆ 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.

Parameters
x_corrCross correlation. x_corr becomes owned by the returned value, do not free x_corr after the wrapping.
max_idxIndex where the cross correlation reaches its maximum
half_windowHalf window used for the cross-correlation calculation
Returns
the constructed object. NULL in case of error. Errors are triggered if data are not self consistent, e.g. if max_idx is greated than the length of x_corr.

Definition at line 79 of file hdrl_correlation.c.

Referenced by hdrl_compute_xcorrelation().