@@ -440,7 +440,8 @@ def bounds(self):
440
440
return self .x_bounds .min (), self .x_bounds .max (), self .y_bounds .min (), self .y_bounds .max ()
441
441
442
442
def eddy_identification (self , grid_height , uname , vname , date , step = 0.005 , shape_error = 55 ,
443
- array_sampling = 50 , pixel_limit = None , precision = None ):
443
+ array_sampling = 50 , pixel_limit = None , precision = None , force_height_unit = None ,
444
+ force_speed_unit = None ):
444
445
"""
445
446
446
447
Args:
@@ -467,7 +468,8 @@ def eddy_identification(self, grid_height, uname, vname, date, step=0.005, shape
467
468
self .init_speed_coef (uname , vname )
468
469
469
470
# Get unit of h grid
470
- h_units = self .units (grid_height )
471
+
472
+ h_units = self .units (grid_height ) if force_height_unit is None else force_height_unit
471
473
units = UnitRegistry ()
472
474
in_h_unit = units .parse_expression (h_units )
473
475
if in_h_unit is not None :
@@ -653,7 +655,8 @@ def eddy_identification(self, grid_height, uname, vname, date, step=0.005, shape
653
655
factor , _ = in_h_unit .to (out_unit ).to_tuple ()
654
656
a_and_c [0 ].obs [name ] *= factor
655
657
a_and_c [1 ].obs [name ] *= factor
656
- in_u_units = units .parse_expression (self .units (uname ))
658
+ u_units = self .units (uname ) if force_speed_unit is None else force_speed_unit
659
+ in_u_units = units .parse_expression (u_units )
657
660
if in_u_units is not None :
658
661
for name in ['speed_average' , 'uavg_profile' ]:
659
662
out_unit = units .parse_expression (VAR_DESCR [name ]['nc_attr' ]['units' ])
0 commit comments