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. | |
#include "cpl_ppm.h"
| 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.
| 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 |
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.
1.5.1