uxarray.UxDataArray.cross_section.constant_latitude#
- UxDataArray.cross_section.constant_latitude(lat, inverse_indices=False)#
Extracts a cross-section of the data array by selecting all faces that intersect with a specified line of constant latitude.
- Parameters:
lat (float) – The latitude at which to extract the cross-section, in degrees. 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 intersect with the specified latitude.
- Return type:
- Raises:
ValueError – If no intersections are found at the specified longitude or the data variable is not face-centered.
Examples
>>> # Extract data at 15.5°S latitude >>> cross_section = uxda.cross_section.constant_latitude(lat=-15.5)
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.