Skip to content

Commit 9e9b90d

Browse files
committed
- english correction
- refactoring
1 parent fa2d382 commit 9e9b90d

File tree

21 files changed

+86
-89
lines changed

21 files changed

+86
-89
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ Fixed
2121

2222
- Fix bug in convolution(filter), lowest rows was replace by zeros in convolution computation.
2323
Important impact for tiny kernel
24+
- Fix method of sampling before contour fitting
2425

2526
Added
2627
^^^^^
2728

2829
- Allow to replace mask by isnan method to manage nan data instead of masked data
30+
- Add drifter colocation example
2931

3032
[3.5.0] - 2021-06-22
3133
--------------------

examples/06_grid_manipulation/pet_advect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def _repr_html_(self, *args, **kwargs):
5050

5151
def save(self, *args, **kwargs):
5252
if args[0].endswith("gif"):
53-
# In this case gif is use to create thumbnail which are not use but consume same time than video
53+
# In this case gif is used to create thumbnail which is not used but consume same time than video
5454
# So we create an empty file, to save time
5555
with open(args[0], "w") as _:
5656
pass

examples/06_grid_manipulation/pet_lavd.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ def _repr_html_(self, *args, **kwargs):
6565

6666
def save(self, *args, **kwargs):
6767
if args[0].endswith("gif"):
68-
# In this case gif is use to create thumbnail which are not use but consume same time than video
68+
# In this case gif is used to create thumbnail which is not used but consume same time than video
6969
# So we create an empty file, to save time
7070
with open(args[0], "w") as _:
7171
pass
@@ -159,11 +159,7 @@ def update(i_frame):
159159
# Format LAVD data
160160
lavd = RegularGridDataset.with_array(
161161
coordinates=("lon", "lat"),
162-
datas=dict(
163-
lavd=lavd.T,
164-
lon=x_g,
165-
lat=y_g,
166-
),
162+
datas=dict(lavd=lavd.T, lon=x_g, lat=y_g,),
167163
centered=True,
168164
)
169165

examples/07_cube_manipulation/pet_cube.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def _repr_html_(self, *args, **kwargs):
3131

3232
def save(self, *args, **kwargs):
3333
if args[0].endswith("gif"):
34-
# In this case gif is use to create thumbnail which are not use but consume same time than video
34+
# In this case gif is used to create thumbnail which is not used but consume same time than video
3535
# So we create an empty file, to save time
3636
with open(args[0], "w") as _:
3737
pass

examples/08_tracking_manipulation/pet_track_anim_matplotlib_animation.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def _repr_html_(self, *args, **kwargs):
3030

3131
def save(self, *args, **kwargs):
3232
if args[0].endswith("gif"):
33-
# In this case gif is use to create thumbnail which are not use but consume same time than video
33+
# In this case gif is used to create thumbnail which is not used but consume same time than video
3434
# So we create an empty file, to save time
3535
with open(args[0], "w") as _:
3636
pass

examples/10_tracking_diagnostics/pet_normalised_lifetime.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,14 @@ def eddy_norm_lifetime(self, name, nb, factor=1):
6565
# %%
6666
# Figure
6767
# ------
68-
fig, axs = plt.subplots(nrows=2, figsize=(8, 6))
68+
fig, (ax0, ax1) = plt.subplots(nrows=2, figsize=(8, 6))
6969

70-
axs[0].set_title("Normalised Mean Radius")
71-
axs[0].plot(*AC_radius), axs[0].plot(*CC_radius)
72-
axs[0].set_ylabel("Radius (km)"), axs[0].grid()
73-
axs[0].set_xlim(0, 1), axs[0].set_ylim(0, None)
70+
ax0.set_title("Normalised Mean Radius")
71+
ax0.plot(*AC_radius), ax0.plot(*CC_radius)
72+
ax0.set_ylabel("Radius (km)"), ax0.grid()
73+
ax0.set_xlim(0, 1), ax0.set_ylim(0, None)
7474

