@@ -44,7 +44,7 @@ def setup(self, cmap="jet", nb_step=25, figsize=(8, 6), **kwargs):
4444 self .fig = pyplot .figure (figsize = figsize , ** kwargs )
4545 t0 , t1 = self .period
4646 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" )
4848 self .ax .set_xlim (x_min , x_max ), self .ax .set_ylim (y_min , y_max )
4949 self .ax .set_aspect ("equal" )
5050 self .ax .grid ()
@@ -192,6 +192,11 @@ def anim():
192192 parser .add_argument (
193193 "--infinity_loop" , action = "store_true" , help = "Press Escape key to stop loop"
194194 )
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+ )
195200 args = parser .parse_args ()
196201 variables = ["time" , "track" , "longitude" , "latitude" ]
197202 variables .extend (TrackEddiesObservations .intern (args .intern , public_label = True ))
@@ -203,6 +208,14 @@ def anim():
203208 "You need to specify id to display or ask explicity all with --all option"
204209 )
205210 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+
206219 a = Anim (
207220 eddies ,
208221 intern = args .intern ,
@@ -217,6 +230,7 @@ def gui_parser():
217230 parser = EddyParser ("Eddy atlas GUI" )
218231 parser .add_argument ("atlas" , nargs = "+" )
219232 parser .add_argument ("--med" , action = "store_true" )
233+ parser .add_argument ("--nopath" , action = "store_true" , help = "Don't draw path" )
220234 return parser .parse_args ()
221235
222236
@@ -228,4 +242,5 @@ def guieddy():
228242 g = GUI (** atlas )
229243 if args .med :
230244 g .med ()
245+ g .hide_path (not args .nopath )
231246 g .show ()
0 commit comments