arlmet.extract_subset#
- arlmet.extract_subset(source_path, destination_path, *, bbox=None, levels=None, variables=None)[source]#
Extract a spatial/vertical subset from an ARL file into a new ARL file.
- Parameters:
source_path (path-like) – Input and output ARL file paths.
destination_path (path-like) – Input and output ARL file paths.
bbox (tuple[float, float, float, float], optional) – Geographic bounding box
(west, south, east, north)in degrees.levels (iterable of int, optional) – ARL level indices to keep. Output levels are compacted and renumbered from zero while preserving the selected level heights.
variables (iterable of str, optional) – Variable names to keep. All variables are included by default.
- Return type:
Examples
>>> import arlmet >>> arlmet.extract_subset( ... "met.arl", ... "subset.arl", ... bbox=(-114.0, 39.0, -110.0, 42.0), ... levels=[0, 1, 2], ... )