uxarray.UxDataArray.cross_section.constant_longitude_interval

uxarray.UxDataArray.cross_section.constant_longitude_interval#

UxDataArray.cross_section.constant_longitude_interval(lons, inverse_indices=False)#

Extracts a cross-section of data by selecting all faces are within a specifed longitude interval.

Parameters:
  • lons (Tuple[float, float]) – The longitude interval (min_lon, max_lon) at which to extract the cross-section, in degrees. Values 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 interval.

Return type:

uxarray.UxDataArray

Raises:

ValueError – If no faces are found within the specified longitude interval.

Examples

>>> # Extract data between 0° and 45° longitude
>>> cross_section = uxda.cross_section.constant_longitude_interval(
...     lons=(0.0, 45.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.