uxarray.UxDataArray.subset.constant_longitude_interval

uxarray.UxDataArray.subset.constant_longitude_interval#

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

Extracts a subset of data by selecting all faces that are within a specified longitude interval.

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