spatio_temporal.py — dlmhelper 1.0 documentation

# spatio_temporal.py

This module handles operations on spatio temporal data

dlmhelper.spatio_temporal.inhomogeneity_spatial(lat: ndarray, lon: ndarray, N: ndarray, scale_lat: float | None = None, scale_lon: float | None = None) → ndarray

  Calculate the inhomogeneity for a spatial grid of data. Based on Sofieva et al., 2014 (https://doi.org/10.5194/amt-7-1891-2014)

  Parameters:

    - lat (np.ndarray) – Lower latitude bounds of grid cells of shape (lat)

    - lon (np.ndarray) – Lower longitude bounds of grid cells of shape (lon)

    - N (np.ndarry) – Number of measurements per cell of shape (lat, lon, time)

    - scale_lat (float) – Weight of the latitudinal part of the spatial inhomogeneity, if not specified lat and lon part will be equally weighted, defaults to None

    - scale_lon (float) – Weight of the longitudinal part of the spatial inhomogeneity, if not specified lat and lon part will be equally weighted, defaults to None

  Returns:

    Array of shape (time, 3), aach row contains the inhomogeneity, asymmetry component, and entropy component for the corresponding time step in N.

  Return type:

    np.ndarray

dlmhelper.spatio_temporal.inhomogeneity_temporal(lat: ndarray, lon: ndarray, time: ndarray, N: ndarray) → ndarray

  Calculate the temporal inhomogeneity of data at each grid point. Based on Sofieva et al., 2014 (https://doi.org/10.5194/amt-7-1891-2014)

  Parameters:

    - lat (np.ndarray) – Lower latitude bounds of grid cells of shape (lat)

    - lon (np.ndarray) – Lower longitude bounds of grid cells of shape (lon)

    - time (np.ndarray) – Time values of shape (time)

    - N (np.ndarry) – Number of measurements per cell of shape (lat, lon, time)

  Returns:

    Array of temporal homogeneity values at each grid point, with shape (lat, lon, 3). The last dimension contains the temporal inhomogeneity, asymmetry component, and entropy component.

  Return type:

    np.ndarray: