Example: |
The following code snippet shows how to read a spectrum from a spectral collection and project it into the spectral space of the currently loaded hypercube:
const
SPECCOLLLIB = 'xxxx.scll'; // name of spectral collection
GRP = 1; // spectral group to be projected
var
SpColl : TSpecCollection;
OtherMeta : TMetaData;
MainSpec : TDoubleArray;
OutSpec : TDoubleArray;
OutRange1,
OutRange2 : integer;
...
...
OtherMeta := TMetaData.Create(nil);
SpColl := TSpecCollection.Create(nil);
SpColl.Load (SPECCOLLLIB, true);
SpColl.CopyWLSclParsToMetaData(OtherMeta); // get the calibration of the spectral collection
GetSpectrum (1,1,1, GRP, MainSpec); // get a spectrum from the hypercube
ProjectSpectrum (MainSpec, MData, GRP, // interpolate the first spectrum in the collection
Spcoll.Items[1].SpectrumAsArray, OtherMeta,
OutSpec, OutRange1, OutRange2);
...
...
|