Point pattern patching module


Functions

cpl_bivector * cpl_ppm_match_positions (cpl_vector *peaks, cpl_vector *lines, double min_disp, double max_disp, double tolerance, cpl_array **seq_peaks, cpl_array **seq_lines)
 Match 1-D patterns.

Detailed Description

Synopsis:
   #include "cpl_ppm.h"

Function Documentation

cpl_bivector* cpl_ppm_match_positions ( cpl_vector *  peaks,
cpl_vector *  lines,
double  min_disp,
double  max_disp,
double  tolerance,
cpl_array **  seq_peaks,
cpl_array **  seq_lines 
)

Match 1-D patterns.

Parameters:
peaks List of observed positions (e.g., of emission peaks)
lines List of positions in searched pattern (e.g., wavelengths)
min_disp Min expected scale (e.g., spectral dispersion in A/pixel)
max_disp Max expected scale (e.g., spectral dispersion in A/pixel)
tolerance Tolerance for interval ratio comparison
seq_peaks Returned: index of identified peaks in input peaks
seq_lines Returned: index of identified lines in input lines
Returns:
List of all matching points positions
This function attempts to find the reference pattern lines in a list of observed positions peaks. In the following documentation a terminology drawn from the context of arc lamp spectra calibration is used for simplicity: the reference pattern is then a list of wavelengths corresponding to a set of reference arc lamp emission lines - the so-called line catalog; while the observed positions are the positions (in pixel) on the CCD, measured along the dispersion direction, of any significant peak of the signal. To identify the observed peaks means to associate them with the right reference wavelength. This is attempted here with a point-pattern matching technique, where the pattern is contained in the vector lines, and is searched in the vector peak.

In order to work, this method just requires a rough expectation value of the spectral dispersion (in Angstrom/pixel), and a line catalog. The line catalog lines should just include lines that are expected somewhere in the CCD exposure of the calibration lamp (note, however, that a catalog including extra lines at its blue and/or red ends is still allowed).

Typically, the arc lamp lines candidates peak will include light contaminations, hot pixels, and other unwanted signal, but only in extreme cases this prevents the pattern-recognition algorithm from identifying all the spectral lines. The pattern is detected even in the case peak contained more arc lamp lines than actually listed in the input line catalog.

This method is based on the assumption that the relation between wavelengths and CCD positions is with good approximation locally linear (this is always true, for any modern spectrograph).

The ratio between consecutive intervals pairs in wavelength and in pixel is invariant to linear transformations, and therefore this quantity can be used in the recognition of local portions of the searched pattern. All the examined sub-patterns will overlap, leading to the final identification of the whole pattern, notwithstanding the overall non-linearity of the relation between pixels and wavelengths.

Ambiguous cases, caused by exceptional regularities in the pattern, or by a number of undetected (but expected) peaks that disrupt the pattern on the data, are recovered by linear interpolation and extrapolation of the safely identified peaks.

More details about the applied algorithm can be found in the comments to the function code.

The seq_peaks and seq_lines are array reporting the positions of matching peaks and wavelengths in the input peaks and lines vectors. This functionality is not yet supported: this arguments should always be set to NULL or a CPL_ERROR_UNSUPPORTED_MODE would be set.


Generated on Thu Mar 6 17:29:21 2008 for Common Pipeline Library Reference Manual by  doxygen 1.5.1