mailr18058 - in /branches/relax_disp: ./ generic_fns/frq.py generic_fns/rdc.py generic_fns/temperature.py


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

Header


Content

Posted by edward on November 30, 2012 - 14:06:
Author: bugman
Date: Fri Nov 30 14:06:43 2012
New Revision: 18058

URL: http://svn.gna.org/viewcvs/relax?rev=18058&view=rev
Log:
Merged revisions 18053-18055 via svnmerge from 
svn+ssh://bugman@xxxxxxxxxxx/svn/relax/trunk

........
  r18053 | bugman | 2012-11-30 13:06:46 +0100 (Fri, 30 Nov 2012) | 3 lines
  
  Modified the temperature user function - the value can be set twice if it 
is the same value.
........
  r18054 | bugman | 2012-11-30 13:09:13 +0100 (Fri, 30 Nov 2012) | 3 lines
  
  Modified the frq.set user function - the value can be set twice if it is 
the same value.
........
  r18055 | bugman | 2012-11-30 14:00:58 +0100 (Fri, 30 Nov 2012) | 3 lines
  
  The rdc.back_calc user function now handles absolute RDCs.
........

Modified:
    branches/relax_disp/   (props changed)
    branches/relax_disp/generic_fns/frq.py
    branches/relax_disp/generic_fns/rdc.py
    branches/relax_disp/generic_fns/temperature.py

Propchange: branches/relax_disp/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri Nov 30 14:06:43 2012
@@ -1,1 +1,1 @@
-/trunk:1-18048
+/trunk:1-18055

Modified: branches/relax_disp/generic_fns/frq.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/generic_fns/frq.py?rev=18058&r1=18057&r2=18058&view=diff
==============================================================================
--- branches/relax_disp/generic_fns/frq.py (original)
+++ branches/relax_disp/generic_fns/frq.py Fri Nov 30 14:06:43 2012
@@ -54,8 +54,7 @@
 def set(id=None, frq=None):
     """Set the spectrometer frequency of the experiment.
 
-    @keyword id:    The experimental identification string (allowing for 
multiple experiments per
-                    data pipe).
+    @keyword id:    The experimental identification string (allowing for 
multiple experiments per data pipe).
     @type id:       str
     @keyword frq:   The spectrometer frequency in Hertz.
     @type frq:      float
@@ -69,8 +68,8 @@
         cdp.frq = {}
 
     # Test the frequency has not already been set.
-    if id in cdp.frq:
-        raise RelaxError("The frequency for the experiment " + repr(id) + " 
has already been set.")
+    if id in cdp.frq and cdp.frq[id] != frq:
+        raise RelaxError("The frequency for the experiment '%s' has already 
been set to %s Hz." % (id, cdp.frq[id]))
 
     # Set the frequency.
     cdp.frq[id] = frq

Modified: branches/relax_disp/generic_fns/rdc.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/generic_fns/rdc.py?rev=18058&r1=18057&r2=18058&view=diff
==============================================================================
--- branches/relax_disp/generic_fns/rdc.py (original)
+++ branches/relax_disp/generic_fns/rdc.py Fri Nov 30 14:06:43 2012
@@ -116,7 +116,12 @@
 
         # Calculate the RDCs.
         for id in align_ids:
+            # The signed value.
             interatom.rdc_bc[id] = ave_rdc_tensor(dj, unit_vect, cdp.N, 
cdp.align_tensors[get_tensor_index(id)].A, weights=weights)
+
+            # The absolute value.
+            if id in interatom.absolute_rdc.keys() and 
interatom.absolute_rdc[id]:
+                interatom.rdc_bc[id] = abs(interatom.rdc_bc[id])
 
 
 def convert(value, align_id, to_intern=False):

Modified: branches/relax_disp/generic_fns/temperature.py
URL: 
http://svn.gna.org/viewcvs/relax/branches/relax_disp/generic_fns/temperature.py?rev=18058&r1=18057&r2=18058&view=diff
==============================================================================
--- branches/relax_disp/generic_fns/temperature.py (original)
+++ branches/relax_disp/generic_fns/temperature.py Fri Nov 30 14:06:43 2012
@@ -1,6 +1,6 @@
 
###############################################################################
 #                                                                            
 #
-# Copyright (C) 2008-2009 Edward d'Auvergne                                  
 #
+# Copyright (C) 2008-2012 Edward d'Auvergne                                  
 #
 #                                                                            
 #
 # This file is part of the program relax (http://www.nmr-relax.com).         
 #
 #                                                                            
 #
@@ -30,8 +30,7 @@
 def set(id=None, temp=None):
     """Set the experimental temperature.
 
-    @keyword id:    The experimental identification string (allowing for 
multiple experiments per
-                    data pipe).
+    @keyword id:    The experimental identification string (allowing for 
multiple experiments per data pipe).
     @type id:       str
     @keyword temp:  The temperature in kelvin.
     @type temp:     float
@@ -44,9 +43,12 @@
     if not hasattr(cdp, 'temperature'):
         cdp.temperature = {}
 
+    # Convert to a float.
+    temp = float(temp)
+
     # Test the temperature has not already been set.
-    if id in cdp.temperature:
-        raise RelaxError("The temperature for the experiment " + repr(id) + 
" has already been set.")
+    if id in cdp.temperature and cdp.temperature[id] != temp:
+        raise RelaxError("The temperature for the experiment '%s' has 
already been set to %s K." % (id, cdp.temperature[id]))
 
     # Set the temperature.
-    cdp.temperature[id] = float(temp)
+    cdp.temperature[id] = temp




Related Messages


Powered by MHonArc, Updated Fri Nov 30 14:20:01 2012