75-
axs[1].set_title("Normalised Mean Amplitude")
76-
axs[1].plot(*AC_amplitude, label="AC"), axs[1].plot(*CC_amplitude, label="CC")
77-
axs[1].set_ylabel("Amplitude (cm)"), axs[1].grid(), axs[1].legend()
78-
_ = axs[1].set_xlim(0, 1), axs[1].set_ylim(0, None)
75+
ax1.set_title("Normalised Mean Amplitude")
76+
ax1.plot(*AC_amplitude, label="AC"), ax1.plot(*CC_amplitude, label="CC")
77+
ax1.set_ylabel("Amplitude (cm)"), ax1.grid(), ax1.legend()
78+
_ = ax1.set_xlim(0, 1), ax1.set_ylim(0, None)

examples/12_external_data/pet_drifter_loopers.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
Colocate looper with eddy from altimetry
33
========================================
44
5-
All loopers data used in this example are a subset from the dataset describe in this article
5+
All loopers data used in this example are a subset from the dataset described in this article
66
[Lumpkin, R. : Global characteristics of coherent vortices from surface drifter trajectories](https://doi.org/10.1002/2015JC011435)
77
"""
88

@@ -29,7 +29,7 @@ def _repr_html_(self, *args, **kwargs):
2929

3030
def save(self, *args, **kwargs):
3131
if args[0].endswith("gif"):
32-
# In this case gif is use to create thumbnail which are not use but consume same time than video
32+
# In this case gif is used to create thumbnail which is not used but consume same time than video
3333
# So we create an empty file, to save time
3434
with open(args[0], "w") as _:
3535
pass
@@ -71,15 +71,15 @@ def update_axes(ax, mappable=None):
7171
# %%
7272
# Global view
7373
# ===========
74-
ax = start_axes("All drifter available in med from Lumpkin dataset")
74+
ax = start_axes("All drifters available in Med from Lumpkin dataset")
7575
loopers_med.plot(ax, lw=0.5, color="r", ref=-10)
7676
update_axes(ax)
7777

7878
# %%
7979
# One segment of drifter
8080
# ======================
8181
#
82-
# Get a drifter segment (index used have no correspondance with original dataset).
82+
# Get a drifter segment (the indexes used have no correspondance with the original dataset).
8383
looper = loopers_med.extract_ids((3588,))
8484
fig = plt.figure(figsize=(16, 6))
8585
ax = fig.add_subplot(111, aspect="equal")
@@ -138,7 +138,7 @@ def update_axes(ax, mappable=None):
138138

139139

140140
# %%
141-
# Animation which show drifter with colocated eddy
141+
# Animation of a drifter and its colocated eddy
142142
def update(frame):
143143
# We display last 5 days of loopers trajectory
144144
m = (looper.time < frame) * (looper.time > (frame - 5))

examples/16_network/pet_follow_particle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def _repr_html_(self, *args, **kwargs):
3131

3232
def save(self, *args, **kwargs):
3333
if args[0].endswith("gif"):
34-
# In this case gif is used to create thumbnail which are not used but consumes same time than video
34+
# In this case gif is used to create thumbnail which is not used but consume same time than video
3535
# So we create an empty file, to save time
3636
with open(args[0], "w") as _:
3737
pass

examples/16_network/pet_group_anim.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ def _repr_html_(self, *args, **kwargs):
2929

3030
def save(self, *args, **kwargs):
3131
if args[0].endswith("gif"):
32-
# In this case gif is use to create thumbnail which are not use but consume same time than video
32+
# In this case gif is used to create thumbnail which is not used but consume same time than video
3333
# So we create an empty file, to save time
3434
with open(args[0], "w") as _:
3535
pass

examples/16_network/pet_ioannou_2017_case.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def _repr_html_(self, *args, **kwargs):
3636

3737
def save(self, *args, **kwargs):
3838
if args[0].endswith("gif"):
39-
# In this case gif is use to create thumbnail which are not use but consume same time than video
39+
# In this case gif is used to create thumbnail which is not used but consume same time than video
4040
# So we create an empty file, to save time
4141
with open(args[0], "w") as _:
4242
pass

0 commit comments

Comments
 (0)