environmentaltools.spatiotemporal.bme.create_spatiotemporal_matrix
- environmentaltools.spatiotemporal.bme.create_spatiotemporal_matrix(dfh, dfs)[source]
Create spatiotemporal data matrix.
Organizes hard and soft data into a matrix format where columns represent unique spatial locations and rows represent time points.
- Parameters:
dfh (pd.DataFrame) – Hard data with columns [‘x’, ‘y’, ‘t’, ‘h’].
dfs (pd.DataFrame) – Soft data with columns [‘x’, ‘y’, ‘t’, ‘h’].
- Returns:
dfz (pd.DataFrame) – Matrix of values where index is time and columns are spatial locations.
coups (np.ndarray) – Array of unique spatial coordinate pairs [x, y].
coupt (np.ndarray) – Array of unique time points.
Notes
Missing data are represented as NaN values in the resulting matrix.