fixed 2 scaling bugs in scopesink
authorjblum <jblum@221aa14e-8319-0410-a670-987f0aec2ac5>
Wed, 28 Jan 2009 19:52:45 +0000 (19:52 +0000)
committerjblum <jblum@221aa14e-8319-0410-a670-987f0aec2ac5>
Wed, 28 Jan 2009 19:52:45 +0000 (19:52 +0000)
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@10329 221aa14e-8319-0410-a670-987f0aec2ac5

gr-wxgui/src/python/common.py
gr-wxgui/src/python/scope_window.py

index f31e1a7085aac9983889668c2c8a72496815f464..e7d08891d36b9e1224bd6d9fc0f100d8f05c4c53 100644 (file)
@@ -259,7 +259,7 @@ def get_min_max(samples):
        """
        scale_factor = 3
        mean = numpy.average(samples)
-       rms = scale_factor*((numpy.sum((samples-mean)**2)/len(samples))**.5)
+       rms = numpy.max([scale_factor*((numpy.sum((samples-mean)**2)/len(samples))**.5), .1])
        min = mean - rms
        max = mean + rms
        return min, max
index 57905ca4d54aadfa00b0285c1806fc51bce0353a..7d4f97113e12b5fbf7a8db5e5a528c8dc8346fa5 100644 (file)
@@ -411,8 +411,8 @@ class scope_window(wx.Panel, pubsub.pubsub, common.prop_setter):
                        #autorange
                        if self[AUTORANGE_KEY] and time.time() - self.autorange_ts > AUTORANGE_UPDATE_RATE:
                                bounds = [common.get_min_max(samples) for samples in sampleses]
-                               y_min = numpy.min(*[bound[0] for bound in bounds])
-                               y_max = numpy.max(*[bound[1] for bound in bounds])
+                               y_min = numpy.min([bound[0] for bound in bounds])
+                               y_max = numpy.max([bound[1] for bound in bounds])
                                #adjust the y per div
                                y_per_div = common.get_clean_num((y_max-y_min)/self[Y_DIVS_KEY])
                                if y_per_div != self[Y_PER_DIV_KEY]: self.set_y_per_div(y_per_div)