4
4
5
5
Script will detect eddies on adt field, and compute u,v with method add_uv(which could use, only if equator is avoid)
6
6
7
+ Figures will show different step to detect eddies.
8
+
7
9
"""
8
10
from datetime import datetime
9
11
from matplotlib import pyplot as plt
12
14
13
15
14
16
def start_axes (title ):
15
- fig = plt .figure (figsize = (12.5 , 5 ))
16
- ax = fig .add_axes ([0.03 , 0.03 , 0.94 , 0.94 ])
17
- ax .set_xlim (- 5 , 37 )
18
- ax .set_ylim (30 , 46 )
17
+ fig = plt .figure (figsize = (13 , 5 ))
18
+ ax = fig .add_axes ([0.03 , 0.03 , 0.90 , 0.94 ])
19
+ ax .set_xlim (- 6 , 36.5 ), ax .set_ylim (30 , 46 )
19
20
ax .set_aspect ("equal" )
20
21
ax .set_title (title )
21
22
return ax
@@ -31,14 +32,21 @@ def update_axes(ax, mappable=None):
31
32
data .get_path ("dt_med_allsat_phy_l4_20160515_20190101.nc" ), "longitude" , "latitude"
32
33
)
33
34
34
- ax = start_axes ("ADT(m)" )
35
+ ax = start_axes ("ADT (m)" )
35
36
m = g .display (ax , "adt" , vmin = - 0.15 , vmax = 0.15 )
36
37
update_axes (ax , m )
37
38
38
39
g .add_uv ("adt" )
40
+ ax = start_axes ("U/V deduce from ADT (m)" )
41
+ ax .set_xlim (2.5 , 9 ), ax .set_ylim (37.5 , 40 )
42
+ m = g .display (ax , "adt" , vmin = - 0.15 , vmax = 0.15 )
43
+ u , v = g .grid ("u" ).T , g .grid ("v" ).T
44
+ ax .quiver (g .x_c , g .y_c , u , v , scale = 10 )
45
+ update_axes (ax , m )
46
+
39
47
g .bessel_high_filter ("adt" , 500 , order = 2 )
40
48
41
- ax = start_axes ("ADT (m) filtered(500km, order 2)" )
49
+ ax = start_axes ("ADT (m) filtered (500km, order 2)" )
42
50
m = g .display (ax , "adt" , vmin = - 0.15 , vmax = 0.15 )
43
51
update_axes (ax , m )
44
52
@@ -60,19 +68,21 @@ def update_axes(ax, mappable=None):
60
68
ax = start_axes ("ADT contour reject but which contain eddies" )
61
69
g .contours .label_contour_unused_which_contain_eddies (a )
62
70
g .contours .label_contour_unused_which_contain_eddies (c )
63
- g .contours .display (ax , only_contain_eddies = True , color = "k" , lw = 1 , label = "Could be interaction contour" )
64
- a .display (ax , color = "b" , linewidth = 0.5 , label = "Anticyclonic" , ref = - 10 )
65
- c .display (ax , color = "r" , linewidth = 0.5 , label = "Cyclonic" , ref = - 10 )
71
+ g .contours .display (
72
+ ax , only_contain_eddies = True , color = "k" , lw = 1 , label = "Could be interaction contour"
73
+ )
74
+ a .display (ax , color = "r" , linewidth = 0.5 , label = "Anticyclonic" , ref = - 10 )
75
+ c .display (ax , color = "b" , linewidth = 0.5 , label = "Cyclonic" , ref = - 10 )
66
76
ax .legend ()
67
77
update_axes (ax )
68
78
69
79
ax = start_axes ("Eddies detected" )
70
- a .display (ax , color = "b " , linewidth = 0.5 , label = "Anticyclonic" , ref = - 10 )
71
- c .display (ax , color = "r " , linewidth = 0.5 , label = "Cyclonic" , ref = - 10 )
80
+ a .display (ax , color = "r " , linewidth = 0.5 , label = "Anticyclonic" , ref = - 10 )
81
+ c .display (ax , color = "b " , linewidth = 0.5 , label = "Cyclonic" , ref = - 10 )
72
82
ax .legend ()
73
83
update_axes (ax )
74
84
75
85
ax = start_axes ("Eddies speed radius (km)" )
76
- a .scatter (ax , "radius_s" , vmin = 10 , vmax = 50 , s = 80 , ref = - 10 , cmap = ' jet' , factor = 0.001 )
77
- m = c .scatter (ax , "radius_s" , vmin = 10 , vmax = 50 , s = 80 , ref = - 10 , cmap = ' jet' , factor = 0.001 )
86
+ a .scatter (ax , "radius_s" , vmin = 10 , vmax = 50 , s = 80 , ref = - 10 , cmap = " jet" , factor = 0.001 )
87
+ m = c .scatter (ax , "radius_s" , vmin = 10 , vmax = 50 , s = 80 , ref = - 10 , cmap = " jet" , factor = 0.001 )
78
88
update_axes (ax , m )
0 commit comments