AddSpdcByParameters

Declaration: TSpdcSet.AddSpdcByParameters(Mode: TSpdcMode; SpecType: TLayerType; DerivOrder, GroupNr: integer; Caption, ColorMap, VSpdcFormula: string; a1, a2, b1, b2: double; BLMode: TBLMode; BLNeighb: integer): integer;
Adds a spectral descriptor to the descriptor set. The Mode parameter controls the type of the spectral descriptor and may assume one of the following values (see the section on spectral descriptors for an in-depth explanation):
smPeak ... the intensity at a single wavelength or mass
smArea ... the summed intensity within a range of the spectrum
smCorrTempl ... the correlation to a template peak
smCorrInvTempl ... the correlation to an inverse template peak
smPkRatio ... the ratio of two peaks
smCentroid ... the location of the centroid
smArRatio ... the ratio of two areas
smVirtSpdc ... a virtual spectral descriptor
smIntGridFilt ... an intensity grid filter
smGCorrTempl ... the correlation to a generalized Gaussian peak
smGCorrInvTempl ... the correlation to an inverse generalized Gaussian peak
smVarDiff ... the variance of the serial difference of a spectrum
smDeriv1 ... the smoothed first derivative at a particular wavelength
The parameters SpecType and DerivOrder define the spectral type and the order of derivative the descriptor is designed for. The parameter GroupNr specifies the spectral group the descriptor should be applied to.

The parameter Caption is an arbitrary identifier (max. 15 characters), the ColorMap parameter specifies an optional color palette which is assigned to this descriptor. The values a1, a2, b1 and b2 control the parameters of the spectral descriptor. Their specific meaning varies with the type of the descriptor. The BLMode controls the type of the baseline, it may assume one of the following values:

blNone ... no baseline is subtracted
blLinear ... the baseline is a line controlled by the parameters b1 and b2
blP1Level ... the baseline is a constant level controlled by the parameter b1
The parameter BLNeighb specifies the number of neighboring points to the baseline reference point which are averaged to calculate the baseline reference intensity. Setting this parameter higher results in less dependence of the baseline on noise in the spectra; however it may cause systematic deviation if the baseline reference point is set in a narrow valley or peak of the spectrum.

The function returns the (positive) index of the spectral descriptor in the descriptor list. A negative number indicates an error:

-1 .... invalid order of derivative (valid range: 0..7)
-2 .... invalid number of baseline points
-3 .... the list of spectral descriptors is full

Hint: In order to directly access the currently loaded spectral descriptors (those which are displayed in the Spectral Descriptor Editor) you can use the pre-declared global variable SPDCData.