Class 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
    • 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.
    • 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.
      • 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.
      • 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 interface chemaxon.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 interface chemaxon.calculations.nmr.Spectrum
      • setMultiplets

        public void setMultiplets​(chemaxon.calculations.nmr.Multiplet[] multiplets)
        Sets Multiplet array of the spectrum.
        Parameters:
        multiplets - New Multiplet array.
      • getDefaultValue

        public double getDefaultValue()
        Specified by:
        getDefaultValue in interface chemaxon.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()