xradar.io.backends.discover.discover_engine#

xradar.io.backends.discover.discover_engine(filename_or_obj)[source]#

Find the xradar engine which can open the given file.

Each xradar backend checks the file with its guess_can_open (format signatures, e.g. AR2V for NEXRAD Level II, ODIM_H5 conventions in HDF5 files), see list_xradar_engines().

Parameters:

filename_or_obj (str, os.PathLike, bytes or file-like) – Radar file.

Returns:

engine (str) – Name of the engine, to be used with e.g. xr.open_dataset(filename, engine=engine, group="sweep_0").

Raises:

ValueError – If no xradar engine can open the file.

Examples

>>> engine = xd.io.discover_engine(filename)
>>> ds = xr.open_dataset(filename, engine=engine, group="sweep_0")