huracanpy.tc.pace#
- huracanpy.tc.pace(pressure, wind=None, model=None, sum_by=None, threshold_wind=None, threshold_pressure=None, wind_units='m s-1', pressure_units='hPa', **kwargs)[source]#
- Calculate a pressure-based accumulated cyclone energy (PACE) for each individual
point
PACE is calculated the same way as ACE, but the wind is derived from fitting a pressure-wind relationship and calculating wind values from pressure using this fit
Example
This function can be called in two ways
1. Pass the pressure and wind to fit a pressure-wind relationship to the data and then calculate pace from the winds derived from this fit
>>> pace, pw_model = get_pace(pressure, wind)
The default model to fit is a quadratic polynomial (
numpy.polynomial.polynomial.Polynomialwith deg=2)2. Pass just the pressure and an already fit model to calculate the wind speeds from this model
>>> pace, _ = get_pace(pressure, model=pw_model)
- Parameters:
pressure (array_like) – Cyclone minimum sea-level pressure
wind (array_like, optional) – Cyclone wind. Only include if you want to train a model to fit the pressure-wind relation
model (str, class, or object, optional) – The model to fit the pressure wind relation or a model with preset parameters to derive wind from pressure. Can also be set to “z2021” or “holland” for those preset models. The object must have a fit function that returns a trained model, consistent with numpy and scikit-learn models. Default is py:class:numpy.polynomial.polynomial.Polynomial with deg=2
sum_by (array_like) – Variable to take the sum of PACE values across. Must have the same length as pressure/wind. For examples, see the documentation for huracanpy.tc.ace
threshold_wind (scalar, optional) – PACE is set to zero below this threshold wind speed
threshold_pressure (scalar, optional) – Similar to threshold wind, set PACE to zero where pressure is above this threshold
wind_units (str, default="m s-1") – If the units of wind are not specified in the attributes then the function will assume it is in these units before converting to knots
pressure_units (str, default="hPa") – If the units of pressure are not specified in the attributes then the function will assume it is in these units
**kwargs – Remaining keywords are passed to the fit function of the model
- Returns:
Array of pace_values and the trained model for mapping from pressure values to wind values from
pressure_wind_relation()- Return type: