xradar.io.backends.imd.open_imd_datatree#

xradar.io.backends.imd.open_imd_datatree(filename_or_obj, **kwargs)[source]#

Open IMD radar file(s) as a xarray.DataTree.

IMD stores one sweep per NetCDF file. A volume is assembled from multiple files (typically 2-3 for long-range PPI or 9-10 for short-range, high-resolution PPI).

  • Single file path -> single-sweep DataTree.

  • List of file paths -> single volume DataTree. Multi-file stacking is delegated to xradar.util.create_volume(), which sorts sweeps by time and supports time_coverage_start, time_coverage_end, min_angle, max_angle filtering.

To split a directory of mixed-volume files into per-volume groups, use group_imd_files() first:

for group in xd.io.group_imd_files("/data/imd"):
    dtree = xd.io.open_imd_datatree(group)
Parameters:

filename_or_obj (str, Path, or list/tuple of those) – Single IMD file path, or a list of paths making up one volume.

Keyword Arguments:
  • first_dim (str) – "auto" (default) or "time".

  • reindex_angle (bool or dict) – If a dict, kwargs are passed to xradar.util.reindex_angle().

  • site_as_coords (bool) – Attach station variables as coordinates on sweep Datasets.

  • optional_groups (bool) – Include /radar_parameters, /georeferencing_correction and /radar_calibration subgroups. Defaults to False.

  • volume_number (time_coverage_start, time_coverage_end, min_angle, max_angle,) – Forwarded to xradar.util.create_volume() when multi-file input is provided.

Returns:

dtree (xarray.DataTree) – CfRadial2-style DataTree with / root and sweep_N children.