@@ -83,8 +83,15 @@ def _initialize_polar(ax=None, metadata=None, flood=None, ebb=None):
8383 return ax
8484
8585
86- def plot_rose (directions , velocities , width_dir , width_vel , metadata = None ,
87- flood = None , ebb = None ):
86+ def plot_rose (
87+ directions ,
88+ velocities ,
89+ width_dir ,
90+ width_vel ,
91+ metadata = None ,
92+ flood = None ,
93+ ebb = None
94+ ):
8895 """
8996 Creates a polar histogram. Direction angles from binned histogram must
9097 be specified such that 0 degrees is north.
@@ -173,9 +180,15 @@ def plot_rose(directions, velocities, width_dir, width_vel, metadata=None,
173180 return ax
174181
175182
176- def plot_joint_probability_distribution (directions , velocities , width_dir ,
177- width_vel , metadata = None ,
178- flood = None , ebb = None ):
183+ def plot_joint_probability_distribution (
184+ directions ,
185+ velocities ,
186+ width_dir ,
187+ width_vel ,
188+ metadata = None ,
189+ flood = None ,
190+ ebb = None
191+ ):
179192 """
180193 Creates a polar histogram. Direction angles from binned histogram must
181194 be specified such that 0 is north.
@@ -315,8 +328,15 @@ def plot_current_timeseries(directions, velocities, principal_direction,
315328 xlabel = 'Time' , ylabel = 'Velocity [$m/s$]' , ax = ax )
316329 return ax
317330
318- def tidal_phase_probability (directions , velocities , flood , ebb ,
319- bin_size = 0.1 , ax = None ):
331+
332+ def tidal_phase_probability (
333+ directions ,
334+ velocities ,
335+ flood ,
336+ ebb ,
337+ bin_size = 0.1 ,
338+ ax = None
339+ ):
320340 '''
321341 Discretizes the tidal series speed by bin size and returns a plot
322342 of the probability for each bin in the flood or ebb tidal phase.
@@ -353,17 +373,17 @@ def tidal_phase_probability(directions, velocities, flood, ebb,
353373 assert isinstance (ebb , (int , float )), \
354374 'ebb must be of type int or float'
355375 assert isinstance (bin_size , (int , float )), \
356- 'bin_size must be of type int or float'
376+ 'bin_size must be of type int or float'
357377 assert flood >= 0 and flood <= 360 ,\
358378 'flood must be between 0 and 360 degrees'
359379 assert ebb >= 0 and ebb <= 360 ,\
360- 'ebb must be between 0 and 360 degrees'
380+ 'ebb must be between 0 and 360 degrees'
361381 assert bin_size >= 0 ,\
362- 'bin_size must be greater than 0'
363-
382+ 'bin_size must be greater than 0'
383+
364384 if ax == None :
365385 fig , ax = plt .subplots (figsize = (12 , 8 ))
366-
386+
367387 isEbb = _flood_or_ebb (directions , flood , ebb )
368388
369389 decimals = round (bin_size / 0.1 )
@@ -394,13 +414,18 @@ def tidal_phase_probability(directions, velocities, flood, ebb,
394414 plt .ylim (0 ,1.0 )
395415 plt .legend ()
396416 plt .grid (linestyle = ':' )
397-
417+
398418 return ax
399-
400419
401420
402- def tidal_phase_exceedance (directions , velocities , flood , ebb ,
403- bin_size = 0.1 , ax = None ):
421+ def tidal_phase_exceedance (
422+ directions ,
423+ velocities ,
424+ flood ,
425+ ebb ,
426+ bin_size = 0.1 ,
427+ ax = None
428+ ):
404429 '''
405430 Returns a stacked area plot of the exceedance probability for the
406431 flood and ebb tidal phases.
0 commit comments