Ejemplo n.º 1
0
def plot_flux(in_file, out_file):
    print(
        "Reading %s to plot ice flux for model %s, experiment %s, grid mode %s, step %s"
        % (in_file, model, experiment, mode, step))

    if out_file is None:
        out_file = os.path.splitext(in_file)[0] + "-flux.pdf"

    x = read(in_file, 'x')
    flux_mag = read(in_file, 'flux_mag')

    # plot positive xs only
    flux_mag = flux_mag[x >= 0]
    x = x[x >= 0]

    figure(2)
    hold(True)

    plot(x / 1e3, flux_mag, 'k.-', markersize=10, linewidth=2)
    plot(x / 1e3, x * MISMIP.a() * MISMIP.secpera(), 'r:', linewidth=1.5)

    title("MISMIP experiment %s, step %d" % (experiment, step))
    xlabel("x ($\mathrm{km}$)", size=14)
    ylabel(r"flux ($\mathrm{m}^2\,\mathrm{a}^{-1}$)", size=14)

    print("Saving '%s'...\n" % out_file)
    savefig(out_file, dpi=300, facecolor='w', edgecolor='w')
Ejemplo n.º 2
0
Archivo: plot.py Proyecto: pism/pism
def plot_flux(in_file, out_file):
    print("Reading %s to plot ice flux for model %s, experiment %s, grid mode %s, step %s" % (
        in_file, model, experiment, mode, step))

    if out_file is None:
        out_file = os.path.splitext(in_file)[0] + "-flux.pdf"

    x = read(in_file, 'x')
    flux_mag = read(in_file, 'flux_mag')

    # plot positive xs only
    flux_mag = flux_mag[x >= 0]
    x = x[x >= 0]

    figure(2)
    hold(True)

    plot(x / 1e3, flux_mag, 'k.-', markersize=10, linewidth=2)
    plot(x / 1e3, x * MISMIP.a() * MISMIP.secpera(), 'r:', linewidth=1.5)

    title("MISMIP experiment %s, step %d" % (experiment, step))
    xlabel("x ($\mathrm{km}$)", size=14)
    ylabel(r"flux ($\mathrm{m}^2\,\mathrm{a}^{-1}$)", size=14)

    print("Saving '%s'...\n" % out_file)
    savefig(out_file, dpi=300, facecolor='w', edgecolor='w')
Ejemplo n.º 3
0
Archivo: prepare.py Proyecto: pism/pism
def surface_mass_balance(x):
    """Computes the surface mass balance."""
    return np.tile(np.zeros_like(x) + MISMIP.a(), (3, 1)) * MISMIP.rho_i()
Ejemplo n.º 4
0
def surface_mass_balance(x):
    """Computes the surface mass balance."""
    return np.tile(np.zeros_like(x) + MISMIP.a(), (3, 1))