Skip to content

Commit

Permalink
moving carq_ref to above holland B calculation and just using that to…
Browse files Browse the repository at this point in the history
… compute it instead of needing to take the nanmean
  • Loading branch information
WPringle committed Aug 5, 2024
1 parent 9ebe0bc commit 09ee041
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions stormevents/nhc/track.py
Original file line number Diff line number Diff line change
Expand Up @@ -1270,16 +1270,17 @@ def clamp(n, minn, maxn):
else:
carq_forecast = carq_tracks[list(carq_tracks)[0]]

# Get CARQ from forecast hour 0 and isotach 34kt (i.e. the first item)
carq_ref = carq_forecast.loc[carq_forecast.forecast_hours == 0].iloc[0]

# get the Holland B parameter for filling in central pressure
relation = HollandBRelation()
holland_b = relation.holland_b(
max_sustained_wind_speed=carq_forecast["max_sustained_wind_speed"],
background_pressure=carq_forecast["background_pressure"],
central_pressure=carq_forecast["central_pressure"],
max_sustained_wind_speed=carq_ref["max_sustained_wind_speed"],
background_pressure=carq_ref["background_pressure"],
central_pressure=carq_ref["central_pressure"],
)

holland_b[holland_b == numpy.inf] = numpy.nan
holland_b = numpy.nanmean(holland_b)

# Get CARQ from forecast hour 0 and isotach 34kt (i.e. the first item)
carq_ref = carq_forecast.loc[carq_forecast.forecast_hours == 0].iloc[0]

Expand Down

0 comments on commit 09ee041

Please sign in to comment.