Ejemplo n.º 1
0
def main(iargs=None):
    inps = cmd_line_parse(iargs)
    inps = read_network_info(inps)

    # Plot
    if not inps.disp_fig:
        plt.switch_backend('Agg')
    inps.cbar_label = 'Average Spatial Coherence'
    figNames = [i+inps.fig_ext for i in ['BperpHistory', 'CoherenceMatrix', 'CoherenceHistory', 'Network']]

    # Fig 1 - Baseline History
    fig, ax = plt.subplots(figsize=inps.fig_size)
    ax = pp.plot_perp_baseline_hist(ax,
                                    inps.dateList,
                                    inps.pbaseList,
                                    vars(inps),
                                    inps.dateList_drop)
    if inps.save_fig:
        fig.savefig(figNames[0], bbox_inches='tight', transparent=True, dpi=inps.fig_dpi)
        print('save figure to {}'.format(figNames[0]))

    if inps.cohList is not None:
        # Fig 2 - Coherence Matrix
        fig, ax = plt.subplots(figsize=inps.fig_size)
        ax = pp.plot_coherence_matrix(ax,
                                      inps.date12List,
                                      inps.cohList,
                                      inps.date12List_drop,
                                      plot_dict=vars(inps))[0]
        if inps.save_fig:
            fig.savefig(figNames[1], bbox_inches='tight', transparent=True, dpi=inps.fig_dpi)
            print('save figure to {}'.format(figNames[1]))

        # Fig 3 - Min/Max Coherence History
        fig, ax = plt.subplots(figsize=inps.fig_size)
        ax = pp.plot_coherence_history(ax,
                                       inps.date12List,
                                       inps.cohList,
                                       plot_dict=vars(inps))
        if inps.save_fig:
            fig.savefig(figNames[2], bbox_inches='tight', transparent=True, dpi=inps.fig_dpi)
            print('save figure to {}'.format(figNames[2]))

    # Fig 4 - Interferogram Network
    fig, ax = plt.subplots(figsize=inps.fig_size)
    ax = pp.plot_network(ax,
                         inps.date12List,
                         inps.dateList,
                         inps.pbaseList,
                         vars(inps),
                         inps.date12List_drop)
    if inps.save_fig:
        fig.savefig(figNames[3], bbox_inches='tight', transparent=True, dpi=inps.fig_dpi)
        print('save figure to {}'.format(figNames[3]))

    if inps.disp_fig:
        print('showing ...')
        plt.show()
Ejemplo n.º 2
0
def main(iargs=None):
    inps = cmd_line_parse(iargs)

    # Plot
    inps.cbar_label = 'Average Spatial Coherence'
    figNames = [i+'.pdf' for i in ['BperpHistory', 'CoherenceMatrix', 'CoherenceHistory', 'Network']]

    # Fig 1 - Baseline History
    fig, ax = plt.subplots(figsize=inps.fig_size)
    ax = pp.plot_perp_baseline_hist(ax,
                                    inps.dateList,
                                    inps.pbaseList,
                                    vars(inps),
                                    inps.dateList_drop)
    if inps.save_fig:
        fig.savefig(figNames[0], bbox_inches='tight', transparent=True, dpi=inps.fig_dpi)
        print('save figure to {}'.format(figNames[0]))

    if inps.cohList is not None:
        # Fig 2 - Coherence Matrix
        fig, ax = plt.subplots(figsize=inps.fig_size)
        ax = pp.plot_coherence_matrix(ax,
                                      inps.date12List,
                                      inps.cohList,
                                      inps.date12List_drop,
                                      plot_dict=vars(inps))[0]
        if inps.save_fig:
            fig.savefig(figNames[1], bbox_inches='tight', transparent=True, dpi=inps.fig_dpi)
            print('save figure to {}'.format(figNames[1]))

        # Fig 3 - Min/Max Coherence History
        fig, ax = plt.subplots(figsize=inps.fig_size)
        ax = pp.plot_coherence_history(ax,
                                       inps.date12List,
                                       inps.cohList,
                                       plot_dict=vars(inps))
        if inps.save_fig:
            fig.savefig(figNames[2], bbox_inches='tight', transparent=True, dpi=inps.fig_dpi)
            print('save figure to {}'.format(figNames[2]))

    # Fig 4 - Interferogram Network
    fig, ax = plt.subplots(figsize=inps.fig_size)
    ax = pp.plot_network(ax,
                         inps.date12List,
                         inps.dateList,
                         inps.pbaseList,
                         vars(inps),
                         inps.date12List_drop)
    if inps.save_fig:
        fig.savefig(figNames[3], bbox_inches='tight', transparent=True, dpi=inps.fig_dpi)
        print('save figure to {}'.format(figNames[3]))

    if inps.disp_fig:
        print('showing ...')
        plt.show()
Ejemplo n.º 3
0
def main(iargs=None):
    inps = cmd_line_parse(iargs)

    # read / calculate
    inps = read_network_info(inps)

    # Plot settings
    inps = check_colormap(inps)
    if inps.dsetName == 'coherence':
        inps.ds_name = 'Coherence'
        figNames = [
            i + '.pdf' for i in
            ['bperpHistory', 'coherenceMatrix', 'coherenceHistory', 'network']
        ]
    elif inps.dsetName == 'offsetSNR':
        inps.ds_name = 'SNR'
        figNames = [
            i + '.pdf'
            for i in ['bperpHistory', 'SNRMatrix', 'SNRHistory', 'network']
        ]
    inps.cbar_label = 'Average Spatial {}'.format(inps.ds_name)

    # Fig 1 - Baseline History
    fig, ax = plt.subplots(figsize=inps.fig_size)
    ax = pp.plot_perp_baseline_hist(ax, inps.dateList, inps.pbaseList,
                                    vars(inps), inps.dateList_drop)
    if inps.save_fig:
        fig.savefig(figNames[0],
                    bbox_inches='tight',
                    transparent=True,
                    dpi=inps.fig_dpi)
        print('save figure to {}'.format(figNames[0]))

    if inps.cohList is not None:
        # Fig 2 - Coherence Matrix
        fig, ax = plt.subplots(figsize=inps.fig_size)
        ax = pp.plot_coherence_matrix(ax,
                                      inps.date12List,
                                      inps.cohList,
                                      inps.date12List_drop,
                                      p_dict=vars(inps))[0]
        if inps.save_fig:
            fig.savefig(figNames[1],
                        bbox_inches='tight',
                        transparent=True,
                        dpi=inps.fig_dpi)
            print('save figure to {}'.format(figNames[1]))

        # Fig 3 - Min/Max Coherence History
        fig, ax = plt.subplots(figsize=inps.fig_size)
        ax = pp.plot_coherence_history(ax,
                                       inps.date12List,
                                       inps.cohList,
                                       p_dict=vars(inps))
        if inps.save_fig:
            fig.savefig(figNames[2],
                        bbox_inches='tight',
                        transparent=True,
                        dpi=inps.fig_dpi)
            print('save figure to {}'.format(figNames[2]))

    # Fig 4 - Interferogram Network
    fig, ax = plt.subplots(figsize=inps.fig_size)
    ax = pp.plot_network(ax, inps.date12List, inps.dateList, inps.pbaseList,
                         vars(inps), inps.date12List_drop)
    if inps.save_fig:
        fig.savefig(figNames[3],
                    bbox_inches='tight',
                    transparent=True,
                    dpi=inps.fig_dpi)
        print('save figure to {}'.format(figNames[3]))

    if inps.disp_fig:
        print('showing ...')
        plt.show()
    else:
        plt.close()

    return