Exemplo n.º 1
0
    def __plot(self, spectrum):
        x, y, z = create_mesh(spectrum, True)
        self.parent.clear_plots()

        if self.settings.autoL:
            vmin, vmax = self.barBase.get_clim()
        else:
            zExtent = self.extent.get_l()
            vmin = zExtent[0]
            vmax = zExtent[1]
        if self.parent.settings.wireframe:
            self.parent.plot = \
                self.axes.plot_wireframe(x, y, z,
                                         rstride=1, cstride=1,
                                         linewidth=0.1,
                                         cmap=cm.get_cmap(self.settings.colourMap),
                                         gid='plot_line',
                                         antialiased=True,
                                         alpha=1)
        else:
            self.parent.plot = \
                self.axes.plot_surface(x, y, z,
                                       rstride=1, cstride=1,
                                       vmin=vmin, vmax=vmax,
                                       linewidth=0,
                                       cmap=cm.get_cmap(self.settings.colourMap),
                                       gid='plot_line',
                                       antialiased=True,
                                       alpha=1)

        return self.extent.get_peak_flt()
Exemplo n.º 2
0
def export_freemat(handle, spectrum):
    x, y, z = create_mesh(spectrum, False)
    write_numpy(handle, x, 'x')
    write_numpy(handle, y, 'y')
    write_numpy(handle, z, 'z')
    handle.write('\n')
    handle.write('surf(x,y,z)\n')
    handle.write('view(3)\n')
    handle.write("set(gca, 'plotboxaspectratio', [3, 2, 1])\n")
    handle.write("title('RTLSDR Scan')\n")
    handle.write("xlabel('Frequency (MHz)')\n")
    handle.write("ylabel('Time')\n")
    handle.write("zlabel('Level (dB/Hz)')\n")
    handle.write("grid('on')\n")