mailr5035 - in /1.3: generic_fns/structure.py physical_constants.py


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by edward on February 20, 2008 - 09:31:
Author: bugman
Date: Wed Feb 20 09:31:00 2008
New Revision: 5035

URL: http://svn.gna.org/viewcvs/relax?rev=5035&view=rev
Log:
Shifted all the relative atomic mass values into the physical_constants 
module.


Modified:
    1.3/generic_fns/structure.py
    1.3/physical_constants.py

Modified: 1.3/generic_fns/structure.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/generic_fns/structure.py?rev=5035&r1=5034&r2=5035&view=diff
==============================================================================
--- 1.3/generic_fns/structure.py (original)
+++ 1.3/generic_fns/structure.py Wed Feb 20 09:31:00 2008
@@ -34,6 +34,7 @@
 from generic_fns import molmol
 from generic_fns.sequence import load_PDB_sequence
 from generic_fns.selection import exists_mol_res_spin_data, return_molecule, 
return_residue, return_spin, spin_loop
+from physical_constants import ArH, ArC, ArN, ArO, ArS
 from relax_errors import RelaxError, RelaxFileError, RelaxNoPdbChainError, 
RelaxNoPdbError, RelaxNoResError, RelaxNoPipeError, RelaxNoSequenceError, 
RelaxNoTensorError, RelaxNoVectorsError, RelaxPdbError, RelaxPdbLoadError, 
RelaxRegExpError
 from relax_io import get_file_path
 from relax_warnings import RelaxNoAtomWarning, RelaxNoPDBFileWarning, 
RelaxWarning, RelaxZeroVectorWarning
@@ -159,23 +160,23 @@
 
     # Proton.
     if element == 'H' or element == 'Q':
-        return 1.00794
+        return ArH
 
     # Carbon.
     elif element == 'C':
-        return 12.0107
+        return ArC
 
     # Nitrogen.
     elif element == 'N':
-        return 14.0067
+        return ArN
 
     # Oxygen.
     elif element == 'O':
-        return 15.9994
+        return ArO
 
     # Sulphur.
     elif element == 'S':
-        return 32.065
+        return ArS
 
     # Unknown.
     else:

Modified: 1.3/physical_constants.py
URL: 
http://svn.gna.org/viewcvs/relax/1.3/physical_constants.py?rev=5035&r1=5034&r2=5035&view=diff
==============================================================================
--- 1.3/physical_constants.py (original)
+++ 1.3/physical_constants.py Wed Feb 20 09:31:00 2008
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2007 Edward d'Auvergne                                       
 #
+# Copyright (C) 2007-2008 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax.                                    
 #
 #                                                                            
 #
@@ -24,6 +24,9 @@
 from math import pi
 
 
+# Misc. constants.
+##################
+
 # Planck's constant.
 h = 6.62606876 * 1e-34
 
@@ -33,12 +36,19 @@
 # The magnetic constant or the permeability of vacuum.
 mu0 = 4.0 * pi * 1e-7
 
+
+# CSA and bond lengths.
+#######################
+
 # The 15N CSA in the NH bond (default value).
 N15_CSA = -172 * 1e-6
 
 # The length of the NH bond (default value).
 NH_BOND_LENGTH = 1.02 * 1e-10
 
+
+# Gyromagnetic ratios.
+######################
 
 # The 13C gyromagnetic ratio.
 g13C = 6.728 * 1e7
@@ -54,3 +64,22 @@
 
 # The 31P gyromagnetic ratio.
 g31P = 10.841 * 1e7
+
+
+# Relative atomic masses.
+#########################
+
+# Proton.
+ArH = 1.00794
+
+# Carbon.
+ArC = 12.0107
+
+# Nitrogen.
+ArN = 14.0067
+
+# Oxygen.
+ArO = 15.9994
+
+# Sulphur.
+ArS = 32.065




Related Messages


Powered by MHonArc, Updated Wed Feb 20 09:40:37 2008