xradar.io.backends.cfradial2.CfRadial2BackendEntrypoint#
- class xradar.io.backends.cfradial2.CfRadial2BackendEntrypoint[source]#
Bases:
BackendEntrypointXarray BackendEntrypoint for CfRadial2/FM301 grouped datasets.
- Keyword Arguments:
sweep (
int,str,iterable, optional) – Sweep selection. Defaults to all available sweeps.first_dim (
str) – Can betimeorauto. Defaults totime.optional (
bool) – Keep optional root variables when available. Defaults toTrue.optional_groups (
bool) – Include root metadata subgroups if present. Defaults toFalse.kwargs (
dict) – Additional kwargs are fed toxarray.open_datatree().
- __init__()#
Methods
__init__()guess_can_open(filename_or_obj)CfRadial2 file (netCDF/HDF5 with sweep groups, whose
Conventionsmention CF/Radial and whose root hassweep_group_nameandtime_coverage_start).open_dataset(filename_or_obj, *[, ...])Backend open_dataset method used by Xarray in
open_dataset().open_datatree(filename_or_obj, **kwargs)Open a CfRadial2/FM301 grouped file as
xarray.DataTree.open_groups_as_dict(filename_or_obj, *[, ...])Open a CfRadial2/FM301 grouped file as a dict of normalized group datasets.
Attributes
open_dataset_parameters- guess_can_open(filename_or_obj)[source]#
CfRadial2 file (netCDF/HDF5 with sweep groups, whose
Conventionsmention CF/Radial and whose root hassweep_group_nameandtime_coverage_start).Files with
sweep_start_ray_index(CfRadial1) and vendor files which use the CfRadial2 layout without the time coverage (e.g. WindCube) are not claimed.
- 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=False, group='sweep_0', first_dim='time', optional=True)[source]#
Backend open_dataset method used by Xarray in
open_dataset().
- open_datatree(filename_or_obj, **kwargs)[source]#
Open a CfRadial2/FM301 grouped file as
xarray.DataTree. Seeopen_groups_as_dict()for keyword arguments.
- open_groups_as_dict(filename_or_obj, *, sweep=None, first_dim='time', optional=True, optional_groups=False, site_coords=True, netcdf_engine=None, **kwargs)[source]#
Open a CfRadial2/FM301 grouped file as a dict of normalized group datasets. Best-effort normalization of common institutional variations is applied so the result matches xradar’s FM301-oriented layout.
- 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 (
bool, optional) – Include optional root variables when available. Defaults toTrue.optional_groups (
bool, optional) – Include the/radar_parameters,/georeferencing_correction, and/radar_calibrationmetadata subgroups under the root. Defaults toFalse.site_coords (
bool, optional) – Keeplatitude/longitude/altitudeas coordinates on the root dataset. CfRadial2 stores station coords at root by default; passFalseto drop them. Defaults toTrue.netcdf_engine (
str, optional) – netCDF engine used to read the file (e.g."netcdf4"or"h5netcdf"). Defaults toNone(xarray’s choice).
- Returns:
dict[str,xarray.Dataset]– CfRadial2 group paths (/,/sweep_N, optional/radar_parametersetc.) mapped to their datasets, ready forxarray.DataTree.from_dict().