@@ -40,7 +40,7 @@ def update_axes(ax, mappable=None):
40
40
)[:365 ]
41
41
42
42
# %%
43
- # Merge all identification dataset in one object
43
+ # Merge all identification datasets in one object
44
44
all_a = EddiesObservations .concatenate (
45
45
[EddiesObservations .load_file (i ) for i in file_objects ]
46
46
)
@@ -50,14 +50,14 @@ def update_axes(ax, mappable=None):
50
50
x0 , x1 , y0 , y1 = 15 , 20 , 33 , 38
51
51
xs = np .array ([[x0 , x1 , x1 , x0 , x0 ]], dtype = "f8" )
52
52
ys = np .array ([[y0 , y0 , y1 , y1 , y0 ]], dtype = "f8" )
53
- # Polygon object is create to be usable by match function.
53
+ # Polygon object created for the match function use .
54
54
polygon = dict (contour_lon_e = xs , contour_lat_e = ys , contour_lon_s = xs , contour_lat_s = ys )
55
55
56
56
# %%
57
57
# Geographic frequency of eddies
58
58
step = 0.125
59
59
ax = start_axes ("" )
60
- # Count pixel used for each contour
60
+ # Count pixel encompassed in each contour
61
61
g_a = all_a .grid_count (bins = ((- 10 , 37 , step ), (30 , 46 , step )), intern = True )
62
62
m = g_a .display (
63
63
ax , cmap = "terrain_r" , vmin = 0 , vmax = 0.75 , factor = 1 / all_a .nb_days , name = "count"
@@ -66,7 +66,7 @@ def update_axes(ax, mappable=None):
66
66
update_axes (ax , m )
67
67
68
68
# %%
69
- # We use match function to count number of eddies which intersect the polygon defined previously.
69
+ # We use the match function to count the number of eddies that intersect the polygon defined previously
70
70
# `p1_area` option allow to get in c_e/c_s output, precentage of area occupy by eddies in the polygon.
71
71
i_e , j_e , c_e = all_a .match (polygon , p1_area = True , intern = False )
72
72
i_s , j_s , c_s = all_a .match (polygon , p1_area = True , intern = True )
@@ -79,22 +79,22 @@ def update_axes(ax, mappable=None):
79
79
# translate julian day in datetime64
80
80
t = all_a .time .astype ("datetime64" ) - dt
81
81
# %%
82
- # Count how many are in polygon
82
+ # Number of eddies within a polygon
83
83
ax = plt .figure (figsize = (12 , 6 )).add_subplot (111 )
84
- ax .set_title ("Different way to count eddies presence in a polygon" )
84
+ ax .set_title ("Different ways to count eddies within a polygon" )
85
85
ax .set_ylabel ("Count" )
86
86
m = all_a .mask_from_polygons (((xs , ys ),))
87
- ax .hist (t [m ], label = "center in polygon" , ** kw_hist )
88
- ax .hist (t [i_s [c_s > 0 ]], label = "intersect speed contour with polygon" , ** kw_hist )
89
- ax .hist (t [i_e [c_e > 0 ]], label = "intersect extern contour with polygon" , ** kw_hist )
87
+ ax .hist (t [m ], label = "Eddy Center in polygon" , ** kw_hist )
88
+ ax .hist (t [i_s [c_s > 0 ]], label = "Intersection Speed contour and polygon" , ** kw_hist )
89
+ ax .hist (t [i_e [c_e > 0 ]], label = "Intersection Effective contour and polygon" , ** kw_hist )
90
90
ax .legend ()
91
91
ax .set_xlim (np .datetime64 ("2010" ), np .datetime64 ("2011" ))
92
92
ax .grid ()
93
93
94
94
# %%
95
- # Percent of are of interest occupy by eddies
95
+ # Percent of the area of interest occupied by eddies.
96
96
ax = plt .figure (figsize = (12 , 6 )).add_subplot (111 )
97
- ax .set_title ("Percent of polygon occupy by an anticyclonic eddy" )
97
+ ax .set_title ("Percent of polygon occupied by an anticyclonic eddy" )
98
98
ax .set_ylabel ("Percent of polygon" )
99
99
ax .hist (t [i_s [c_s > 0 ]], weights = c_s [c_s > 0 ] * 100.0 , label = "speed contour" , ** kw_hist )
100
100
ax .hist (
0 commit comments