changeset 32:660a2997e720

Don't put timestamp_hex & _dec in the data file. Add fstart_mhz & fstop_mhz to format dict.
author Daniel O'Connor <darius@dons.net.au>
date Wed, 21 Sep 2011 15:34:23 +0930
parents c6c86dcb54ba
children e80c2ff5fa87
files sitesurvey.py
diffstat 1 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/sitesurvey.py	Wed Sep 21 15:00:24 2011 +0930
+++ b/sitesurvey.py	Wed Sep 21 15:34:23 2011 +0930
@@ -154,6 +154,7 @@
     return xaxis, yaxis, rconf
 
 def savesweep(fname, exp, x, y):
+    print " Saving to " + fname
     f = open(fname, 'wb')
     for k in exp:
         f.write("%s %s\n" % (k.upper(), str(exp[k])))
@@ -254,12 +255,17 @@
         tsepoch = calendar.timegm(exp.last_run.utctimetuple())
         
         extras = { 'timestamp' : exp.last_run,
-                   'timestamp_hex' : '%08x' % (tsepoch),
-                   'timestamp_dec' : '%d' % (tsepoch),
                    'tag' : exp.name,
                    }
         opts = dict(opts.items() + extras.items())
-        fname = fnamefmt % opts
+
+        fmtextras = { 'timestamp_hex' : '%08x' % (tsepoch),
+                      'timestamp_dec' : '%d' % (tsepoch),
+                      'fstart_mhz' : '%.1f' % (float(opts['fstart']) / 1e6),
+                      'fstop_mhz' : '%.1f' % (float(opts['fstop']) / 1e6),
+            }
+        fmtopts = dict(opts.items() + fmtextras.items())
+        fname = fnamefmt % fmtopts
 
         # Save data
         savesweep(fname, opts, freqs, power)