uxarray.UxDataArray.cross_section.constant_longitude#
- UxDataArray.cross_section.constant_longitude(lon, inverse_indices=False)#
Extracts a cross-section of the data array by selecting all faces that intersect with a specified line of constant longitude.
- Parameters:
lon (float) – The latitude at which to extract the cross-section, in degrees. Must be between -180.0 and 180.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 longitude.
- 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 0° longitude >>> cross_section = uxda.cross_section.constant_latitude(lon=0.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.