11
11
12
12
def ace (
13
13
wind ,
14
- aggregate_by = None ,
14
+ sum_by = None ,
15
15
threshold = 34 * units ("knots" ),
16
16
wind_units = "m s-1" ,
17
17
):
@@ -20,11 +20,11 @@ def ace(
20
20
.. math:: \mathrm{ACE} = 10^{-4} \sum v_\mathrm{max}^2 \quad (v_\mathrm{max} \ge 34 \mathrm{kn})
21
21
22
22
By default, this function will return the "ACE" for each individual point in `wind`.
23
- To calculate more useful quantities of ACE, use the `aggregate_by ` keyword.
23
+ To calculate more useful quantities of ACE, use the `sum_by ` keyword.
24
24
25
25
For example, to calculate the ACE of each individual track, doing
26
26
27
- >>> ace_by_track = huracanpy.tc.ace(tracks.wind, aggregate_by =tracks.track_id)
27
+ >>> ace_by_track = huracanpy.tc.ace(tracks.wind, sum_by =tracks.track_id)
28
28
29
29
will return a DataArray with track_id as a coordinate and the sum of ACE for each
30
30
track as the data. Note that this is equivalent to using groupby:
@@ -38,13 +38,13 @@ def ace(
38
38
39
39
Similarly to calculate a climatological mean ACE by year, run
40
40
41
- >>> climatological_ace = huracanpy.tc.ace(tracks.wind, aggregate_by =tracks.time.dt.year).mean()
41
+ >>> climatological_ace = huracanpy.tc.ace(tracks.wind,sum_by =tracks.time.dt.year).mean()
42
42
43
43
Parameters
44
44
----------
45
45
wind : array_like
46
46
Maximum velocity of a tropical cyclone associated with the tracks dataset
47
- aggregate_by : array_like
47
+ sum_by : array_like
48
48
Variable to take the sum of ACE values across. Must have the same length as wind
49
49
threshold : scalar, default=34 knots
50
50
ACE is set to zero below this threshold wind speed. The default argument is in
@@ -64,8 +64,8 @@ def ace(
64
64
65
65
ace_values = get_ace (wind , threshold , wind_units )
66
66
67
- if aggregate_by is not None :
68
- ace_values = ace_values .groupby (aggregate_by ).sum ()
67
+ if sum_by is not None :
68
+ ace_values = ace_values .groupby (sum_by ).sum ()
69
69
70
70
return ace_values
71
71
@@ -74,7 +74,7 @@ def pace(
74
74
pressure ,
75
75
wind = None ,
76
76
model = None ,
77
- aggregate_by = None ,
77
+ sum_by = None ,
78
78
threshold_wind = None ,
79
79
threshold_pressure = None ,
80
80
wind_units = "m s-1" ,
@@ -108,7 +108,7 @@ def pace(
108
108
pressure : array_like
109
109
wind : array_like, optional
110
110
model : str, class, or object, optional
111
- aggregate_by : array_like
111
+ sum_by : array_like
112
112
Variable to take the sum of PACE values across. Must have the same length as
113
113
pressure/wind. For examples, see the documentation for `huracanpy.tc.ace`
114
114
threshold_wind : scalar, optional
@@ -133,8 +133,8 @@ def pace(
133
133
** kwargs ,
134
134
)
135
135
136
- if aggregate_by is not None :
137
- pace_values = pace_values .groupby (aggregate_by ).sum ()
136
+ if sum_by is not None :
137
+ pace_values = pace_values .groupby (sum_by ).sum ()
138
138
139
139
return pace_values , model
140
140
0 commit comments