xradar.io.backends.nexrad_level2.NexradLevel2BackendEntrypoint#

class xradar.io.backends.nexrad_level2.NexradLevel2BackendEntrypoint[source]#

Bases: BackendEntrypoint

Xarray BackendEntrypoint for NEXRAD Level2 Data

__init__()#

Methods

__init__()

guess_can_open(filename_or_obj)

NEXRAD Level II archive (AR2V / ARCHIVE2 volume header).

open_dataset(filename_or_obj, *[, ...])

Backend open_dataset method used by Xarray in open_dataset().

open_datatree(filename_or_obj, **kwargs)

Open a NEXRAD Level II file as xarray.DataTree.

open_groups_as_dict(filename_or_obj, *[, ...])

Open a NEXRAD Level II file as a CfRadial2-shaped dict of group datasets.

Attributes

description

open_dataset_parameters

supports_groups

url

description: ClassVar[str] = 'Open NEXRAD Level2 files in Xarray'#
guess_can_open(filename_or_obj)[source]#

NEXRAD Level II archive (AR2V / ARCHIVE2 volume header).

open_dataset(filename_or_obj, *, mask_and_scale=True, decode_times=True, concat_characters=True, decode_coords=True, drop_variables=None, use_cftime=None, decode_timedelta=None, group=None, lock=None, first_dim='auto', reindex_coord=None, reindex_angle=False, fix_second_angle=False, site_as_coords=True, optional=True)[source]#

Backend open_dataset method used by Xarray in open_dataset().

open_datatree(filename_or_obj, **kwargs)[source]#

Open a NEXRAD Level II file as xarray.DataTree. See open_groups_as_dict() for keyword arguments.

open_groups_as_dict(filename_or_obj, *, mask_and_scale=True, decode_times=True, concat_characters=True, decode_coords=True, drop_variables=None, use_cftime=None, decode_timedelta=None, sweep=None, first_dim='auto', reindex_coord=None, reindex_angle=False, fix_second_angle=False, site_coords=True, optional=True, optional_groups=False, incomplete_sweep='drop', lock=None, **kwargs)[source]#

Open a NEXRAD Level II file as a CfRadial2-shaped dict of group datasets. Accepts a single file path, a bytes buffer, or a list/tuple of LDM chunk paths (the first chunk must hold the AR2V volume header). For NEXRAD, sweep selection refers to recorded cuts and includes all their native grids. Output groups are numbered in scan order and can differ from the selected cut numbers after a split.

Parameters:
  • filename_or_obj (str, Path, or file-like) – Path or file-like object understood by the underlying reader.

  • mask_and_scale (bool or dict-like, optional) – Replace fill values with NA and apply scale_factor/add_offset decoding. See xarray.open_dataset(). Defaults to True.

  • decode_times (bool or dict-like, optional) – Decode CF time variables (calendar, units) into np.datetime64. Defaults to True.

  • concat_characters (bool or dict-like, optional) – Concatenate character arrays into strings along their trailing dimension. Defaults to True.

  • decode_coords (bool or {"coordinates", "all"}, optional) – Decode the CF coordinates attribute. Defaults to True (equivalent to "coordinates").

  • drop_variables (str or iterable of str, optional) – Names of variables to drop before processing.

  • use_cftime (bool, optional) – Force cftime decoding for time variables (instead of np.datetime64). Defaults to None (auto).

  • decode_timedelta (bool, optional) – Decode CF timedelta variables. Default mirrors decode_times unless the backend overrides it (cfradial1, cfradial2, and imd default to False).

  • sweep (int, str, or list of int/str, optional) – Sweep selection. None (default) returns all sweeps. An int or "sweep_N" string returns one sweep; a list returns the named subset.

  • first_dim ({"auto", "time"}, optional) – Leading dimension of each sweep dataset. "auto" picks azimuth (PPI) or elevation (RHI); "time" keeps the raw time axis. Default "auto" ("time" for cfradial2).

  • optional (bool, optional) – Include optional root variables when available. Defaults to True.

  • optional_groups (bool, optional) – Include the /radar_parameters, /georeferencing_correction, and /radar_calibration metadata subgroups under the root. Defaults to False.

  • reindex_coord (dict, optional) – Nested dict with optional keys angle and range holding the kwargs for xradar.util.reindex_angle() and xradar.util.reindex_range(), e.g. dict(angle=dict(start_angle=0, stop_angle=360, angle_res=1.0, direction=1)). Only invoked when decode_coords=True. Defaults to None (no reindexing).

  • reindex_angle (dict, optional) – Deprecated, use reindex_coord=dict(angle=...) instead.

  • fix_second_angle (bool, optional) – Correct erroneous secondary-angle values (azimuth on RHI, elevation on PPI). Only effective with first_dim="auto". Defaults to False.

  • site_coords (bool, optional) – Attach latitude/longitude/altitude as coordinates on the root dataset (and on per-sweep datasets where the backend supports it). Defaults to True.

  • incomplete_sweep ({"drop", "pad"}, optional) – How to handle sweeps with fewer rays than the VCP nominal count. "drop" (default) excludes them with a UserWarning; "pad" keeps them with NaN-filled rays so the reindexed azimuth grid is complete.

  • lock (threading.Lock or None, optional) – Reader lock for thread-safe access. Defaults to None.

Returns:

dict[str, xarray.Dataset] – CfRadial2 group paths (/, /sweep_N, optional /radar_parameters etc.) mapped to their datasets, ready for xarray.DataTree.from_dict().

supports_groups: ClassVar[bool] = True#
url: ClassVar[str] = 'tbd'#