# Class NMRCalculation

java.lang.Object
org.jmol.quantum.NMRCalculation

All Implemented Interfaces:
  `JmolNMRInterface`

public class NMRCalculation extends Object implements JmolNMRInterface

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`JCH3_AYDIN_GUETHER`
`static final String`
`JCH3_NONE`
`static final String`
`JCH3_TVAROSKA_TARAVEL`
`static final String`
`JCH3_WASYLISHEN_SCHAEFER`
`static final int`
`MODE_CALC_2JHH`
`static final int`
`MODE_CALC_3JCH`
`static final int`
`MODE_CALC_3JHH`
`static final int`
`MODE_CALC_ALL`
`static final int`
`MODE_CALC_INVALID`
`static final int`
`MODE_CALC_J`
`static final int`
`MODE_CALC_JHH`
`static final int`
`MODE_CALC_NOE`

## Constructor Summary

Constructors
Constructor
Description
`NMRCalculation()`

## Method Summary

Modifier and Type
Method
Description
`static double[]`
`calc2or3JorNOE(Viewer viewer, Atom[] atoms, String CHEquation, int mode)`
Calculate a 2-bond (geminal) or 3-bond (vicinal) coupling constant or an NOE;
`static double`
`calc3JCH(String CHequation, double theta, boolean is23Double)`
`static double`
`calcJKarplus(double theta)`
`static double[]`
`calcNOE(Viewer viewer, Atom atom1, Atom atom2)`
`static int`
`getCalcType(Atom[] atoms, String[] elementsToFill, int mode)`
`float`
`getChemicalShift(Atom atom)`
If shift reference has not been set, it defaults to 0 and just displays the negative of magnetic shielding
`float`
`getDipolarConstantHz(Atom a1, Atom a2)`
`float`
`getDipolarCouplingHz(Atom a1, Atom a2, V3 vField)`
`Object`
`getInfo(String what)`
`float`
`getIsoOrAnisoHz(boolean isIso, Atom a1, Atom a2, String units, Tensor isc)`
If t is null, then a1, a2, and type are used to find the appropriate tensor.
`float`
`getJCouplingHz(Atom a1, Atom a2, String type, Tensor isc)`
`float`
`getMagneticShielding(Atom atom)`
`Map<String,Integer>`
`getMinDistances(MeasurementData md)`
`double[]`
`getNOEorJHH(Atom[] atoms, int mode)`
`float`
`getQuadrupolarConstant(Tensor efg)`
Quadrupolar constant, directly proportional to Vzz and dependent on the quadrupolar moment of the isotope considered
`boolean`
`getState(SB sb)`
`Lst<Object>`
`getTensorInfo(String tensorType, String infoType, BS bs)`
`BS`
`getUniqueTensorSet(BS bsAtoms)`
An attempt to find unique atoms using tensors.
`boolean`
`setChemicalShiftReference(String element, float value)`
`JmolNMRInterface`
`setViewer(Viewer vwr)`

### Methods inherited from class Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### MODE_CALC_INVALID

public static final int MODE_CALC_INVALID

See Also:
  - Constant Field Values

### MODE_CALC_2JHH

public static final int MODE_CALC_2JHH

See Also:
  - Constant Field Values

### MODE_CALC_3JHH

public static final int MODE_CALC_3JHH

See Also:
  - Constant Field Values

### MODE_CALC_JHH

public static final int MODE_CALC_JHH

See Also:
  - Constant Field Values

### MODE_CALC_3JCH

public static final int MODE_CALC_3JCH

See Also:
  - Constant Field Values

### MODE_CALC_J

public static final int MODE_CALC_J

See Also:
  - Constant Field Values

### MODE_CALC_NOE

public static final int MODE_CALC_NOE

See Also:
  - Constant Field Values

### MODE_CALC_ALL

public static final int MODE_CALC_ALL

See Also:
  - Constant Field Values

### JCH3_NONE

public static final String JCH3_NONE

See Also:
  - Constant Field Values

### JCH3_WASYLISHEN_SCHAEFER

public static final String JCH3_WASYLISHEN_SCHAEFER

See Also:
  - Constant Field Values

### JCH3_TVAROSKA_TARAVEL

public static final String JCH3_TVAROSKA_TARAVEL

See Also:
  - Constant Field Values

### JCH3_AYDIN_GUETHER

public static final String JCH3_AYDIN_GUETHER

See Also:
  - Constant Field Values

## Constructor Details

### NMRCalculation

public NMRCalculation()

## Method Details

### setViewer

public JmolNMRInterface setViewer(Viewer vwr)

Specified by:
  `setViewer` in interface `JmolNMRInterface`

### getQuadrupolarConstant

public float getQuadrupolarConstant(Tensor efg)
Description copied from interface: `JmolNMRInterface`
Quadrupolar constant, directly proportional to Vzz and dependent on the quadrupolar moment of the isotope considered

