xradar.io.backends.imd.IMDBackendEntrypoint#
- class xradar.io.backends.imd.IMDBackendEntrypoint[source]#
Bases:
BackendEntrypointXarray BackendEntrypoint for India Meteorological Department (IMD) radar files.
IMD provides one NetCDF file per sweep. Open a single file with
xr.open_dataset(file, engine="imd")to get a CfRadial2-compatible sweepxarray.Dataset. To assemble a multi-sweep volume, useopen_imd_datatree()with a list of files.- Keyword Arguments:
first_dim (
str) – Can betimeorauto(default).autoselectsazimuth(PPI) orelevation(RHI) as the first dimension.reindex_coord (
dict, optional) – Nested dict with optional keysangleandrangeholding the kwargs forxradar.util.reindex_angle()andxradar.util.reindex_range(). Defaults toNone(no reindexing).reindex_angle (
dict, optional) – Deprecated, usereindex_coord=dict(angle=...)instead.site_as_coords (
bool) – If True (default), promotelatitude/longitude/altitudeto Dataset coordinates.
- __init__()#
Methods
__init__()guess_can_open(filename_or_obj)IMD IRIS-netCDF file (
radialAzimandelevationAngle).open_dataset(filename_or_obj, *[, ...])Backend open_dataset method used by Xarray in
open_dataset().open_datatree(filename_or_obj, **kwargs)Open a single IMD NetCDF file as
xarray.DataTree.open_groups_as_dict(filename_or_obj, *[, ...])Open a single IMD (India Meteorological Department) NetCDF file as a CfRadial2-shaped dict of group datasets.
Attributes
open_dataset_parameters- description: ClassVar[str] = 'Open India Meteorological Department (IMD) radar NetCDF files in Xarray'#
- 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, format=None, group=None, first_dim='auto', reindex_coord=None, reindex_angle=False, site_as_coords=True)[source]#
Backend open_dataset method used by Xarray in
open_dataset().
- open_datatree(filename_or_obj, **kwargs)[source]#
Open a single IMD NetCDF file as
xarray.DataTree. Seeopen_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=False, sweep=None, first_dim='auto', reindex_coord=None, reindex_angle=False, site_coords=True, optional_groups=False)[source]#
Open a single IMD (India Meteorological Department) NetCDF file as a CfRadial2-shaped dict of group datasets. Single-file only — for multi-file IMD volumes use
open_imd_datatree().- Parameters:
filename_or_obj (
str,Path, or file-like) – Path or file-like object understood by the underlying reader.mask_and_scale (
boolordict-like, optional) – Replace fill values with NA and applyscale_factor/add_offsetdecoding. Seexarray.open_dataset(). Defaults toTrue.decode_times (
boolordict-like, optional) – Decode CF time variables (calendar, units) intonp.datetime64. Defaults toTrue.concat_characters (
boolordict-like, optional) – Concatenate character arrays into strings along their trailing dimension. Defaults toTrue.decode_coords (
boolor{"coordinates", "all"}, optional) – Decode the CFcoordinatesattribute. Defaults toTrue(equivalent to"coordinates").drop_variables (
stroriterableofstr, optional) – Names of variables to drop before processing.use_cftime (
bool, optional) – Forcecftimedecoding for time variables (instead ofnp.datetime64). Defaults toNone(auto).decode_timedelta (
bool, optional) – Decode CF timedelta variables. Default mirrorsdecode_timesunless the backend overrides it (cfradial1, cfradial2, and imd default toFalse).sweep (
int,str, orlistofint/str, optional) – Sweep selection.None(default) returns all sweeps. Anintor"sweep_N"string returns one sweep; a list returns the named subset.first_dim (
{"auto", "time"}, optional) – Leading dimension of each sweep dataset."auto"picksazimuth(PPI) orelevation(RHI);"time"keeps the raw time axis. Default"auto"("time"for cfradial2).optional_groups (
bool, optional) – Include the/radar_parameters,/georeferencing_correction, and/radar_calibrationmetadata subgroups under the root. Defaults toFalse.sweep (
int,strorlist, optional) – IMD files hold one sweep, so onlyNone,0or"sweep_0"are accepted. Defaults toNone.reindex_coord (
dict, optional) – Nested dict with optional keysangleandrangeholding the kwargs forxradar.util.reindex_angle()andxradar.util.reindex_range(), e.g.dict(angle=dict(start_angle=0, stop_angle=360, angle_res=1.0, direction=1)). Only invoked whendecode_coords=True. Defaults toNone(no reindexing).reindex_angle (
dict, optional) – Deprecated, usereindex_coord=dict(angle=...)instead.site_coords (
bool, optional) – Attachlatitude/longitude/altitudeas coordinates on the root dataset (and on per-sweep datasets where the backend supports it). Defaults toTrue.
- Returns:
dict[str,xarray.Dataset]– CfRadial2 group paths (/,/sweep_N, optional/radar_parametersetc.) mapped to their datasets, ready forxarray.DataTree.from_dict().