@@ -20,7 +20,7 @@ def start_axes(title):
20
20
ax = fig .add_axes ([0.03 , 0.03 , 0.90 , 0.94 ])
21
21
ax .set_xlim (- 6 , 36.5 ), ax .set_ylim (30 , 46 )
22
22
ax .set_aspect ("equal" )
23
- ax .set_title (title )
23
+ ax .set_title (title , weight = 'bold' )
24
24
return ax
25
25
26
26
@@ -31,118 +31,116 @@ def update_axes(ax, mappable=None):
31
31
32
32
33
33
# %%
34
- # Load Input grid, ADT will be used to detect eddies
34
+ # Load Input grid, ADT is used to detect eddies
35
35
g = RegularGridDataset (
36
36
data .get_path ("dt_med_allsat_phy_l4_20160515_20190101.nc" ), "longitude" , "latitude"
37
37
)
38
38
39
39
ax = start_axes ("ADT (m)" )
40
- m = g .display (ax , "adt" , vmin = - 0.15 , vmax = 0.15 )
40
+ m = g .display (ax , "adt" , vmin = - 0.15 , vmax = 0.15 , cmap = "RdBu_r" )
41
41
update_axes (ax , m )
42
42
43
43
# %%
44
- # Get u/ v
44
+ # Get geostrophic speed u, v
45
45
# -------
46
- # U/V are deduced from ADT, this algortihm are not usable around equator (~+- 2°)
46
+ # U/V are deduced from ADT, this algortihm is not ok near the equator (~+- 2°)
47
47
g .add_uv ("adt" )
48
48
ax = start_axes ("U/V deduce from ADT (m)" )
49
49
ax .set_xlim (2.5 , 9 ), ax .set_ylim (37.5 , 40 )
50
- m = g .display (ax , "adt" , vmin = - 0.15 , vmax = 0.15 )
50
+ m = g .display (ax , "adt" , vmin = - 0.15 , vmax = 0.15 , cmap = "RdBu_r" )
51
51
u , v = g .grid ("u" ).T , g .grid ("v" ).T
52
52
ax .quiver (g .x_c , g .y_c , u , v , scale = 10 )
53
53
update_axes (ax , m )
54
54
55
55
# %%
56
56
# Pre-processings
57
57
# ---------------
58
- # Apply high filter to remove long scale to highlight mesoscale
58
+ # Apply a high-pass filter to remove the large scale and highlight the mesoscale
59
59
g .bessel_high_filter ("adt" , 500 )
60
60
ax = start_axes ("ADT (m) filtered (500km)" )
61
- m = g .display (ax , "adt" , vmin = - 0.15 , vmax = 0.15 )
61
+ m = g .display (ax , "adt" , vmin = - 0.15 , vmax = 0.15 , cmap = "RdBu_r" )
62
62
update_axes (ax , m )
63
63
64
64
# %%
65
65
# Identification
66
66
# --------------
67
- # run identification with slice of 2 mm
67
+ # Run the identification step with slices of 2 mm
68
68
date = datetime (2016 , 5 , 15 )
69
69
a , c = g .eddy_identification ("adt" , "u" , "v" , date , 0.002 , shape_error = 55 )
70
70
71
71
# %%
72
- # All closed contour found in this input grid (Display only 1 contour every 4)
73
- ax = start_axes ("ADT closed contour (only 1 / 4 levels)" )
72
+ # Display of all closed contours found in the grid (only 1 contour every 4)
73
+ ax = start_axes ("ADT closed contours (only 1 / 4 levels)" )
74
74
g .contours .display (ax , step = 4 )
75
75
update_axes (ax )
76
76
77
77
# %%
78
- # Contours include in eddies
79
- ax = start_axes ("ADT contour used as eddies" )
78
+ # Contours included in eddies
79
+ ax = start_axes ("ADT contours used as eddies" )
80
80
g .contours .display (ax , only_used = True )
81
81
update_axes (ax )
82
82
83
83
# %%
84
- # Post analyse
84
+ # Post analysis
85
85
# ------------
86
- # Contours reject from several origin (shape error to high, several extremum in contour, ...)
87
- ax = start_axes ("ADT contour reject " )
86
+ # Contours can be rejected for several reasons (shape error to high, several extremum in contour, ...)
87
+ ax = start_axes ("ADT rejected contours " )
88
88
g .contours .display (ax , only_unused = True )
89
89
update_axes (ax )
90
90
91
91
# %%
92
- # Contours reject criterion
93
- #
92
+ # Creteria for rejecting a contour
94
93
# 0. - Accepted (green)
95
- # 1. - Reject for shape error (red)
96
- # 2. - Masked value in contour (blue)
97
- # 3. - Under or over pixel limit bound (black)
94
+ # 1. - Rejection for shape error (red)
95
+ # 2. - Masked value within contour (blue)
96
+ # 3. - Under or over the pixel limit bounds (black)
98
97
# 4. - Amplitude criterion (yellow)
99
- ax = start_axes ("Contour reject criterion " )
100
- g .contours .display (ax , only_unused = True , lw = 0.25 , display_criterion = True )
98
+ ax = start_axes ("Contours' rejection criteria " )
99
+ g .contours .display (ax , only_unused = True , lw = 0.5 , display_criterion = True )
101
100
update_axes (ax )
102
101
103
102
# %%
104
- # Display shape error of each tested contour, the limit of shape error is set to 55 %
103
+ # Display the shape error of each tested contour, the limit of shape error is set to 55 %
105
104
ax = start_axes ("Contour shape error" )
106
105
m = g .contours .display (
107
- ax , lw = 0.5 , field = "shape_error" , bins = arange (20 , 90.1 , 5 ), cmap = "seismic "
106
+ ax , lw = 0.5 , field = "shape_error" , bins = arange (20 , 90.1 , 5 ), cmap = "PRGn_r "
108
107
)
109
108
update_axes (ax , m )
110
109
111
110
# %%
112
- # Contours closed which contains several eddies
113
- ax = start_axes ("ADT contour reject but which contain eddies" )
111
+ # Some closed contours contains several eddies (aka, more than one extremum)
112
+ ax = start_axes ("ADT rejected contours containing eddies" )
114
113
g .contours .label_contour_unused_which_contain_eddies (a )
115
114
g .contours .label_contour_unused_which_contain_eddies (c )
116
115
g .contours .display (
117
- ax , only_contain_eddies = True , color = "k" , lw = 1 , label = "Could be interaction contour"
116
+ ax , only_contain_eddies = True , color = "k" , lw = 1 , label = "Could be a contour of interaction "
118
117
)
119
- a .display (ax , color = "r" , linewidth = 0.5 , label = "Anticyclonic" , ref = - 10 )
120
- c .display (ax , color = "b" , linewidth = 0.5 , label = "Cyclonic" , ref = - 10 )
118
+ a .display (ax , color = "r" , linewidth = 0.75 , label = "Anticyclonic" , ref = - 10 )
119
+ c .display (ax , color = "b" , linewidth = 0.75 , label = "Cyclonic" , ref = - 10 )
121
120
ax .legend ()
122
121
update_axes (ax )
123
122
124
123
# %%
125
124
# Output
126
125
# ------
127
- # Display detected eddies, dashed lines represent effective contour
128
- # and solid lines represent contour of maximum of speed. See figure 1 of https://doi.org/10.1175/JTECH-D-14-00019.1
126
+ # When displaying the detected eddies, dashed lines are for effective contour, solide lines for the contour of the maximum mean speed. See figure 1 of https://doi.org/10.1175/JTECH-D-14-00019.1
129
127
130
- ax = start_axes ("Eddies detected " )
131
- a .display (ax , color = "r" , linewidth = 0.5 , label = "Anticyclonic" , ref = - 10 )
132
- c .display (ax , color = "b" , linewidth = 0.5 , label = "Cyclonic" , ref = - 10 )
128
+ ax = start_axes ("Detected Eddies " )
129
+ a .display (ax , color = "r" , linewidth = 0.75 , label = "Anticyclonic" , ref = - 10 )
130
+ c .display (ax , color = "b" , linewidth = 0.75 , label = "Cyclonic" , ref = - 10 )
133
131
ax .legend ()
134
132
update_axes (ax )
135
133
136
134
# %%
137
- # Display speed radius of eddies detected
138
- ax = start_axes ("Eddies speed radius (km)" )
139
- a .scatter (ax , "radius_s" , vmin = 10 , vmax = 50 , s = 80 , ref = - 10 , cmap = "jet " , factor = 0.001 )
140
- m = c .scatter (ax , "radius_s" , vmin = 10 , vmax = 50 , s = 80 , ref = - 10 , cmap = "jet " , factor = 0.001 )
135
+ # Display the speed radius of the detected eddies
136
+ ax = start_axes ("Speed Radius (km)" )
137
+ a .scatter (ax , "radius_s" , vmin = 10 , vmax = 50 , s = 80 , ref = - 10 , cmap = "magma_r " , factor = 0.001 )
138
+ m = c .scatter (ax , "radius_s" , vmin = 10 , vmax = 50 , s = 80 , ref = - 10 , cmap = "magma_r " , factor = 0.001 )
141
139
update_axes (ax , m )
142
140
143
141
# %%
144
- # Display speed radius of eddies detected with filled eddy contours
145
- ax = start_axes ("Eddies speed radius (km)" )
142
+ # Filling the effective radius contours with the effective radius values
143
+ ax = start_axes ("Effective Radius (km)" )
146
144
kwargs = dict (vmin = 10 , vmax = 80 , cmap = "magma_r" , factor = 0.001 , lut = 14 , ref = - 10 )
147
145
a .filled (ax , "radius_e" , ** kwargs )
148
146
m = c .filled (
0 commit comments