@@ -2870,18 +2870,23 @@ def _zlib_from_dataarray(data_var: xr.DataArray) -> bool:
2870
2870
2871
2871
2872
2872
def compute_track_density (
2873
- tc_track : TCTracks , res : int = 5 , time_step : float = 0.5 , mode : str = "normalized "
2873
+ tc_track : TCTracks , res : int = 5 , time_step : float = 1 , mode : str = "absolute "
2874
2874
) -> tuple [np .ndarray , tuple ]:
2875
- """Compute absolute and normalized tropical cyclone track density as the number of points per
2876
- grid cell.
2875
+ """Compute absolute and normalized tropical cyclone track density. First, the function ensure
2876
+ the same temporal resolution of all tracks by calling :py:meth:`equal_timestep`. Second, it
2877
+ creates 2D bins of the specified resolution (e.g. 1° x 1°). Third, since tracks are not lines
2878
+ but a series of points, it counts the number of points per bin. Lastly, it returns the absolute
2879
+ or normalized count per bin. This function works under the hood of :py:meth:`plot_track_density`
2880
+ but can be used separtly as input data for more sophisticated track density plots.
2881
+
2877
2882
Parameters:
2878
2883
----------
2879
- res: int (optional)
2884
+ res: int (optional) Default: 5°
2880
2885
resolution in degrees of the grid bins in which the density will be computed
2881
- time_step: float (optional)
2886
+ time_step: float (optional) default: 1h
2882
2887
temporal resolution in hours to be apllied to the tracks, to ensure that every track
2883
2888
will have the same resolution.
2884
- mode: str (optional)
2889
+ mode: str (optional) default: absolute
2885
2890
"normalized" or "absolute" density
2886
2891
2887
2892
Returns:
0 commit comments