Package jspecview.common
Class Spectrum
java.lang.Object
jspecview.source.JDXHeader
jspecview.source.JDXDataObject
jspecview.common.Spectrum
JDXSpectrum
implements the Interface Spectrum for the display of
JDX Files.- Author:
- Bob Hanson, Debbie-Ann Facey, Khari A. Bryan, Prof Robert J. Lancashire
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsFields inherited from class jspecview.source.JDXDataObject
blockID, ERROR, fileFirstX, fileLastX, fileNPoints, freq2dX, freq2dY, isSimulation, nucleusX, nucleusY, parent, REF_TYPE_BRUKER, REF_TYPE_STANDARD, REF_TYPE_UNSPECIFIED, REF_TYPE_VARIAN, sourceID, xFactor, xLabel, xUnits, xyCoords, y2DUnits, yFactor, yLabel, yUnits
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
addSpecShift
(double dx) boolean
addSubSpectrum
(Spectrum spectrum, boolean forceSub) adds an nD subspectrum and titles it "Subspectrum" These spectra can be iterated over using the UP and DOWN keys. int
advanceSubSpectrum
(int dir) static boolean
allowSubSpec
(Spectrum s1, Spectrum s2) static boolean
areLinkableX
(Spectrum s1, Spectrum s2) static boolean
areLinkableY
(Spectrum s1, Spectrum s2) static boolean
areXScalesCompatible
(Spectrum s1, Spectrum s2, boolean isSubspecCheck, boolean isLinkCheck) copy()
specifically for Abs/Trans conversion.void
dispose()
findPeakByCoord
(int xPixel, Coordinate coord) double
findXForPeakNearest
(double x) getAssociatedPeakInfo
(int xPixel, Coordinate coord) getAxisLabel
(boolean isX) checks in order: (1) Peaks tag attribute xUnits/yUnits, then (2) ##XLABEL/##YLABEL, then (3) ##XUNITS/##YUNITSfloat
double
getPercentYValueAt
(double x) int
double
Returns the array of coordinatesdouble
getYValueAt
(double x) boolean
boolean
boolean
matchesPeakTypeModel
(String type, String model) Find a matching spectrum by type (IR, 1HNMR,...) and model namestatic Spectrum
newSpectrum
(Spectrum spectrum, Coordinate[] newXYCoords, String units) copy spectrum with new coordinatesstatic boolean
process
(Lst<Spectrum> specs, Spectrum.IRMode irMode) selectPeakByFileIndex
(String filePath, String index, String atomKey) selectPeakByFilePathTypeModel
(String filePath, String type, String model) void
setConvertedSpectrum
(Spectrum spectrum) int
setCurrentSubSpectrum
(int n) void
setExportXAxisDirection
(boolean leftToRight) void
setFillColor
(GenericColor color) void
setHighlightedPeak
(PeakInfo peak) void
int
setNextPeak
(Coordinate coord, int istep) int
setPeakList
(Lst<PeakInfo> list, String peakXLabel, String peakYLabel) void
setSelectedPeak
(PeakInfo peak) void
setSimulated
(String filePath) void
setUserYFactor
(double userYFactor) Set by JSViewerstatic Spectrum
taConvert
(Spectrum spectrum, Spectrum.IRMode mode) toString()
Methods inherited from class jspecview.source.JDXDataObject
canConvertTransAbs, canIntegrate, canSaveAsJDX, canShowSolutionColor, checkJDXRequiredTokens, copyTo, getDefaultAnnotationInfo, getDefaultUnitPrecision, getDeltaX, getFilePath, getFilePathForwardSlash, getFirstX, getFirstY, getGyromagneticRatio, getHeaderRowDataAsArray, getHydrogenCount, getInlineData, getLastX, getLastY, getMaxX, getMaxY, getMinX, getMinY, getNominalSpecFreq, getNumDim, getObservedFreq, getObservedNucleus, getPeakListArray, getTypeLabel, getXFactor, getXUnits, getY2D, getY2DPPM, getYFactor, getYRef, getYUnits, invertYAxis, is1D, isAbsorbance, isAutoOverlayFromJmolClick, isContinuous, isGC, isHNMR, isHZtoPPM, isImaginary, isInverted, isMS, isNMR, isScalable, isStackable, isTransmittance, isXIncreasing, normalizeSimulation, setBlockID, setContinuous, setFilePath, setHydrogenCount, setHZtoPPM, setIncreasing, setInlineData, setMeasurementText, setNucleusAndFreq, setNumDim, setObservedFreq, setObservedNucleus, setVarName, setXFactor, setXLabel, setXUnits, setXYCoords, setY2D, setY2DUnits, setYFactor, setYLabel, setYUnits, shouldDisplayXAxisIncreasing
Methods inherited from class jspecview.source.JDXHeader
getDataClass, getDataType, getDate, getHeaderRowDataAsArray, getHeaderTable, getJcampdx, getLongDate, getOrigin, getOwner, getQualifiedDataType, getTime, getTitle, setDataClass, setDataType, setDate, setHeaderTable, setJcampdx, setLongDate, setOrigin, setOwner, setTime, setTitle
-
Field Details
-
id
-
MAXABS
public static final double MAXABS- See Also:
-
-
Constructor Details
-
Spectrum
public Spectrum()Constructor
-
-
Method Details
-
dispose
public void dispose() -
isForcedSubset
public boolean isForcedSubset() -
setId
-
copy
specifically for Abs/Trans conversion. Note that we do NOT carry over piUnitsY- Returns:
- a copy of this
JDXSpectrum
-
getXYCoords
Returns the array of coordinates- Returns:
- the array of coordinates
-
getPeakList
-
setPeakList
-
selectPeakByFileIndex
-
selectPeakByFilePathTypeModel
-
matchesPeakTypeModel
Find a matching spectrum by type (IR, 1HNMR,...) and model name- Parameters:
type
- if null, then model is a sourceID to matchmodel
-- Returns:
- true for match
-
setSelectedPeak
-
setHighlightedPeak
-
getSelectedPeak
-
getModelPeakInfoForAutoSelectOnLoad
-
getAssociatedPeakInfo
-
findPeakByCoord
-
getPeakTitle
-
getTitleLabel
-
setNextPeak
-
getPercentYValueAt
public double getPercentYValueAt(double x) -
getYValueAt
public double getYValueAt(double x) -
setUserYFactor
public void setUserYFactor(double userYFactor) Set by JSViewer- Parameters:
userYFactor
-
-
getUserYFactor
public double getUserYFactor() -
getConvertedSpectrum
-
setConvertedSpectrum
-
taConvert
-
newSpectrum
copy spectrum with new coordinates- Parameters:
spectrum
-newXYCoords
-units
-- Returns:
- new spectrum
-
process
-
getSubSpectra
-
getCurrentSubSpectrum
-
advanceSubSpectrum
public int advanceSubSpectrum(int dir) -
setCurrentSubSpectrum
public int setCurrentSubSpectrum(int n) -
addSubSpectrum
adds an nD subspectrum and titles it "Subspectrum" These spectra can be iterated over using the UP and DOWN keys. - Parameters:
spectrum
-forceSub
-- Returns:
- true if was possible
-
getSubIndex
public int getSubIndex() -
setExportXAxisDirection
public void setExportXAxisDirection(boolean leftToRight) -
isExportXAxisLeftToRight
public boolean isExportXAxisLeftToRight() -
getInfo
-
findMatchingPeakInfo
-
getBasePeakInfo
-
getAxisLabel
checks in order: (1) Peaks tag attribute xUnits/yUnits, then (2) ##XLABEL/##YLABEL, then (3) ##XUNITS/##YUNITS- Parameters:
isX
-- Returns:
- suitable label or ""
-
findXForPeakNearest
public double findXForPeakNearest(double x) -
addSpecShift
public double addSpecShift(double dx) -
allowSubSpec
-
areXScalesCompatible
-
areLinkableX
-
areLinkableY
-
getPeakWidth
public float getPeakWidth() -
setSimulated
-
setFillColor
-
toString
-