Logo Search packages:      
Sourcecode: cdk version File versions  Download package

void org::openscience::cdk::io::Gaussian98Reader::readNMRData ( IChemModel  model,
String  labelLine 
) throws CDKException [inline, private]

Reads a set of vibrations into ChemFrame.

Parameters:
modelDescription of the Parameter
Exceptions:
IOExceptionif an I/O error occurs Reads NMR nuclear shieldings.

Definition at line 462 of file Gaussian98Reader.java.

References org::openscience::cdk::tools::LoggingTool::debug(), org::openscience::cdk::tools::manipulator::ChemModelManipulator::getAllAtomContainers(), org::openscience::cdk::interfaces::IAtomContainer::getAtom(), org::openscience::cdk::tools::LoggingTool::info(), org::openscience::cdk::CDKConstants::ISOTROPIC_SHIELDING, and org::openscience::cdk::interfaces::IChemObject::setProperty().

                                                                                     {
      List containers = ChemModelManipulator.getAllAtomContainers(model);
      if (containers.size() == 0) {
            // nothing to store the results into
            return;
      } // otherwise insert in the first AC
      
        IAtomContainer ac = (IAtomContainer)containers.get(0);
        // Determine label for properties
        String label;
        if (labelLine.indexOf("Diamagnetic") >= 0) {
            label = "Diamagnetic Magnetic shielding (Isotropic)";
        } else if (labelLine.indexOf("Paramagnetic") >= 0) {
            label = "Paramagnetic Magnetic shielding (Isotropic)";
        } else {
            label = "Magnetic shielding (Isotropic)";
        }
        int atomIndex = 0;
        for (int i = 0; i < atomCount; ++i) {
            try {
                String line = input.readLine().trim();
                while (line.indexOf("Isotropic") < 0) {
                    if (line == null) {
                        return;
                    }
                    line = input.readLine().trim();
                }
                StringTokenizer st1 = new StringTokenizer(line);

                // Find Isotropic label
                while (st1.hasMoreTokens()) {
                    if (st1.nextToken().equals("Isotropic")) {
                        break;
                    }
                }

                // Find Isotropic value
                while (st1.hasMoreTokens()) {
                    if (st1.nextToken().equals("=")) break;
                }
                double shielding = Double.valueOf(st1.nextToken()).doubleValue();
                logger.info("Type of shielding: " + label);
                ac.getAtom(atomIndex).setProperty(CDKConstants.ISOTROPIC_SHIELDING, new Double(shielding));
                ++atomIndex;
            } catch (Exception exc) {
                logger.debug("failed to read line from gaussian98 file where I expected one.");
            }
        }
    }

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index