Revision: 18432
          http://sourceforge.net/p/jmol/code/18432
Author:   hansonr
Date:     2013-07-05 14:18:59 +0000 (Fri, 05 Jul 2013)
Log Message:
-----------


Modified Paths:
--------------
    trunk/Jmol/src/org/jmol/quantum/NMRCalculation.java

Modified: trunk/Jmol/src/org/jmol/quantum/NMRCalculation.java
===================================================================
--- trunk/Jmol/src/org/jmol/quantum/NMRCalculation.java 2013-07-05 12:36:35 UTC 
(rev 18431)
+++ trunk/Jmol/src/org/jmol/quantum/NMRCalculation.java 2013-07-05 14:18:59 UTC 
(rev 18432)
@@ -235,6 +235,12 @@
     return (d == null ? 0 : d[iType]);
   }
 
+  /**
+   * Creates the data set necessary for doing NMR calculations. Values
+   * are retrievable using getProperty "nmrInfo" "Xx"; each entry is 
+   * float[+/-isotopeNumber, g, Q], where [0] < 0 for the default value.
+   * 
+   */
   private void getData() {
     BufferedReader br = null;
     boolean debugging = Logger.debugging;
@@ -277,6 +283,7 @@
               + defaultIso);
           throw new NullPointerException();
         }
+        defdata[0] = -defdata[0];
         isotopeData.put(name, defdata);
       }
       br.close();
@@ -294,7 +301,7 @@
     if (what.equals("all")) {
       Map<String, Object> map = new Hashtable<String, Object>();
       map.put("isotopes", isotopeData);
-      map.put("shiftRefsHz", shiftRefsHz);
+      map.put("shiftRefsPPM", shiftRefsPPM);
       return map;
     }
     if (Character.isDigit(what.charAt(0)))
@@ -309,10 +316,14 @@
   }
 
   public float getChemicalShift(Atom atom) {
+    float[] data = viewer.getDataFloat("property_cs");
+    if (data != null) {
+      
+    }
     float v = getMagneticShielding(atom);
     if (!Float.isNaN(v)) {
       String sym = atom.getElementSymbol();
-      Float ref = shiftRefsHz.get(sym);
+      Float ref = shiftRefsPPM.get(sym);
       v = (ref == null ? 0 : ref.floatValue()) - v;
     }
     return v;
@@ -320,14 +331,14 @@
 
   public float getMagneticShielding(Atom atom) {
     Tensor t = getAtomTensor(atom.index, "ms");
-    return (t == null ? Float.NaN : t.eigenValues[2]);
+    return (t == null ? Float.NaN : t.getIso());
   }
 
-  private Map<String, Float> shiftRefsHz = new Hashtable<String, Float>();
+  private Map<String, Float> shiftRefsPPM = new Hashtable<String, Float>();
   
   public boolean setChemicalShiftReference(String element, float value) {
     element = element.substring(0, 1).toUpperCase() + element.substring(1);
-    shiftRefsHz.put(element, Float.valueOf(value));
+    shiftRefsPPM.put(element, Float.valueOf(value));
     return true;
   }
 

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:

Build for Windows Store.

http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Jmol-commits mailing list
Jmol-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jmol-commits

Reply via email to