Beispiel #1
0
        except:
            values.append(data)

    ocean_mask_varname = 'oceanmask'
    if ocean_mask_varname in nc.variables.keys():
        ocean_mask.append(np.squeeze(ppt.permute(nc.variables['mask'])))
    else:
        ocean_mask.append(np.zeros_like(data))
    nc.close()


# set the print mode
if print_mode in 'height':
    ntn = nt
    if (ntn == 2):
        lw, pad_inches = ppt.set_mode(print_mode, aspect_ratio=.75)
    if (ntn == 3):
        lw, pad_inches = ppt.set_mode(print_mode, aspect_ratio=.55)
    elif (ntn == 4):
        lw, pad_inches = ppt.set_mode(print_mode, aspect_ratio=.35)
    elif (ntn == 5):
        lw, pad_inches = ppt.set_mode(print_mode, aspect_ratio=.25)
    else:
        lw, pad_inches = ppt.set_mode(print_mode)
else:
    lw, pad_inches = ppt.set_mode(print_mode)

# make a separate colorbar (if requested)
if colorbar:

    fig = plt.figure()
Beispiel #2
0
    if obs_file:
        obs = ObservationsDataset(obs_file, varname)
        for flux_gate in flux_gates:
            flux_gate.add_observations(obs)

    # Add experiments to flux gates
    for k, filename in enumerate(args):
        # id = re.search("id_(\b0*([1-9][0-9]*|0)\b)", filename).group(1)
        # pid = int(filename.split("id_")[1].split("_")[0])
        id = k
        experiment = ExperimentDataset(id, filename, varname)
        for flux_gate in flux_gates:
            flux_gate.add_experiment(experiment)

    # set the print mode
    lw, pad_inches = ppt.set_mode(print_mode, aspect_ratio=aspect_ratio)

    ne = len(flux_gates[0].experiments)
    ng = len(flux_gates)

    if table_file and obs_file:
        export_latex_table_flux(table_file, flux_gates, label_params)

    # make figure for each flux gate
    for gate in flux_gates:
        if make_figures:
            gate.make_line_plot(label_param_list=label_params)
        else:
            if not gate.has_fluxes:
                gate.calculate_fluxes()
            if gate.has_observations:
Beispiel #3
0
            values.append(np.ma.array(data, mask=mask))
        except:
            values.append(data)

    ocean_mask_varname = "oceanmask"
    if ocean_mask_varname in list(nc.variables.keys()):
        ocean_mask.append(np.squeeze(ppt.permute(nc.variables["mask"])))
    else:
        ocean_mask.append(np.zeros_like(data))
    nc.close()

# set the print mode
if print_mode in "height":
    ntn = nt
    if ntn == 2:
        lw, pad_inches = ppt.set_mode(print_mode, aspect_ratio=0.75)
    if ntn == 3:
        lw, pad_inches = ppt.set_mode(print_mode, aspect_ratio=0.55)
    elif ntn == 4:
        lw, pad_inches = ppt.set_mode(print_mode, aspect_ratio=0.35)
    elif ntn == 5:
        lw, pad_inches = ppt.set_mode(print_mode, aspect_ratio=0.25)
    else:
        lw, pad_inches = ppt.set_mode(print_mode)
else:
    lw, pad_inches = ppt.set_mode(print_mode)

# make a separate colorbar (if requested)
if colorbar:

    fig = plt.figure()
Beispiel #4
0
    # import and convert colormap
    cdict = ppt.gmtColormap(colormap)
cmap = colors.LinearSegmentedColormap('my_colormap', cdict)

# Init Unit system
sys = System()

# Plotting styles
axisbg = '0.9'
shadow_color = '0.25'
numpoints = 1

aspect_ratio = golden_mean

# set the print mode
lw, pad_inches = ppt.set_mode(print_mode, aspect_ratio=aspect_ratio)

plt.rcParams['legend.fancybox'] = True


ne = len(args)
cNorm = colors.Normalize(vmin=0, vmax=ne)
scalarMap = cmx.ScalarMappable(norm=cNorm, cmap=cmap)


profile_axis_o_units = 'm'

filename = args[0]
try:
    nc0 = NC(filename, 'r')
except: