chemaxon.calculations.nmr
Class NMRSpectrum

java.lang.Object
  extended by chemaxon.calculations.nmr.NMRSpectrum
All Implemented Interfaces:
chemaxon.calculations.nmr.Spectrum

public class NMRSpectrum
extends java.lang.Object
implements chemaxon.calculations.nmr.Spectrum

Class for the representation of NMR spectra.

Since:
5.7
Author:
Csaba Fábri, Imre Barna

Nested Class Summary
static class NMRSpectrum.Nucleus
          Nucleus enumeration type.
static class NMRSpectrum.Unit
          Unit enumeration type.
 
Field Summary
protected  double functionScale
          Scale factor for NMR spectrum function scaling.
 
Constructor Summary
NMRSpectrum(Molecule mol)
          Constructor.
NMRSpectrum(Molecule mol, NMRSpectrum.Nucleus nucleusType)
          Constructor.
 
Method Summary
 void computeFunctionScale()
          Computes the scaling factor for the unscaled NMR spectrum function.
protected  void computeFunctionScale(double aimedMaxValue, double[] places)
           
 java.util.List<java.lang.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()
          The default value of the function.
 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()
          Gets the locations (elements of domain) of the local maximums of the function.
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()
          Gets the multiplets of the function.
 java.lang.String getName()
          Returns the name of the NMR spectrum.
 java.lang.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.
 chemaxon.calculations.nmr.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)
          Sets Multiplet array of the spectrum.
 void setName(java.lang.String name)
          Sets the name of the NMR spectrum
 void setNumberOfNMRActiveNuclei(int numberOfNMRActiveNuclei)
          Sets number of the NMR active nuclei.
 void setShifts(chemaxon.calculations.nmr.Shift[] shifts)
          Sets chemical shifts.
 void setUnit(NMRSpectrum.Unit unit)
          Sets the unit type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

functionScale

protected double functionScale
Scale factor for NMR spectrum function scaling.

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 chemaxon.calculations.nmr.Shift[] getShifts()
Returns chemical shifts.

Returns:
Array of chemical shifts.

setShifts

public void setShifts(chemaxon.calculations.nmr.Shift[] shifts)
Sets chemical shifts.

Parameters:
shifts - Array of chemical shifts.

getAtomIndexes

public java.util.List<java.lang.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 java.lang.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()
Description copied from interface: chemaxon.calculations.nmr.Spectrum
Gets the locations (elements of domain) of the local maximums of the function.

Specified by:
getLocalMaximumPlaces in interface chemaxon.calculations.nmr.Spectrum
Returns:
the locations (elements of domain) of the local maximums of the function.

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 java.lang.String getName()
Returns the name of the NMR spectrum.

Returns:
spectrum name

setName

public void setName(java.lang.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()
Description copied from interface: chemaxon.calculations.nmr.Spectrum
Gets the multiplets of the function.

Specified by:
getMultiplets in interface chemaxon.calculations.nmr.Spectrum
Returns:
the multiplets of the function.

setMultiplets

public void setMultiplets(chemaxon.calculations.nmr.Multiplet[] multiplets)
Sets Multiplet array of the spectrum.

Parameters:
multiplets - New Multiplet array.

getDefaultValue

public double getDefaultValue()
Description copied from interface: chemaxon.calculations.nmr.Spectrum
The default value of the function.

Specified by:
getDefaultValue in interface chemaxon.calculations.nmr.Spectrum
Returns:
default value of the function.

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()