stilt.observations.plumes.kernel_density#
- stilt.observations.plumes.kernel_density(longitudes, latitudes, *, bandwidth=(0.1, 0.15), n=100)[source]#
Return the Gaussian kernel density of points on an
nbyngrid.As in R’s
MASS::kde2d, the kernel’s standard deviation is a quarter ofbandwidthin each direction, so the defaults give 0.025° in longitude and 0.0375° in latitude. The grid spans the points plus one bandwidth on every side. The density is scaled to a maximum of 1.- Parameters:
longitudes (
TypeAliasType) – Point positions, in degrees. Non-finite positions are dropped.latitudes (
TypeAliasType) – Point positions, in degrees. Non-finite positions are dropped.bandwidth (
tuple[float,float]) – Bandwidth in longitude and latitude, in degrees.n (
int) – Number of grid points in each direction.
- Returns:
Density on
latandlon.- Return type: