@@ -20,7 +20,7 @@ def start_axes(title):
2020 ax = fig .add_axes ([0.03 , 0.03 , 0.90 , 0.94 ])
2121 ax .set_xlim (- 6 , 36.5 ), ax .set_ylim (30 , 46 )
2222 ax .set_aspect ("equal" )
23- ax .set_title (title )
23+ ax .set_title (title , weight = 'bold' )
2424 return ax
2525
2626
@@ -31,118 +31,116 @@ def update_axes(ax, mappable=None):
3131
3232
3333# %%
34- # Load Input grid, ADT will be used to detect eddies
34+ # Load Input grid, ADT is used to detect eddies
3535g = RegularGridDataset (
3636 data .get_path ("dt_med_allsat_phy_l4_20160515_20190101.nc" ), "longitude" , "latitude"
3737)
3838
3939ax = 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" )
4141update_axes (ax , m )
4242
4343# %%
44- # Get u/ v
44+ # Get geostrophic speed u, v
4545# -------
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°)
4747g .add_uv ("adt" )
4848ax = start_axes ("U/V deduce from ADT (m)" )
4949ax .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" )
5151u , v = g .grid ("u" ).T , g .grid ("v" ).T
5252ax .quiver (g .x_c , g .y_c , u , v , scale = 10 )
5353update_axes (ax , m )
5454
5555# %%
5656# Pre-processings
5757# ---------------
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
5959g .bessel_high_filter ("adt" , 500 )
6060ax = 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" )
6262update_axes (ax , m )
6363
6464# %%
6565# Identification
6666# --------------
67- # run identification with slice of 2 mm
67+ # Run the identification step with slices of 2 mm
6868date = datetime (2016 , 5 , 15 )
6969a , c = g .eddy_identification ("adt" , "u" , "v" , date , 0.002 , shape_error = 55 )
7070
7171# %%
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)" )
7474g .contours .display (ax , step = 4 )
7575update_axes (ax )
7676
7777# %%
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" )
8080g .contours .display (ax , only_used = True )
8181update_axes (ax )
8282
8383# %%
84- # Post analyse
84+ # Post analysis
8585# ------------
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 " )
8888g .contours .display (ax , only_unused = True )
8989update_axes (ax )
9090
9191# %%
92- # Contours reject criterion
93- #
92+ # Creteria for rejecting a contour
9493# 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)
9897# 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 )
101100update_axes (ax )
102101
103102# %%
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 %
105104ax = start_axes ("Contour shape error" )
106105m = 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 "
108107)
109108update_axes (ax , m )
110109
111110# %%
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" )
114113g .contours .label_contour_unused_which_contain_eddies (a )
115114g .contours .label_contour_unused_which_contain_eddies (c )
116115g .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 "
118117)
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 )
121120ax .legend ()
122121update_axes (ax )
123122
124123# %%
125124# Output
126125# ------
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
129127
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 )
133131ax .legend ()
134132update_axes (ax )
135133
136134# %%
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 )
141139update_axes (ax , m )
142140
143141# %%
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)" )
146144kwargs = dict (vmin = 10 , vmax = 80 , cmap = "magma_r" , factor = 0.001 , lut = 14 , ref = - 10 )
147145a .filled (ax , "radius_e" , ** kwargs )
148146m = c .filled (
0 commit comments