Exemple #1
0

            """----------- plotting WaveTransform Power with confidence interval contour ----------"""


            fig_name_base = 'images/' + dfile_1.split('/')[-1].split('.')[0] + '_'


            """----------------- plotting contours w/global and timeseries ----------"""
            plt, fig = wavelet_analy_plot.timeseries_comp(data_1['anom'], data_1c['anom'], data_1['time'], par_1[1])
            plt.savefig(fig_name_base + par_1[0] + 'datavfilt.png', bbox_inches='tight', dpi = (100))
            plt.close()

            """----------------- zoom in to specified scales ----------"""

            plt, fig = wavelet_analy_plot.plot_wavetransf_time_zoom(data_1c['anom'], wa1c, T1, S1, sig95_1,\
             gs_1, signif_g_1, data_1['time_base'], scalemin=.1, scalemax=64, ylabel=par_1[1], plot_percentile=True)
            plt.savefig(fig_name_base + par_1[0] + '.png', bbox_inches='tight', dpi = (100))
            plt.close()

            plt, fig = wavelet_analy_plot.plot_wavetransf_time_zoom(data_2c['anom'], wa2c, T2, S2, sig95_2,\
             gs_2, signif_g_2, data_2['time_base'], scalemin=.1, scalemax=64, ylabel=par_2[1], plot_percentile=True)
            plt.savefig(fig_name_base + par_2[0] + '.png', bbox_inches='tight', dpi = (100))
            plt.close()    

            xwt_plot = False
            if not xwt_plot: #switch to turn on/off remaining xwt analysis
                continue
                
            """-----------------------------cross wavelet analysis      ---------------------------"""
            ### since the time scales are matched and the dt is the same, the wavelet analysis for
            #   dataset 1 or two can be used and they should be equivalent for coi, scales and fourier
                                                       plot_percentile=True)
    plt.savefig(fig_name_base + '_wave2' +
                str(depth[level]).replace('.0', 'm') + '.png',
                bbox_inches='tight',
                dpi=(100))
    plt.close()
    """----------------- plotting contours w/global and timeseries ----------"""
    """----------------- zoom in to specified scales ----------"""

    plt, fig = wavelet_analy_plot.plot_wavetransf_time_zoom(
        x,
        wa,
        T,
        S,
        sig95,
        gs,
        signif_g,
        time_base,
        scalemin=.1,
        scalemax=128,
        ylabel='Echo Intens.',
        plot_percentile=True)
    plt.savefig(fig_name_base + '_wave3' +
                str(depth[level]).replace('.0', 'm') + '.png',
                bbox_inches='tight',
                dpi=(100))
    plt.close()
    """----------------------- plotting power spectrum FFT --------------------------------"""
    (plt, fig) = wavelet_analy_plot.fft_power_spec(x, time_base, Fs=24)

    plt.savefig(fig_name_base + '_FFTspec' +
    plt, fig = wavelet_analy_plot.plot_wavetransf(wa, T, S, sig95, time_base, plot_percentile=True)

    plt.savefig((fig_name_base + '_wave' + str(depth[level]).replace('.0','m') + '.png'), bbox_inches='tight', dpi = (100))
    plt.close()

    """----------------- plotting contours w/global and timeseries ----------"""

    plt, fig = wavelet_analy_plot.plot_wavetransf_time(x, wa, T, S, sig95, gs, signif_g,
             time_base, ylabel='Echo Intens.', plot_percentile=True)
    plt.savefig(fig_name_base + '_wave2' + str(depth[level]).replace('.0','m') + '.png', bbox_inches='tight', dpi = (100))
    plt.close()

    """----------------- plotting contours w/global and timeseries ----------"""
    """----------------- zoom in to specified scales ----------"""

    plt, fig = wavelet_analy_plot.plot_wavetransf_time_zoom(x, wa, T, S, sig95, gs, signif_g, 
        time_base, scalemin=.1, scalemax=128, ylabel='Echo Intens.', plot_percentile=True)
    plt.savefig(fig_name_base + '_wave3' + str(depth[level]).replace('.0','m') + '.png', bbox_inches='tight', dpi = (100))
    plt.close()

    """----------------------- plotting power spectrum FFT --------------------------------"""
    (plt, fig) = wavelet_analy_plot.fft_power_spec(x, time_base, Fs=24)

    plt.savefig(fig_name_base + '_FFTspec' + str(depth[level]).replace('.0','m') + '.png', bbox_inches='tight', dpi = (100))
    plt.close()

    """
    # Do FFT analysis of array
    sp = np.fft.fft(x)
    # Getting the related frequencies
    freq = np.fft.fftfreq(t.shape[-1], d=.25)
    pyy = sp*np.conj(sp)



        """----------------------------- plot setup ------------------------------------------"""
        T, S = np.meshgrid(t, scales)


        """----------- plotting WaveTransform Power with confidence interval contour ----------"""



        """----------------- plotting contours w/global and timeseries ----------"""
        """----------------- zoom in to specified scales ----------"""

        plt, fig = wavelet_analy_plot.plot_wavetransf_time_zoom(data_1['anom'], wa, T, S, sig95, gs, signif_g, 
            data_1['time_base'], scalemin=.1, scalemax=64, ylabel=par_1[1], plot_percentile=True)
        plt.savefig(fig_name_base + '_wave3' + depth + '.png', bbox_inches='tight', dpi = (100))
        plt.close()

        """----------------------- plotting power spectrum FFT --------------------------------"""
        (plt, fig) = wavelet_analy_plot.fft_power_spec(data_1['anom'], data_1['time_base'], Fs=24)

        plt.savefig(fig_name_base + '_FFTspec' + depth + '.png', bbox_inches='tight', dpi = (100))
        plt.close()