Package chemaxon.calculations.nmr
Class NMRSpectrum
- java.lang.Object
-
- chemaxon.calculations.nmr.NMRSpectrum
-
- All Implemented Interfaces:
chemaxon.calculations.nmr.Spectrum
@PublicAPI public class NMRSpectrum extends Object implements chemaxon.calculations.nmr.Spectrum
Class for the representation of NMR spectra.- Since:
- 5.7
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
NMRSpectrum.Nucleus
Nucleus enumeration type.static class
NMRSpectrum.Unit
Unit enumeration type.
-
Field Summary
Fields Modifier and Type Field Description protected double
functionScale
Scale factor for NMR spectrum function scaling.
-
Constructor Summary
Constructors Constructor Description NMRSpectrum(Molecule mol)
Constructor.NMRSpectrum(Molecule mol, NMRSpectrum.Nucleus nucleusType)
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
computeFunctionScale()
Computes the scaling factor for the unscaled NMR spectrum function.protected void
computeFunctionScale(double aimedMaxValue, double[] places)
List<Integer>
getAtomIndexes()
Returns the atom indices of the NMR active nuclei.double[][]
getCouplingConstants()
Returns coupling constants.double[][]
getCouplingConstants(NMRSpectrum.Unit unit)
Returns coupling constants in the given unit.double
getDefaultValue()
double
getDomainMax()
Returns the upper end of the spectrum.double
getDomainMin()
Returns the lower end of the spectrum.double
getFrequency()
Returns the NMR measurement frequency in MHz unit.protected double
getFunctionScale()
double
getHalfWidth()
Returns NMR half-width.double
getIntegralValueAt(double location)
Returns the value of the NMR integral function at a given x point.double[]
getLocalMaximumPlaces()
static double[]
getMeaningfulFrequencies()
Returns the array of meaningful NMR measurement frequencies in MHz.Molecule
getMolecule()
Returns the molecule under examination.chemaxon.calculations.nmr.Multiplet[]
getMultiplets()
String
getName()
Returns the name of the NMR spectrum.String
getNucleusString()
Returns the nucleus type string.NMRSpectrum.Nucleus
getNucleusType()
Returns the type of the nucleus under examination.int
getNumberOfNMRActiveNuclei()
Returns number of the NMR active nuclei.double
getRangeMax()
Maximal y value of the NMR spectrum function.double
getRangeMin()
Minimal y value of the NMR spectrum function.double
getRawValueAt(double location)
Returns the value of the unscaled NMR spectrum function at a given x point.Shift[]
getShifts()
Returns chemical shifts.protected Molecule
getStrictMolecule()
NMRSpectrum.Unit
getUnit()
Returns the unit type.double
getValueAt(double location)
Returns the value of the NMR spectrum function at a given x point.boolean
isCouplingNeeded()
Returns whether spin-spin couplings are taken into account.boolean
isImplicitHydrogenMode()
Returns implicit hydrogen mode.void
setCouplingConstants(double[][] couplingConstants)
Sets coupling constants.void
setCouplingNeeded(boolean couplingNeeded)
Sets whether spin-spin couplings are taken into account.void
setDomainMax(double domainMax)
Sets the upper end of the spectrum.void
setDomainMin(double domainMin)
Sets the lower end of the spectrum.void
setFrequency(double frequency)
Sets the NMR measurement frequency.void
setHalfWidth(double halfWidth)
Sets NMR half-width.void
setImplicitHydrogenMode(boolean implicitHydrogenMode)
Sets implicit hydrogen mode.void
setMultiplets(chemaxon.calculations.nmr.Multiplet[] multiplets)
SetsMultiplet
array of the spectrum.void
setName(String name)
Sets the name of the NMR spectrumvoid
setNumberOfNMRActiveNuclei(int numberOfNMRActiveNuclei)
Sets number of the NMR active nuclei.void
setShifts(Shift[] shifts)
Sets chemical shifts.void
setUnit(NMRSpectrum.Unit unit)
Sets the unit type.
-
-
-
Constructor Detail
-
NMRSpectrum
public NMRSpectrum(Molecule mol)
Constructor. Default nucleus setting is 13C NMR.- Parameters:
mol
- Input molecule, needs to be explicitly hydrogenized in case of 1H NMR.
-
NMRSpectrum
public NMRSpectrum(Molecule mol, NMRSpectrum.Nucleus nucleusType)
Constructor.- Parameters:
mol
- Input molecule, needs to be explicitly hydrogenized in case of 1H NMR.nucleusType
-NMRSpectrum.Nucleus
-
-
Method Detail
-
getMolecule
public Molecule getMolecule()
Returns the molecule under examination.- Returns:
- Molecule under examination.
-
getStrictMolecule
protected Molecule getStrictMolecule()
-
getNumberOfNMRActiveNuclei
public int getNumberOfNMRActiveNuclei()
Returns number of the NMR active nuclei.- Returns:
- Number of NMR active nuclei.
-
setNumberOfNMRActiveNuclei
public void setNumberOfNMRActiveNuclei(int numberOfNMRActiveNuclei)
Sets number of the NMR active nuclei.- Parameters:
numberOfNMRActiveNuclei
- Number of NMR active nuclei.
-
getShifts
public Shift[] getShifts()
Returns chemical shifts.- Returns:
- Array of chemical shifts.
-
setShifts
public void setShifts(Shift[] shifts)
Sets chemical shifts.- Parameters:
shifts
- Array of chemical shifts.
-
getAtomIndexes
public List<Integer> getAtomIndexes()
Returns the atom indices of the NMR active nuclei.- Returns:
- Atom indices.
-
getCouplingConstants
public double[][] getCouplingConstants()
Returns coupling constants.- Returns:
- Array of coupling constants.
-
getCouplingConstants
public double[][] getCouplingConstants(NMRSpectrum.Unit unit)
Returns coupling constants in the given unit.- Parameters:
unit
- Unit requested.- Returns:
- Coupling constant array in the requested unit.
-
setCouplingConstants
public void setCouplingConstants(double[][] couplingConstants)
Sets coupling constants.- Parameters:
couplingConstants
- Array of coupling constants.
-
getNucleusType
public NMRSpectrum.Nucleus getNucleusType()
Returns the type of the nucleus under examination.- Returns:
NMRSpectrum.Nucleus
.
-
getNucleusString
public String getNucleusString()
Returns the nucleus type string.- Returns:
- Nucleus type string.
-
isImplicitHydrogenMode
public boolean isImplicitHydrogenMode()
Returns implicit hydrogen mode.- Returns:
- Returns true if implicit hydrogen mode is used.
-
setImplicitHydrogenMode
public void setImplicitHydrogenMode(boolean implicitHydrogenMode)
Sets implicit hydrogen mode.- Parameters:
implicitHydrogenMode
- True if implicit hydrogen mode is needed.
-
getFrequency
public double getFrequency()
Returns the NMR measurement frequency in MHz unit.- Returns:
- NMR frequency.
-
setFrequency
public void setFrequency(double frequency)
Sets the NMR measurement frequency. Frequency should be given in MHz unit.- Parameters:
frequency
- NMR frequency.
-
getHalfWidth
public double getHalfWidth()
Returns NMR half-width.- Returns:
- NMR half-width.
-
setHalfWidth
public void setHalfWidth(double halfWidth)
Sets NMR half-width.- Parameters:
halfWidth
- NMR half-width.
-
getUnit
public NMRSpectrum.Unit getUnit()
Returns the unit type.- Returns:
NMRSpectrum.Unit
-
setUnit
public void setUnit(NMRSpectrum.Unit unit)
Sets the unit type.- Parameters:
unit
-NMRSpectrum.Unit
-
isCouplingNeeded
public boolean isCouplingNeeded()
Returns whether spin-spin couplings are taken into account.- Returns:
- True if spin-spin couplings are taken into account.
-
setCouplingNeeded
public void setCouplingNeeded(boolean couplingNeeded)
Sets whether spin-spin couplings are taken into account.- Parameters:
couplingNeeded
- True if spin-spin couplings are taken into account.
-
getMeaningfulFrequencies
public static double[] getMeaningfulFrequencies()
Returns the array of meaningful NMR measurement frequencies in MHz.- Returns:
- NMR measurement frequency array.
-
getLocalMaximumPlaces
public double[] getLocalMaximumPlaces()
- Specified by:
getLocalMaximumPlaces
in interfacechemaxon.calculations.nmr.Spectrum
-
getDomainMin
public double getDomainMin()
Returns the lower end of the spectrum.- Returns:
- Lower end of the spectrum.
-
setDomainMin
public void setDomainMin(double domainMin)
Sets the lower end of the spectrum.- Parameters:
domainMin
- Lower end of the spectrum.
-
getDomainMax
public double getDomainMax()
Returns the upper end of the spectrum.- Returns:
- Upper end of the spectrum.
-
setDomainMax
public void setDomainMax(double domainMax)
Sets the upper end of the spectrum.- Parameters:
domainMax
- Upper end of the spectrum.
-
getName
public String getName()
Returns the name of the NMR spectrum.- Returns:
- spectrum name
-
setName
public void setName(String name)
Sets the name of the NMR spectrum- Parameters:
name
-
-
getValueAt
public double getValueAt(double location)
Returns the value of the NMR spectrum function at a given x point.- Parameters:
location
- x value where the function is evaluated.- Returns:
- Value of the NMR spectrum function at a given point.
-
getRawValueAt
public double getRawValueAt(double location)
Returns the value of the unscaled NMR spectrum function at a given x point.- Parameters:
location
- x value where the function is evaluated.- Returns:
- Value of the unscaled NMR spectrum function at a given point.
-
getIntegralValueAt
public double getIntegralValueAt(double location)
Returns the value of the NMR integral function at a given x point.- Parameters:
location
- x value where the function is evaluated.- Returns:
- Value of the NMR integral function at a given point.
-
getMultiplets
public chemaxon.calculations.nmr.Multiplet[] getMultiplets()
- Specified by:
getMultiplets
in interfacechemaxon.calculations.nmr.Spectrum
-
setMultiplets
public void setMultiplets(chemaxon.calculations.nmr.Multiplet[] multiplets)
SetsMultiplet
array of the spectrum.- Parameters:
multiplets
- NewMultiplet
array.
-
getDefaultValue
public double getDefaultValue()
- Specified by:
getDefaultValue
in interfacechemaxon.calculations.nmr.Spectrum
-
getRangeMax
public double getRangeMax()
Maximal y value of the NMR spectrum function.- Returns:
- Maximal y value.
-
getRangeMin
public double getRangeMin()
Minimal y value of the NMR spectrum function.- Returns:
- Minimal y value.
-
computeFunctionScale
public void computeFunctionScale()
Computes the scaling factor for the unscaled NMR spectrum function. As a result the maxima of the spectrum and integral functions are the same and correspond to the number of NMR active nuclei.
-
computeFunctionScale
protected void computeFunctionScale(double aimedMaxValue, double[] places)
-
getFunctionScale
protected double getFunctionScale()
-
-