uxarray.UxDataArray.cross_section.constant_latitude_interval#
- UxDataArray.cross_section.constant_latitude_interval(lats, inverse_indices=False)#
Extracts a cross-section of data by selecting all faces that are within a specified latitude interval.
- Parameters:
lats (Tuple[float, float]) – The latitude interval (min_lat, max_lat) at which to extract the cross-section, in degrees. Values must be between -90.0 and 90.0
inverse_indices (Union[List[str], Set[str], bool], optional) – Controls storage of original grid indices. Options: - True: Stores original face indices - List/Set of strings: Stores specified index types (valid values: “face”, “edge”, “node”) - False: No index storage (default)
- Returns:
A subset of the original data array containing only the faces that are within a specified latitude interval.
- Return type:
- Raises:
ValueError – If no faces are found within the specified latitude interval.
Examples
>>> # Extract data between 30°S and 30°N latitude >>> cross_section = uxda.cross_section.constant_latitude_interval( ... lats=(-30.0, 30.0) ... )
Notes
The initial execution time may be significantly longer than subsequent runs due to Numba’s just-in-time compilation. Subsequent calls will be faster due to caching.