summaryrefslogtreecommitdiff
path: root/gr-radio-astronomy/src/python
diff options
context:
space:
mode:
authormleech2006-09-20 00:54:26 +0000
committermleech2006-09-20 00:54:26 +0000
commit48fae4e0e218abf3199f17c6e0dc80247c236a1a (patch)
tree6399d96ace472a168645c6015b688df765acb762 /gr-radio-astronomy/src/python
parentd8e3e5527331076faf43af28377c2453e428b6be (diff)
downloadgnuradio-48fae4e0e218abf3199f17c6e0dc80247c236a1a.tar.gz
gnuradio-48fae4e0e218abf3199f17c6e0dc80247c236a1a.tar.bz2
gnuradio-48fae4e0e218abf3199f17c6e0dc80247c236a1a.zip
Added more annotation data to data files, including center frequency,
bandwidth, integration time, spectral averaging, and gain. This necessitated a change to data file syntax in the last token, but the post-processing scripts have been updated to handle both old and new formats. In the old format, there was a single "annotation" token-- the current declination. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@3588 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gr-radio-astronomy/src/python')
-rwxr-xr-xgr-radio-astronomy/src/python/local_calibrator.py43
1 files changed, 37 insertions, 6 deletions
diff --git a/gr-radio-astronomy/src/python/local_calibrator.py b/gr-radio-astronomy/src/python/local_calibrator.py
index f787cef16..fe5b36c6c 100755
--- a/gr-radio-astronomy/src/python/local_calibrator.py
+++ b/gr-radio-astronomy/src/python/local_calibrator.py
@@ -63,14 +63,34 @@ def calib_numogate_ridge_observatory_total_power(data):
filenamestr = "%s/%04d%02d%02d%02d" % (pfx, foo.tm_year,
foo.tm_mon, foo.tm_mday, foo.tm_hour)
- rainbow_file = open (filenamestr+".tpdat","a")
+ numogate_file = open (filenamestr+".tpdat","a")
r = (data / 409.6)
flt = "%6.3f" % r
#r = calib_default_total_power(data)
inter = globals()["calib_decln"]
- rainbow_file.write(str(ephem.hours(sidtime))+" "+flt+" "+str(inter)+"\n")
- rainbow_file.close()
+ integ = globals()["calib_integ_setting"]
+ fc = globals()["calib_freq_setting"]
+ fc = fc / 1000000
+ bw = globals()["calib_bw_setting"]
+ bw = bw / 1000000
+ ga = globals()["calib_gain_setting"]
+
+ now = time.time()
+
+ if not "calib_then_tpdat" in globals():
+ globals()["calib_then_tpdat"] = now
+
+ if (now - globals()["calib_then_tpdat"]) >= 10:
+ globals()["calib_then_tpdat"] = now
+
+ numogate_file.write(str(ephem.hours(sidtime))+" "+flt+" Dn="+str(inter)+",")
+ numogate_file.write("Ti="+str(integ)+",Fc="+str(fc)+",Bw="+str(bw))
+ numogate_file.write(",Ga="+str(ga)+"\n")
+ else:
+ numogate_file.write(str(ephem.hours(sidtime))+" "+flt+"\n")
+
+ numogate_file.close()
return(r)
def calib_numogate_ridge_observatory_fft(data,l):
@@ -107,12 +127,18 @@ def calib_numogate_ridge_observatory_fft(data,l):
if (now - globals()["calib_then"]) >= delta:
globals()["calib_then"] = now
- rainbow_file = open (filenamestr+".sdat","a")
+ numogate_file = open (filenamestr+".sdat","a")
r = calib_default_fft(data,l)
inter = globals()["calib_decln"]
- rainbow_file.write("data:"+str(ephem.hours(sidtime))+" "+str(inter)+" "+str(r)+"\n")
- rainbow_file.close()
+ fc = globals()["calib_freq_setting"]
+ fc = fc / 1000000
+ bw = globals()["calib_bw_setting"]
+ bw = bw / 1000000
+ av = globals()["calib_avg_alpha"]
+ numogate_file.write("data:"+str(ephem.hours(sidtime))+" Dn="+str(inter)+",Fc="+str(fc)+",Bw="+str(bw)+",Av="+str(av))
+ numogate_file.write(" "+str(r)+"\n")
+ numogate_file.close()
return(r)
return(data)
@@ -127,15 +153,19 @@ def calib_default_fft(db,l):
#
def calib_set_gain(gain):
globals()["calib_gain_setting"] = gain
+ globals()["calib_then_tpdat"] = time.time() - 50
def calib_set_integ(integ):
globals()["calib_integ_setting"] = integ
+ globals()["calib_then_tpdat"] = time.time() - 50
def calib_set_bw(bw):
globals()["calib_bw_setting"] = bw
+ globals()["calib_then_tpdat"] = time.time() - 50
def calib_set_freq(freq):
globals()["calib_freq_setting"] = freq
+ globals()["calib_then_tpdat"] = time.time() - 50
def calib_set_avg_alpha(alpha):
globals()["calib_avg_alpha"] = alpha
@@ -145,6 +175,7 @@ def calib_set_interesting(inter):
def calib_set_decln(dec):
globals()["calib_decln"] = dec
+ globals()["calib_then_tpdat"] = time.time() - 50
def calib_set_prefix(pfx):
globals()["calib_prefix"] = pfx