environmentaltools.spatiotemporal.raster.load_results
- environmentaltools.spatiotemporal.raster.load_results(results_path)[source]
Load indicator analysis results from a results directory (JSON + NPZ format).
This function reconstructs the results of a spatiotemporal indicator analysis from a directory containing a metadata.json file and an arrays.npz file. It returns a dictionary mapping each index name to a list of (contours, mean_map) tuples for each simulation.
- Parameters:
results_path (str or Path) – Path to the results directory or directly to the metadata.json file.
- Returns:
results – Dictionary containing indicator results for each index. Format: {index_name: [(contours, mean_map), …]}
- Return type:
dict
Examples
>>> from environmentaltools.spatiotemporal import raster >>> results = raster.load_results("results/indicator_results_20250112_143022") >>> # Access results for specific index >>> for contours, mean_map in results['mean_presence_boundary']: ... print(f"Found {len(contours)} contours")