44
55Script will detect eddies on adt field, and compute u,v with method add_uv(which could use, only if equator is avoid)
66
7+ Figures will show different step to detect eddies.
8+
79"""
810from datetime import datetime
911from matplotlib import pyplot as plt
1214
1315
1416def 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 )
1920 ax .set_aspect ("equal" )
2021 ax .set_title (title )
2122 return ax
@@ -31,14 +32,21 @@ def update_axes(ax, mappable=None):
3132 data .get_path ("dt_med_allsat_phy_l4_20160515_20190101.nc" ), "longitude" , "latitude"
3233)
3334
34- ax = start_axes ("ADT(m)" )
35+ ax = start_axes ("ADT (m)" )
3536m = g .display (ax , "adt" , vmin = - 0.15 , vmax = 0.15 )
3637update_axes (ax , m )
3738
3839g .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+
3947g .bessel_high_filter ("adt" , 500 , order = 2 )
4048
41- ax = start_axes ("ADT (m) filtered(500km, order 2)" )
49+ ax = start_axes ("ADT (m) filtered (500km, order 2)" )
4250m = g .display (ax , "adt" , vmin = - 0.15 , vmax = 0.15 )
4351update_axes (ax , m )
4452
@@ -60,19 +68,21 @@ def update_axes(ax, mappable=None):
6068ax = start_axes ("ADT contour reject but which contain eddies" )
6169g .contours .label_contour_unused_which_contain_eddies (a )
6270g .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 )
6676ax .legend ()
6777update_axes (ax )
6878
6979ax = 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 )
7282ax .legend ()
7383update_axes (ax )
7484
7585ax = 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 )
7888update_axes (ax , m )
0 commit comments