Skip to content

Commit 1fe2bee

Browse files
committed
moving carq_ref to above holland B calculation and just using that to compute it instead of needing to take the nanmean
1 parent bcb1948 commit 1fe2bee

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

stormevents/nhc/track.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,16 +1298,17 @@ def clamp(n, minn, maxn):
12981298
else:
12991299
carq_forecast = carq_tracks[list(carq_tracks)[0]]
13001300

1301+
# Get CARQ from forecast hour 0 and isotach 34kt (i.e. the first item)
1302+
carq_ref = carq_forecast.loc[carq_forecast.forecast_hours == 0].iloc[0]
1303+
1304+
# get the Holland B parameter for filling in central pressure
13011305
relation = HollandBRelation()
13021306
holland_b = relation.holland_b(
1303-
max_sustained_wind_speed=carq_forecast["max_sustained_wind_speed"],
1304-
background_pressure=carq_forecast["background_pressure"],
1305-
central_pressure=carq_forecast["central_pressure"],
1307+
max_sustained_wind_speed=carq_ref["max_sustained_wind_speed"],
1308+
background_pressure=carq_ref["background_pressure"],
1309+
central_pressure=carq_ref["central_pressure"],
13061310
)
13071311

1308-
holland_b[holland_b == numpy.inf] = numpy.nan
1309-
holland_b = numpy.nanmean(holland_b)
1310-
13111312
# Get CARQ from forecast hour 0 and isotach 34kt (i.e. the first item)
13121313
carq_ref = carq_forecast.loc[carq_forecast.forecast_hours == 0].iloc[0]
13131314

0 commit comments

Comments
 (0)