Пример #1
0
kw_data = dict(
    filename=data.get_demo_path(
        "nrt_global_allsat_phy_l4_20190223_20190226.nc"),
    x_name="longitude",
    y_name="latitude",
    # Manual area subset
    indexs=dict(
        latitude=slice(100 - margin, 220 + margin),
        longitude=slice(0, 230 + margin),
    ),
)
g_raw = RegularGridDataset(**kw_data)
g_raw.add_uv("adt")
g = RegularGridDataset(**kw_data)
g.copy("adt", "adt_low")
g.bessel_high_filter("adt", 700)
g.bessel_low_filter("adt_low", 700)
g.add_uv("adt")

# %%
# Identification
# ^^^^^^^^^^^^^^
# Run the identification step with slices of 2 mm
date = datetime(2016, 5, 15)
kw_ident = dict(date=date,
                step=0.002,
                shape_error=70,
                sampling=30,
                uname="u",
                vname="v")
Пример #2
0
# %% 
# and add it to `g`
g.add_grid('sst',ti)

# %%
ax = start_axes("SST")
m = g.display(ax, "sst", vmin=295, vmax=300)
u,v = g.grid("ugosa").T,g.grid("vgosa").T
ax.quiver(g.x_c, g.y_c, u, v, scale=10)
update_axes(ax, m, unit='[°K]')

# %%
# Now, with eddy contours, and displaying SST anomaly
# ! lazy patch since add_grid isn't currently completing g.variables_description
g.variables_description['sst'] = t.variables_description[var_name_sst]
g.copy("sst", "sst_high")
g.bessel_high_filter('sst_high',200)

# %% 
# Eddy detection
date = datetime.strptime(datest,'%Y%m%d')
a, c = g.eddy_identification("sla", "ugosa", "vgosa", date, 0.002)

# %%
kwargs_a = dict(lw=2, label="Anticyclonic", ref=-10, color="b")
kwargs_c = dict(lw=2, label="Cyclonic", ref=-10, color="r")
ax = start_axes("SST anomaly")
m = g.display(ax, "sst_high", vmin=-1, vmax=1)
ax.quiver(g.x_c, g.y_c, u, v, scale=20)
a.display(ax, **kwargs_a), c.display(ax, **kwargs_c)
update_axes(ax, m, unit='[°K]')
Пример #3
0
def update_axes(ax, mappable=None):
    ax.grid()
    if mappable:
        plt.colorbar(mappable, cax=ax.figure.add_axes([0.94, 0.05, 0.01, 0.9]))


# %%
# Load Input grid, ADT is used to detect eddies.
# Add a new filed to store the high-pass filtered ADT

g = RegularGridDataset(
    data.get_path("dt_med_allsat_phy_l4_20160515_20190101.nc"), "longitude",
    "latitude")
g.add_uv("adt")
g.copy("adt", "adt_high")
wavelength = 800
g.bessel_high_filter("adt_high", wavelength)
date = datetime(2016, 5, 15)

# %%
# Run the detection for the total grid and the filtered grid
a_filtered, c_filtered = g.eddy_identification("adt_high", "u", "v", date,
                                               0.002)
merge_f = a_filtered.merge(c_filtered)
a_tot, c_tot = g.eddy_identification("adt", "u", "v", date, 0.002)
merge_t = a_tot.merge(c_tot)

# %%
# Display the two detections
ax = start_axes("Eddies detected over ADT")
Пример #4
0
ax.grid()

# %%
# Kernel applying
# ---------------
# Original grid
ax = start_axes("ADT")
m = g.display(ax, "adt", vmin=-0.15, vmax=0.15)
update_axes(ax, m)

# %%
# We will select wavelength of 300 km
#
# Low frequency
ax = start_axes("ADT low frequency")
g.copy("adt", "adt_low_300")
g.bessel_low_filter("adt_low_300", 300, order=3)
m = g.display(ax, "adt_low_300", vmin=-0.15, vmax=0.15)
update_axes(ax, m)

# %%
# High frequency
ax = start_axes("ADT high frequency")
g.copy("adt", "adt_high_300")
g.bessel_high_filter("adt_high_300", 300, order=3)
m = g.display(ax, "adt_high_300", vmin=-0.15, vmax=0.15)
update_axes(ax, m)

# %%
# Clues
# -----
Пример #5
0
    if mappable:
        plt.colorbar(mappable, cax=ax.figure.add_axes([0.95, 0.05, 0.01, 0.9]))


# %%
# Load Input grid, ADT will be used to detect eddies

g = RegularGridDataset(
    data.get_demo_path("dt_med_allsat_phy_l4_20160515_20190101.nc"),
    "longitude",
    "latitude",
)
g.add_uv("adt", "ugos", "vgos")
g.add_uv("sla", "ugosa", "vgosa")
wavelength = 400
g.copy("adt", "adt_raw")
g.copy("sla", "sla_raw")
g.bessel_high_filter("adt", wavelength)
g.bessel_high_filter("sla", wavelength)
date = datetime(2016, 5, 15)

# %%
kwargs_a_adt = dict(lw=0.5,
                    label="Anticyclonic ADT ({nb_obs} eddies)",
                    ref=-10,
                    color="k")
kwargs_c_adt = dict(lw=0.5,
                    label="Cyclonic ADT ({nb_obs} eddies)",
                    ref=-10,
                    color="r")
kwargs_a_sla = dict(lw=0.5,