@@ -44,7 +44,7 @@ def setup(self, cmap="jet", nb_step=25, figsize=(8, 6), **kwargs):
44
44
self .fig = pyplot .figure (figsize = figsize , ** kwargs )
45
45
t0 , t1 = self .period
46
46
self .fig .suptitle (f"{ t0 } -> { t1 } " )
47
- self .ax = self .fig .add_axes ((0.05 , 0.05 , 0.9 , 0.9 ))
47
+ self .ax = self .fig .add_axes ((0.05 , 0.05 , 0.9 , 0.9 ), projection = "full_axes" )
48
48
self .ax .set_xlim (x_min , x_max ), self .ax .set_ylim (y_min , y_max )
49
49
self .ax .set_aspect ("equal" )
50
50
self .ax .grid ()
@@ -192,6 +192,11 @@ def anim():
192
192
parser .add_argument (
193
193
"--infinity_loop" , action = "store_true" , help = "Press Escape key to stop loop"
194
194
)
195
+ parser .add_argument (
196
+ "--first_centered" ,
197
+ action = "store_true" ,
198
+ help = "Longitude will be centered on first obs, if there are only one group." ,
199
+ )
195
200
args = parser .parse_args ()
196
201
variables = ["time" , "track" , "longitude" , "latitude" ]
197
202
variables .extend (TrackEddiesObservations .intern (args .intern , public_label = True ))
@@ -203,6 +208,14 @@ def anim():
203
208
"You need to specify id to display or ask explicity all with --all option"
204
209
)
205
210
eddies = eddies .extract_ids (args .id )
211
+ if args .first_centered :
212
+ # TODO: include observatin class
213
+ x0 = eddies .lon [0 ]
214
+ eddies .lon [:] = (eddies .lon - x0 + 180 ) % 360 + x0 - 180
215
+ eddies .contour_lon_e [:] = (
216
+ (eddies .contour_lon_e .T - eddies .lon + 180 ) % 360 + eddies .lon - 180
217
+ ).T
218
+
206
219
a = Anim (
207
220
eddies ,
208
221
intern = args .intern ,
@@ -217,6 +230,7 @@ def gui_parser():
217
230
parser = EddyParser ("Eddy atlas GUI" )
218
231
parser .add_argument ("atlas" , nargs = "+" )
219
232
parser .add_argument ("--med" , action = "store_true" )
233
+ parser .add_argument ("--nopath" , action = "store_true" , help = "Don't draw path" )
220
234
return parser .parse_args ()
221
235
222
236
@@ -228,4 +242,5 @@ def guieddy():
228
242
g = GUI (** atlas )
229
243
if args .med :
230
244
g .med ()
245
+ g .hide_path (not args .nopath )
231
246
g .show ()
0 commit comments