Skip to content

Commit f40cecb

Browse files
committed
Change method name to get demo data, to be explicit
1 parent 896694b commit f40cecb

File tree

93 files changed

+196
-154
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

93 files changed

+196
-154
lines changed

examples/01_general_things/pet_storage.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
import py_eddy_tracker_sample
1919

20-
from py_eddy_tracker.data import get_path, get_remote_sample
20+
from py_eddy_tracker.data import get_demo_path, get_remote_demo_sample
2121
from py_eddy_tracker.observations.network import NetworkObservations
2222
from py_eddy_tracker.observations.observation import EddiesObservations, Table
2323
from py_eddy_tracker.observations.tracking import TrackEddiesObservations
@@ -33,7 +33,7 @@
3333

3434
# %%
3535
# Eddies files (zarr or netcdf) could be loaded with ```load_file``` method:
36-
eddies_collections = EddiesObservations.load_file(get_path("Cyclonic_20160515.nc"))
36+
eddies_collections = EddiesObservations.load_file(get_demo_path("Cyclonic_20160515.nc"))
3737
eddies_collections.field_table()
3838
# offset and scale_factor are used only when data is stored in zarr or netCDF4
3939

@@ -69,7 +69,7 @@
6969
# - **observation_number** : Eddy temporal index in a trajectory, days starting at the eddy first detection
7070
# - **cost_association** : result of the cost function to associate the eddy with the next observation
7171
eddies_tracks = TrackEddiesObservations.load_file(
72-
py_eddy_tracker_sample.get_path("eddies_med_adt_allsat_dt2018/Cyclonic.zarr")
72+
py_eddy_tracker_sample.get_demo_path("eddies_med_adt_allsat_dt2018/Cyclonic.zarr")
7373
)
7474
# In this example some fields are removed (effective_contour_longitude,...) in order to save time for doc building
7575
eddies_tracks.field_table()
@@ -87,7 +87,7 @@
8787
# - previous_cost : Result of the cost function (1 is a good association, 0 is bad) with previous observation
8888
# - next_cost : Result of the cost function (1 is a good association, 0 is bad) with next observation
8989
eddies_network = NetworkObservations.load_file(
90-
get_remote_sample(
90+
get_remote_demo_sample(
9191
"eddies_med_adt_allsat_dt2018_err70_filt500_order1/Anticyclonic_network.nc"
9292
)
9393
)

examples/02_eddy_identification/pet_contour_circle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
# %%
1313
# Load detection files
14-
a = EddiesObservations.load_file(data.get_path("Anticyclonic_20190223.nc"))
14+
a = EddiesObservations.load_file(data.get_demo_path("Anticyclonic_20190223.nc"))
1515

1616
# %%
1717
# Plot the speed and effective (dashed) contours

examples/02_eddy_identification/pet_display_id.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
# %%
1313
# Load detection files
14-
a = EddiesObservations.load_file(data.get_path("Anticyclonic_20190223.nc"))
15-
c = EddiesObservations.load_file(data.get_path("Cyclonic_20190223.nc"))
14+
a = EddiesObservations.load_file(data.get_demo_path("Anticyclonic_20190223.nc"))
15+
c = EddiesObservations.load_file(data.get_demo_path("Cyclonic_20190223.nc"))
1616

1717
# %%
1818
# Fill effective contour with amplitude

examples/02_eddy_identification/pet_eddy_detection.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ def update_axes(ax, mappable=None):
3535
# %%
3636
# Load Input grid, ADT is used to detect eddies
3737
g = RegularGridDataset(
38-
data.get_path("dt_med_allsat_phy_l4_20160515_20190101.nc"), "longitude", "latitude"
38+
data.get_demo_path("dt_med_allsat_phy_l4_20160515_20190101.nc"),
39+
"longitude",
40+
"latitude",
3941
)
4042

4143
ax = start_axes("ADT (m)")

examples/02_eddy_identification/pet_eddy_detection_ACC.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def set_fancy_labels(fig, ticklabelsize=14, labelsize=14, labelweight="semibold"
6060
margin = 30
6161

6262
kw_data = dict(
63-
filename=data.get_path("nrt_global_allsat_phy_l4_20190223_20190226.nc"),
63+
filename=data.get_demo_path("nrt_global_allsat_phy_l4_20190223_20190226.nc"),
6464
x_name="longitude",
6565
y_name="latitude",
6666
# Manual area subset

examples/02_eddy_identification/pet_eddy_detection_gulf_stream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def update_axes(ax, mappable=None):
3737
# Load Input grid, ADT is used to detect eddies
3838
margin = 30
3939
g = RegularGridDataset(
40-
data.get_path("nrt_global_allsat_phy_l4_20190223_20190226.nc"),
40+
data.get_demo_path("nrt_global_allsat_phy_l4_20190223_20190226.nc"),
4141
"longitude",
4242
"latitude",
4343
# Manual area subset

examples/02_eddy_identification/pet_filter_and_detection.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ def update_axes(ax, mappable=None):
3333
# Add a new filed to store the high-pass filtered ADT
3434

3535
g = RegularGridDataset(
36-
data.get_path("dt_med_allsat_phy_l4_20160515_20190101.nc"), "longitude", "latitude"
36+
data.get_demo_path("dt_med_allsat_phy_l4_20160515_20190101.nc"),
37+
"longitude",
38+
"latitude",
3739
)
3840
g.add_uv("adt")
3941
g.copy("adt", "adt_high")

examples/02_eddy_identification/pet_interp_grid_on_dataset.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@ def update_axes(ax, mappable=None):
3030

3131
# %%
3232
# Load detection files and data to interp
33-
a = EddiesObservations.load_file(data.get_path("Anticyclonic_20160515.nc"))
34-
c = EddiesObservations.load_file(data.get_path("Cyclonic_20160515.nc"))
33+
a = EddiesObservations.load_file(data.get_demo_path("Anticyclonic_20160515.nc"))
34+
c = EddiesObservations.load_file(data.get_demo_path("Cyclonic_20160515.nc"))
3535

3636
aviso_map = RegularGridDataset(
37-
data.get_path("dt_med_allsat_phy_l4_20160515_20190101.nc"), "longitude", "latitude"
37+
data.get_demo_path("dt_med_allsat_phy_l4_20160515_20190101.nc"),
38+
"longitude",
39+
"latitude",
3840
)
3941
aviso_map.add_uv("adt")
4042

examples/02_eddy_identification/pet_radius_vs_area.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
# %%
1515
# Load detection files
16-
a = EddiesObservations.load_file(data.get_path("Anticyclonic_20190223.nc"))
16+
a = EddiesObservations.load_file(data.get_demo_path("Anticyclonic_20190223.nc"))
1717
areas = list()
1818
# For each contour area will be compute in local reference
1919
for i in a:

examples/02_eddy_identification/pet_shape_gallery.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,9 @@ def build_circle(x0, y0, r):
2525
# %%
2626
# We iterate over closed contours and sort with regards of shape error
2727
g = RegularGridDataset(
28-
data.get_path("dt_med_allsat_phy_l4_20160515_20190101.nc"), "longitude", "latitude"
28+
data.get_demo_path("dt_med_allsat_phy_l4_20160515_20190101.nc"),
29+
"longitude",
30+
"latitude",
2931
)
3032
c = Contours(g.x_c, g.y_c, g.grid("adt") * 100, arange(-50, 50, 0.2))
3133
contours = dict()

0 commit comments

Comments
 (0)