summaryrefslogtreecommitdiff
path: root/gr-radio-astronomy/src/python/ra_fftsink.py
diff options
context:
space:
mode:
authormleech2006-10-04 14:36:13 +0000
committermleech2006-10-04 14:36:13 +0000
commitc7be5804b32bcf19739297b04f3d811bee1a47fb (patch)
tree2d1d5f6f91a19e45534095cb26e3daea30d49e45 /gr-radio-astronomy/src/python/ra_fftsink.py
parent58d96ee6c7c8992eaf9659668cc70530ef2f3171 (diff)
downloadgnuradio-c7be5804b32bcf19739297b04f3d811bee1a47fb.tar.gz
gnuradio-c7be5804b32bcf19739297b04f3d811bee1a47fb.tar.bz2
gnuradio-c7be5804b32bcf19739297b04f3d811bee1a47fb.zip
Changed data logging significantly, in that for continuum data, the data
logging is more directly plugged into the signal-processing chain, rather than being a side-effect of plotting. For spectral data, had it copy spectral bins into a data buffer that gets dumped once per second in the UI, same as continuum data. Added --calib_coeff and --calib_offset command-line parameters to scale the output of the continuum detector. git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@3706 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'gr-radio-astronomy/src/python/ra_fftsink.py')
-rwxr-xr-xgr-radio-astronomy/src/python/ra_fftsink.py36
1 files changed, 14 insertions, 22 deletions
diff --git a/gr-radio-astronomy/src/python/ra_fftsink.py b/gr-radio-astronomy/src/python/ra_fftsink.py
index 928f501aa..ccfcc46bc 100755
--- a/gr-radio-astronomy/src/python/ra_fftsink.py
+++ b/gr-radio-astronomy/src/python/ra_fftsink.py
@@ -32,14 +32,11 @@ import random
default_ra_fftsink_size = (640,140)
-def default_cfunc(db,l):
- return(db)
-
class ra_fft_sink_base(object):
def __init__(self, input_is_real=False, baseband_freq=0, y_per_div=10, sc_y_per_div=0.5, ref_level=50, sc_ref_level=20,
sample_rate=1, fft_size=512, fft_rate=15,
- average=False, avg_alpha=None, title='', peak_hold=False, cfunc=default_cfunc, xydfunc=None, interfunc=None):
+ average=False, avg_alpha=None, title='', peak_hold=False, ofunc=None, xydfunc=None):
# initialize common attributes
self.baseband_freq = baseband_freq
@@ -54,9 +51,9 @@ class ra_fft_sink_base(object):
self.fft_rate = fft_rate
self.binwidth = float(sample_rate/fft_size)
self.average = average
- self.cfunc = cfunc
+ self.ofunc = ofunc
self.xydfunc = xydfunc
- self.interfunc = interfunc
+ self.ofunc = ofunc
if avg_alpha is None:
self.avg_alpha = 2.0 / fft_rate
else:
@@ -99,18 +96,18 @@ class ra_fft_sink_base(object):
class ra_fft_sink_f(gr.hier_block, ra_fft_sink_base):
def __init__(self, fg, parent, baseband_freq=0,
- y_per_div=10, sc_y_per_div=0.5, sc_ref_level=40, ref_level=50, sample_rate=1, fft_size=512,
+ y_per_div=10, sc_y_per_div=0.5, sc_ref_level=40, ref_level=50, sample_rate=1, fft_size=512,
fft_rate=15, average=False, avg_alpha=None, title='',
- size=default_ra_fftsink_size, peak_hold=False, cfunc=default_cfunc, xydfunc=None, interfunc=None):
-
+ size=default_ra_fftsink_size, peak_hold=False, ofunc=None,
+ xydfunc=None):
ra_fft_sink_base.__init__(self, input_is_real=True, baseband_freq=baseband_freq,
y_per_div=y_per_div, sc_y_per_div=sc_y_per_div,
sc_ref_level=sc_ref_level, ref_level=ref_level,
sample_rate=sample_rate, fft_size=fft_size,
fft_rate=fft_rate,
average=average, avg_alpha=avg_alpha, title=title,
- peak_hold=peak_hold, cfunc=cfunc,
- xydfunc=xydfunc, interfunc=interfunc)
+ peak_hold=peak_hold, ofunc=ofunc,
+ xydfunc=xydfunc)
self.binwidth = float(sample_rate/2.0)/float(fft_size)
s2p = gr.serial_to_parallel(gr.sizeof_float, fft_size)
@@ -134,7 +131,7 @@ class ra_fft_sink_c(gr.hier_block, ra_fft_sink_base):
y_per_div=10, sc_y_per_div=0.5, sc_ref_level=40,
ref_level=50, sample_rate=1, fft_size=512,
fft_rate=15, average=False, avg_alpha=None, title='',
- size=default_ra_fftsink_size, peak_hold=False, cfunc=default_cfunc, xydfunc=None, interfunc=None):
+ size=default_ra_fftsink_size, peak_hold=False, ofunc=None, xydfunc=None):
ra_fft_sink_base.__init__(self, input_is_real=False, baseband_freq=baseband_freq,
y_per_div=y_per_div, sc_y_per_div=sc_y_per_div,
@@ -143,8 +140,8 @@ class ra_fft_sink_c(gr.hier_block, ra_fft_sink_base):
fft_rate=fft_rate,
average=average, avg_alpha=avg_alpha,
title=title,
- peak_hold=peak_hold, cfunc=cfunc,
- xydfunc=xydfunc, interfunc=interfunc)
+ peak_hold=peak_hold, ofunc=ofunc,
+ xydfunc=xydfunc)
s2p = gr.serial_to_parallel(gr.sizeof_gr_complex, fft_size)
one_in_n = gr.keep_one_in_n(gr.sizeof_gr_complex * fft_size,
@@ -230,7 +227,6 @@ class fft_window (plot.PlotCanvas):
wx.EVT_CLOSE (self, self.on_close_window)
self.Bind(wx.EVT_RIGHT_UP, self.on_right_click)
self.Bind(wx.EVT_MOTION, self.on_motion)
- self.Bind(wx.EVT_LEFT_UP, self.on_left_click)
self.input_watcher = input_watcher(ra_fftsink.msgq, ra_fftsink.fft_size, self)
@@ -248,9 +244,10 @@ class fft_window (plot.PlotCanvas):
calc_min = min(dB)
calc_max = max(dB)
-
- dB = self.ra_fftsink.cfunc(dB, L)
+ if (self.ra_fftsink.ofunc != None):
+ self.ra_fftsink.ofunc(evt.data,L)
+
if self.peak_hold:
if self.peak_vals is None:
self.peak_vals = dB
@@ -366,11 +363,6 @@ class fft_window (plot.PlotCanvas):
xy = self.GetXY(event)
self.ra_fftsink.xydfunc (xy)
- def on_left_click(self, event):
- if not self.ra_fftsink.interfunc == None:
- xy = self.GetXY(event)
- self.ra_fftsink.interfunc (xy[0])
-
def build_popup_menu(self):
self.id_incr_ref_level = wx.NewId()
self.id_decr_ref_level = wx.NewId()