Specified by:
  `getQuadrupolarConstant` in interface `JmolNMRInterface`
Parameters:
  `efg` -
Returns:
  float value

### getUniqueTensorSet

public BS getUniqueTensorSet(BS bsAtoms)
Description copied from interface: `JmolNMRInterface`
An attempt to find unique atoms using tensors.

Specified by:
  `getUniqueTensorSet` in interface `JmolNMRInterface`
Parameters:
  `bsAtoms` -
Returns:
  bitset of atoms

### getJCouplingHz

public float getJCouplingHz(Atom a1, Atom a2, String type, Tensor isc)

### getIsoOrAnisoHz

public float getIsoOrAnisoHz(boolean isIso, Atom a1, Atom a2, String units, Tensor isc)
Description copied from interface: `JmolNMRInterface`
If t is null, then a1, a2, and type are used to find the appropriate tensor.

Specified by:
  `getIsoOrAnisoHz` in interface `JmolNMRInterface`
Parameters:
  `isIso` -
  `a1` -
  `a2` -
  `units` -
  `isc` -
Returns:
  0 if not found

### getDipolarConstantHz

public float getDipolarConstantHz(Atom a1, Atom a2)

Specified by:
  `getDipolarConstantHz` in interface `JmolNMRInterface`
Parameters:
  `a1` -
  `a2` -
Returns:
  desired constant

### getDipolarCouplingHz

public float getDipolarCouplingHz(Atom a1, Atom a2, V3 vField)

Specified by:
  `getDipolarCouplingHz` in interface `JmolNMRInterface`
Parameters:
  `a1` -
  `a2` -
  `vField` -
Returns:
  projected value

### getInfo

public Object getInfo(String what)

Specified by:
  `getInfo` in interface `JmolNMRInterface`
Parameters:
  `what` - "C" or "14C" or "all"
Returns:
  list of double[isotopeNumber,g,Q] if no isotope number is given, or a single double[] if it does.

### getChemicalShift

public float getChemicalShift(Atom atom)
Description copied from interface: `JmolNMRInterface`
If shift reference has not been set, it defaults to 0 and just displays the negative of magnetic shielding

Specified by:
  `getChemicalShift` in interface `JmolNMRInterface`
Parameters:
  `atom` -
Returns:
  value

### getMagneticShielding

public float getMagneticShielding(Atom atom)

Specified by:
  `getMagneticShielding` in interface `JmolNMRInterface`

### getState

public boolean getState(SB sb)

Specified by:
  `getState` in interface `JmolNMRInterface`

### setChemicalShiftReference

public boolean setChemicalShiftReference(String element, float value)

Specified by:
  `setChemicalShiftReference` in interface `JmolNMRInterface`

### getTensorInfo

public Lst<Object> getTensorInfo(String tensorType, String infoType, BS bs)

Specified by:
  `getTensorInfo` in interface `JmolNMRInterface`

### getMinDistances

public Map<String,Integer> getMinDistances(MeasurementData md)

Specified by:
  `getMinDistances` in interface `JmolNMRInterface`

### calcJKarplus

public static double calcJKarplus(double theta)

### calc3JCH

public static double calc3JCH(String CHequation, double theta, boolean is23Double)

Parameters:
  `CHequation` - 'was' Simple equation for 3JCH, from Wasylishen and Schaefer Can J Chem (1973) 51 961 used in Kozerski et al. J Chem Soc Perkin 2, (1997) 1811 'tva' Tvaroska and Taravel Adv. Carbohydrate Chem. Biochem. (1995) 51, 15-61 'ayd' Aydin and Guether Mag. Res. Chem. (1990) 28, 448-457
  `theta` - dihedral
  `is23Double` -
Returns:
  3JCH prediction

### calcNOE

public static double[] calcNOE(Viewer viewer, Atom atom1, Atom atom2)

### calc2or3JorNOE

public static double[] calc2or3JorNOE(Viewer viewer, Atom[] atoms, String CHEquation, int mode)
Calculate a 2-bond (geminal) or 3-bond (vicinal) coupling constant or an NOE;

Parameters:
  `viewer` -
  `atoms` - required Atom[4]; can be just two atoms, then in atom[0] and atom[4]
  `CHEquation` - 'none' or 'was' or 'tva' or 'ayd'
  `mode` -
Returns:
  [theta, jvalue, atom2.i, atom3.i] for 3JHH; [theta, jvalue, center.i] for 2JHH; [distance, noe] for NOE

### getCalcType

public static int getCalcType(Atom[] atoms, String[] elementsToFill, int mode)

### getNOEorJHH

public double[] getNOEorJHH(Atom[] atoms, int mode)

Specified by:
  `getNOEorJHH` in interface `JmolNMRInterface`