def do_example(datafile, outfile, invert=False):
    xyz = csx.calc_sum_xyz(datafile, scale=1e6, invert=invert)
    pgx.plot_gmt_xyz(
        xyz,
        outfile,  #bins_x,
        title='Loss sum binned values',
        np_posn='NE',
        s_posn='SE',
        cb_label='$ loss x 1,000,000')
Esempio n. 2
0
def obsolete_plot_loss_map(indir,
                           data,
                           out_dir,
                           output_file,
                           save_file=None,
                           title=None,
                           np_posn=None,
                           s_posn=None,
                           cb_label=None,
                           bins=100,
                           scale=1.0,
                           ignore=None,
                           invert=False,
                           colourmap=None):
    """Plot a loss map from randomly sampled data.

    indir        input directory
    data         name of the data file to plot (in indir)
    out_dir      general output directory
    output_file  name of map output file to create in 'out_dir' directory
    save_file    name of map data output file to create in 'out_dir' directory
    title        title to put on the graph
    np_posn      place to put a north pointer symbol at
    s_posn       place to put a length scale at
    cb_label     label text to put on the colour bar
    bins         either scalar for bins in each direction or (bin_x, bin_y)
    scale        amount to scale the data by
    ignore       the value to ignore if value <= ignore
    colourmap    the base colourmap to use

    """

    # read in and scale XYZ data
    xyz = csx.calc_sum_xyz(data, scale=scale, bins=bins, invert=invert)

    # ignore everything less than an 'ignore' value?
    if ignore is not None:
        xyz = cix.calc_ignore_xyz(xyz, ignore)

    # if we want a save of actual plotted data, do it here
    if save_file:
        save_outfile = os.path.join(out_dir, save_file)
        # write 'xyz' data to 'save_outfile' here

    # generate the plot output required
    plot_outfile = os.path.join(out_dir, output_file)
    pgx.plot_gmt_xyz(xyz,
                     plot_outfile,
                     bins=bins,
                     title=title,
                     cb_label=cb_label,
                     np_posn=np_posn,
                     s_posn=s_posn,
                     colourmap=colourmap)
Esempio n. 3
0
def obsolete_plot_loss_map(indir, data, out_dir, output_file, save_file=None,
                  title=None, np_posn=None, s_posn=None, cb_label=None,
                  bins=100, scale=1.0, ignore=None, invert=False,
                  colourmap=None):
    """Plot a loss map from randomly sampled data.

    indir        input directory
    data         name of the data file to plot (in indir)
    out_dir      general output directory
    output_file  name of map output file to create in 'out_dir' directory
    save_file    name of map data output file to create in 'out_dir' directory
    title        title to put on the graph
    np_posn      place to put a north pointer symbol at
    s_posn       place to put a length scale at
    cb_label     label text to put on the colour bar
    bins         either scalar for bins in each direction or (bin_x, bin_y)
    scale        amount to scale the data by
    ignore       the value to ignore if value <= ignore
    colourmap    the base colourmap to use

    """

    # read in and scale XYZ data
    xyz = csx.calc_sum_xyz(data, scale=scale, bins=bins, invert=invert)

    # ignore everything less than an 'ignore' value?
    if ignore is not None:
        xyz = cix.calc_ignore_xyz(xyz, ignore)

    # if we want a save of actual plotted data, do it here
    if save_file:
        save_outfile = os.path.join(out_dir, save_file)
        # write 'xyz' data to 'save_outfile' here

    # generate the plot output required
    plot_outfile = os.path.join(out_dir, output_file)
    pgx.plot_gmt_xyz(xyz, plot_outfile, bins=bins,
                     title=title, cb_label=cb_label,
                     np_posn=np_posn, s_posn=s_posn,
                     colourmap=colourmap)
def do_example(datafile, outfile, invert=False):
    xyz = csx.calc_sum_xyz(datafile, scale=1e6, invert=invert)
    pgx.plot_gmt_xyz(xyz, outfile, #bins_x,
                     title='Loss sum binned values',
                     np_posn='NE', s_posn='SE',
                     cb_label='$ loss x 1,000,000')