mailr19708 - /trunk/pipe_control/spectrometer.py


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

Header


Content

Posted by edward on May 23, 2013 - 19:11:
Author: bugman
Date: Thu May 23 19:11:08 2013
New Revision: 19708

URL: http://svn.gna.org/viewcvs/relax?rev=19708&view=rev
Log:
Modified the spectrometer.frequency user function so that a frequency list 
and count is stored.

These are the new cdp.spectrometer_frq_list and cdp.spectrometer_frq_count 
variables.  This will
allow various parts of relax which assemble frequency information to be 
simplified and made more
consistent.


Modified:
    trunk/pipe_control/spectrometer.py

Modified: trunk/pipe_control/spectrometer.py
URL: 
http://svn.gna.org/viewcvs/relax/trunk/pipe_control/spectrometer.py?rev=19708&r1=19707&r2=19708&view=diff
==============================================================================
--- trunk/pipe_control/spectrometer.py (original)
+++ trunk/pipe_control/spectrometer.py Thu May 23 19:11:08 2013
@@ -45,9 +45,11 @@
     # Test if the current data pipe exists.
     pipes.test()
 
-    # Set up the dictionary data structure if it doesn't exist yet.
+    # Set up the data structures if missing.
     if not hasattr(cdp, 'spectrometer_frq'):
         cdp.spectrometer_frq = {}
+        cdp.spectrometer_frq_list = []
+        cdp.spectrometer_frq_count = 0
 
     # Test the frequency has not already been set.
     if id in cdp.spectrometer_frq and cdp.spectrometer_frq[id] != frq:
@@ -73,6 +75,11 @@
         warn(RelaxWarning("The proton frequency of %s Hz appears to be too 
low." % cdp.spectrometer_frq[id]))
     if cdp.spectrometer_frq[id] > 2e9:
         warn(RelaxWarning("The proton frequency of %s Hz appears to be too 
high." % cdp.spectrometer_frq[id]))
+
+    # New frequency.
+    if cdp.spectrometer_frq[id] not in cdp.spectrometer_frq_list:
+        cdp.spectrometer_frq_list.append(cdp.spectrometer_frq[id])
+        cdp.spectrometer_frq_count += 1
 
 
 def get_frequencies():




Related Messages


Powered by MHonArc, Updated Thu May 23 19:20:02 2013