@@ -11,7 +11,7 @@ Load data
11
11
12
12
raw = RegularGridDataset(grid_name, lon_name, lat_name)
13
13
filtered = RegularGridDataset(grid_name, lon_name, lat_name)
14
- filtered.bessel_low_filter(' adt' , 150 , order = 3 )
14
+ filtered.bessel_low_filter(" adt" , 150 , order = 3 )
15
15
16
16
areas = dict (
17
17
sud_pacific = dict (llcrnrlon = 188 , urcrnrlon = 280 , llcrnrlat = - 64 , urcrnrlat = - 7 ),
@@ -23,24 +23,34 @@ Compute and display spectrum
23
23
24
24
.. code-block :: python
25
25
26
- fig = plt.figure(figsize = (10 ,6 ))
26
+ fig = plt.figure(figsize = (10 , 6 ))
27
27
ax = fig.add_subplot(111 )
28
- ax.set_title(' Spectrum' )
29
- ax.set_xlabel(' km ' )
28
+ ax.set_title(" Spectrum" )
29
+ ax.set_xlabel(" km " )
30
30
for name_area, area in areas.items():
31
31
32
- lon_spec, lat_spec = raw.spectrum_lonlat(' adt' , area = area)
33
- mappable = ax.loglog(* lat_spec, label = ' lat %s raw' % name_area)[0 ]
34
- ax.loglog(* lon_spec, label = ' lon %s raw' % name_area, color = mappable.get_color(), linestyle = ' --' )
35
-
36
- lon_spec, lat_spec = filtered.spectrum_lonlat(' adt' , area = area)
37
- mappable = ax.loglog(* lat_spec, label = ' lat %s high' % name_area)[0 ]
38
- ax.loglog(* lon_spec, label = ' lon %s high' % name_area, color = mappable.get_color(), linestyle = ' --' )
39
-
40
- ax.set_xscale(' log' )
32
+ lon_spec, lat_spec = raw.spectrum_lonlat(" adt" , area = area)
33
+ mappable = ax.loglog(* lat_spec, label = " lat %s raw" % name_area)[0 ]
34
+ ax.loglog(
35
+ * lon_spec,
36
+ label = " lon %s raw" % name_area,
37
+ color = mappable.get_color(),
38
+ linestyle = " --"
39
+ )
40
+
41
+ lon_spec, lat_spec = filtered.spectrum_lonlat(" adt" , area = area)
42
+ mappable = ax.loglog(* lat_spec, label = " lat %s high" % name_area)[0 ]
43
+ ax.loglog(
44
+ * lon_spec,
45
+ label = " lon %s high" % name_area,
46
+ color = mappable.get_color(),
47
+ linestyle = " --"
48
+ )
49
+
50
+ ax.set_xscale(" log" )
41
51
ax.legend()
42
52
ax.grid()
43
- fig.savefig(' share/png/spectrum.png' )
53
+ fig.savefig(" share/png/spectrum.png" )
44
54
45
55
46
56
.. image :: ../share/png/spectrum.png
@@ -49,18 +59,23 @@ Compute and display spectrum ratio
49
59
50
60
.. code-block :: python
51
61
52
- fig = plt.figure(figsize = (10 ,6 ))
62
+ fig = plt.figure(figsize = (10 , 6 ))
53
63
ax = fig.add_subplot(111 )
54
- ax.set_title(' Spectrum ratio' )
55
- ax.set_xlabel(' km ' )
64
+ ax.set_title(" Spectrum ratio" )
65
+ ax.set_xlabel(" km " )
56
66
for name_area, area in areas.items():
57
- lon_spec, lat_spec = filtered.spectrum_lonlat(' adt' , area = area, ref = raw)
58
- mappable = ax.plot(* lat_spec, label = ' lat %s high' % name_area)[0 ]
59
- ax.plot(* lon_spec, label = ' lon %s high' % name_area, color = mappable.get_color(), linestyle = ' --' )
60
-
61
- ax.set_xscale(' log' )
67
+ lon_spec, lat_spec = filtered.spectrum_lonlat(" adt" , area = area, ref = raw)
68
+ mappable = ax.plot(* lat_spec, label = " lat %s high" % name_area)[0 ]
69
+ ax.plot(
70
+ * lon_spec,
71
+ label = " lon %s high" % name_area,
72
+ color = mappable.get_color(),
73
+ linestyle = " --"
74
+ )
75
+
76
+ ax.set_xscale(" log" )
62
77
ax.legend()
63
78
ax.grid()
64
- fig.savefig(' share/png/spectrum_ratio.png' )
79
+ fig.savefig(" share/png/spectrum_ratio.png" )
65
80
66
81
.. image :: ../share/png/spectrum_ratio.png
0 commit comments