Ejemplo n.º 1
0
def psd_plot(station):
    ppsd = PPSD.load("/home/richter/Results/IPOC/PPSD/ppsd_%s_6h.pkl.bz2" %
                     station)
    ppsd.plot(show=False,
              show_coverage=False,
              show_percentiles=True,
              period_lim=(0.05, 1000),
              max_percentage=10)
    fig = mpl.pyplot.figure(1)
    ax = fig.axes[0]
    ax.set_ylim((-200, -50))
    ax.set_xticklabels(['%s' % t for t in ax.get_xticks()])
    ax.set_xlabel('period (s)')
    ax.set_ylabel('amplitude (dB)')
    col = ax.collections[0]
    bbox = col.colorbar.ax.get_position()
    fig.delaxes(col.colorbar.ax)
    if COLORBAR:
        fig.colorbar(col,
                     cax=fig.add_axes(
                         [bbox.x0 + 0.1, bbox.y0, bbox.width, bbox.height]),
                     extend='max')
        #col.colorbar.set_ticks(range(8))
        col.colorbar.set_label('probability (%)')
    bbox = ax.get_position()
    ax.set_position(
        [bbox.x0, bbox.y0, bbox.width + 0.2 - 0.1 * COLORBAR, bbox.height])
    fig.savefig("/home/richter/Results/IPOC/PPSD/ppsd_%s_6h_cb.png" % station,
                dpi=150,
                bbox_inches='tight')
    mpl.pyplot.close()
Ejemplo n.º 2
0
def correct_sensitivity(station):
    ppsd = PPSD.load("/home/richter/Results/IPOC/PPSD/ppsd_%s_6h_wrong_gain.pkl" % station)
    dB = 10 * np.log10(2516580000.0 / 629145000.0)
    if station == 'PB14':
        dB = 10 * np.log10(588000000.0 / 629145000.0)
    ppsd.spec_bins = ppsd.spec_bins - dB
    ppsd.yedges = ppsd.yedges - dB
    ppsd.save("/home/richter/Results/IPOC/PPSD/ppsd_%s_6h.pkl" % station)
Ejemplo n.º 3
0
def correct_sensitivity(station):
    ppsd = PPSD.load(
        "/home/richter/Results/IPOC/PPSD/ppsd_%s_6h_wrong_gain.pkl" % station)
    dB = 10 * np.log10(2516580000.0 / 629145000.0)
    if station == 'PB14':
        dB = 10 * np.log10(588000000.0 / 629145000.0)
    ppsd.spec_bins = ppsd.spec_bins - dB
    ppsd.yedges = ppsd.yedges - dB
    ppsd.save("/home/richter/Results/IPOC/PPSD/ppsd_%s_6h.pkl" % station)
Ejemplo n.º 4
0
def psd_plot(station):
    ppsd = PPSD.load("/home/richter/Results/IPOC/PPSD/ppsd_%s_6h.pkl.bz2" % station)
    ppsd.plot(show=False, show_coverage=False, show_percentiles=True,
              period_lim=(0.05, 1000), max_percentage=10)
    fig = mpl.pyplot.figure(1)
    ax = fig.axes[0]
    ax.set_ylim((-200, -50))
    ax.set_xticklabels(['%s' % t for t in ax.get_xticks()])
    ax.set_xlabel('period (s)')
    ax.set_ylabel('amplitude (dB)')
    col = ax.collections[0]
    bbox = col.colorbar.ax.get_position()
    fig.delaxes(col.colorbar.ax)
    if COLORBAR:
        fig.colorbar(col, cax=fig.add_axes([bbox.x0 + 0.1, bbox.y0, bbox.width, bbox.height]),
                     extend='max')
        #col.colorbar.set_ticks(range(8))
        col.colorbar.set_label('probability (%)')
    bbox = ax.get_position()
    ax.set_position([bbox.x0, bbox.y0, bbox.width + 0.2 - 0.1 * COLORBAR, bbox.height])
    fig.savefig("/home/richter/Results/IPOC/PPSD/ppsd_%s_6h_cb.png" % station, dpi=150, bbox_inches='tight')
    mpl.pyplot.close()