public class SpectrumPeak
extends java.lang.Object
Constructor and Description |
---|
SpectrumPeak(double yPeakValue,
double multiplier)
If you use this constructor, you must also call
allocateBuffers(), followed by setBufferElements().
|
SpectrumPeak(int newPeakIndex,
double[] xValues,
double[] yValues)
Creates a new instance of SpectrumPeak.
|
SpectrumPeak(int peakIndex,
double[] xValues,
double[] yValues,
double lowCutoff,
IntegrationMethod method)
Creates a new instance of SpectrumPeak.
|
Modifier and Type | Method and Description |
---|---|
void |
allocateBuffers(int numberOfPixels) |
SpectrumPeak[] |
getAllPeaks_VB6(int minIndicesBetweenPeaks,
double baseline) |
static SpectrumPeak[] |
getAllPeaks(double[] xValues,
double[] yValues,
int minIndicesBetweenPeaks,
double baseline)
Locates all of the peaks in the given spectrum and returns an array of
their indices.
|
double |
getCenterWavelength()
Getter for property centerWavelength, which is the center wavelength of
the peak as the average wavelength of the low and high 50% crossings.
|
double |
getCentroid()
Returns the centroid of the peak, which is the point of intersection
of its medians.
|
double |
getEnclosingWidth()
Returns the distance from the peak wavelength over which 90% of the area
under the peak is included.
|
double |
getIntegral()
Returns the value of the integral function.
|
double |
getPeakXValue()
Returns the x value (wavelength) in the current units (usually nm) of the
peak value.
|
double |
getPixelFullWidthAtHalfMaximum()
Returns the pixel value for full width at half maximum.
|
double |
getPixelFullWidthAtQuarterMaximum()
Returns the pixel value for full width at quarter maximum.
|
int |
getPixelNumber()
Returns the pixel number of the peak.
|
double |
getWavelengthFullWidthAtHalfMaximum()
Returns the wavelength value for full width at half maximum.
|
double |
getWavelengthFullWidthAtQuarterMaximum()
Returns the wavelength value for quarter width at quarter maximum.
|
void |
initialize_VB6(int newPeakIndex)
Call allocateBuffers() and setBufferElements() before calling this method.
|
void |
initialize2_VB6(int peakIndex,
IntegrationMethod method) |
void |
setBufferElements(int index,
double xValue,
double yValue) |
java.lang.String |
toString()
Returns a string representation of the object.
|
public SpectrumPeak(double yPeakValue, double multiplier)
multiplier
- is typically set to 0.05 (which is equivalent to 5% of peak valuepublic SpectrumPeak(int newPeakIndex, double[] xValues, double[] yValues)
Note that the centroid and integral calculations include the area starting at the peak wavelength and continuing outwards until the tails drop below 5% of the peak value on each side. The default integration method is rectangular (given its correctness for point lines).
newPeakIndex
- the new index in xValues and yValues of the peak.xValues
- X value array.yValues
- Y value array.public SpectrumPeak(int peakIndex, double[] xValues, double[] yValues, double lowCutoff, IntegrationMethod method)
peakIndex
- Index in xValues and yValues of the peak.xValues
- X value array.yValues
- Y value array.lowCutoff
- Cutoff value for detecting the edge of a peak for the
purposes of computing the area and centroid of the peak. The peak is
considered ended when its tail drops below this amount.method
- Integration method to use when computing the area under the
peak.public void allocateBuffers(int numberOfPixels)
public void setBufferElements(int index, double xValue, double yValue)
public void initialize_VB6(int newPeakIndex)
public void initialize2_VB6(int peakIndex, IntegrationMethod method)
public double getWavelengthFullWidthAtHalfMaximum()
public double getWavelengthFullWidthAtQuarterMaximum()
public double getPixelFullWidthAtHalfMaximum()
public double getPixelFullWidthAtQuarterMaximum()
public double getCenterWavelength()
public double getCentroid()
public double getIntegral()
public int getPixelNumber()
public double getPeakXValue()
public double getEnclosingWidth()
public static SpectrumPeak[] getAllPeaks(double[] xValues, double[] yValues, int minIndicesBetweenPeaks, double baseline)
xValues
- X value array.yValues
- Y value array.minIndicesBetweenPeaks
- Least number of values that must appear
between two reported peaks. A value of 1 allows peaks that have one
value between them to be found. A value of 10 will cause only the
largest of a window of 21 pixels to be reported, centered on the
largest peak. Values less than 1 will be treated as though it were
set to 1.baseline
- Minimum value that an element in the spectrum can be
and still be considered a peak.public SpectrumPeak[] getAllPeaks_VB6(int minIndicesBetweenPeaks, double baseline)
public java.lang.String toString()
toString
in class java.lang.Object
Copyright 2004-2006 Ocean Optics, Inc. All Rights Reserved.