environmentaltools.spatiotemporal.bme.apply_data_smoothing

environmentaltools.spatiotemporal.bme.apply_data_smoothing(dfh, dfs, dfk, nmax, dmax, path)[source]

Apply spatial smoothing to hard and soft data.

Performs kernel smoothing on spatiotemporal data to reduce noise and normalize values for BME analysis.

Parameters:
  • dfh (pd.DataFrame) – Hard data with columns [‘x’, ‘y’, ‘t’, ‘h’].

  • dfs (pd.DataFrame) – Soft data with columns [‘x’, ‘y’, ‘t’, ‘h’].

  • dfk (pd.DataFrame) – Estimation points with columns [‘x’, ‘y’, ‘t’].

  • nmax (list of int) – Maximum number of neighbors [hard_max, soft_max].

  • dmax (list of float) – Maximum distances [spatial_max, temporal_max, space_time_ratio].

  • path (str) – Directory path for caching smoothed results.

Returns:

  • zh (np.ndarray) – Smoothed hard data values.

  • zs (np.ndarray) – Smoothed soft data values.

  • zk (np.ndarray) – Smoothed values at estimation points.

  • dfh (pd.DataFrame) – Normalized hard data.

  • dfs (pd.DataFrame) – Normalized soft data.

Notes

Results are cached to disk. Smoothing uses exponential distance weighting. Data is standardized by subtracting smooth trend and dividing by standard deviation.