huracanpy.calc.density#
- huracanpy.calc.density(lon, lat, method='histogram', bin_size=5, lon_range=None, lat_range=(-90, 90), crop=False, function_kws={})[source]#
Function to compute the track density, based on a simple 2D histogram.
- Parameters:
lon (array_like) – longitude series
lat (array_like) – latitude series
method (str, default="histogram") – The method used to calculate the density, currently “histogram” or “kde”, which gives a 2d histogram using np.histogram2d
bin_size (int or float, default=5) – When using histogram, defines the size (in degrees) of the bins.
lon_range (tuple, default) – The maximum and minimum longitude to calculate the density over. If None, then it is set to global: (-180, 180) or (0, 360) depending on the input data
lat_range (tuple, default=(-90, 90)) – The maximum and minimum latitude to calculate the density over.
crop (bool, default=False) – If True crop the result to remove any outer bounds that only have zero density
function_kws (dict) –
Keyword arguments passed to the function used for calculating density
If method=”histogram”, numpy.histogram2d
If method=”kde”, scipy.stats.gaussian_kde
- Raises:
NotImplementedError – If method given is not ‘histogram’ or ‘kde’
- Returns:
Track density as a 2D map.
- Return type: