Beispiel #1
0
def do_example(datafile, outfile, invert=False, bins=100, ignore=0.0):
    xyvv = clx.calc_load_xyvv(datafile, invert=invert)
    (bins, xyvv) = cgsx.calc_grid_sum_xyvs(xyvv)
    xyz = cxp.calc_xyvv_percentage(xyvv)
    xyz = cix.calc_ignore_xyz(xyz, ignore=ignore)
    pgx.plot_gmt_xyz(xyz, outfile, title='%loss sum binned values',
                     np_posn='NE', s_posn='SE',
                     cb_label='% loss')
def do_example(datafile, outfile, invert=False):
    annotations = [('text', (144.5, -37.40),
                    '@;red;example_calc_plot_mean_xyz_map@;;')]
    (bins_x, xyz) = cmx.calc_mean_xyz(datafile, scale=1e3, invert=invert)
    pgx.plot_gmt_xyz(xyz, outfile, bins_x,
                     title='Loss mean binned values',
                     np_posn='NE', s_posn='SE',
                     cb_label='$ loss x 1,000',
                     annotate=annotations)
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')
def do_example(datafile, outfile, invert=False, bins=100, ignore=0.0):
    xyvv = clx.calc_load_xyvv(datafile, invert=invert)
    (bins, xyvv) = cgsx.calc_grid_sum_xyvs(xyvv)
    xyz = cxp.calc_xyvv_percentage(xyvv)
    xyz = cix.calc_ignore_xyz(xyz, ignore=ignore)
    pgx.plot_gmt_xyz(xyz,
                     outfile,
                     title='%loss sum binned values',
                     np_posn='NE',
                     s_posn='SE',
                     cb_label='% loss')
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):
    annotations = [('text', (144.5, -37.40),
                    '@;red;example_calc_plot_mean_xyz_map@;;')]
    (bins_x, xyz) = cmx.calc_mean_xyz(datafile, scale=1e3, invert=invert)
    pgx.plot_gmt_xyz(xyz,
                     outfile,
                     bins_x,
                     title='Loss mean binned values',
                     np_posn='NE',
                     s_posn='SE',
                     cb_label='$ loss x 1,000',
                     annotate=annotations)
Beispiel #7
0
def do_example(datafile, outfile, invert=False):
    annotations = [('text', (144.0, -37.10),
                    '@;blue;cb_steps = (0.01,0.05,0.1,0.2,0.3,0.4), bins = 200@;;')]
    bins = 200
    #cb_steps = None
    #cb_steps = ()
    cb_steps = (0.01,0.05,0.1,0.2,0.3,0.4)
    data = clx.calc_load_xyz(datafile, invert=invert)
    pgx.plot_gmt_xyz(data, outfile, bins=bins,
                     title='example_plot_xyz_map.py',
                     np_posn='NE', s_posn='SE',
                     cb_label='$ loss x 1,000',
                     colourmap='hazmap',
                     cb_steps=cb_steps,
                     annotate=annotations)
Beispiel #8
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')