# HG changeset patch # User Daniel O'Connor # Date 1316585063 -34200 # Node ID 660a2997e7209f5e2ed51f0930cf4d3a17acf633 # Parent c6c86dcb54ba6e1cdbc6cf761330bb61cd3454d2 Don't put timestamp_hex & _dec in the data file. Add fstart_mhz & fstop_mhz to format dict. diff -r c6c86dcb54ba -r 660a2997e720 sitesurvey.py --- 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)