xradar.io.backends.gamic.GamicBackendEntrypoint#
- class xradar.io.backends.gamic.GamicBackendEntrypoint[source]#
Bases:
BackendEntrypointXarray BackendEntrypoint for GAMIC data.
- Keyword Arguments:
first_dim (
str) – Can betimeorautofirst dimension. If set toauto, first dimension will be eitherazimuthorelevationdepending on type of sweep. Defaults toauto.reindex_coord (
dict, optional) – Defaults to None, no reindexing. 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 ifdecode_coords=True.reindex_angle (
dict, optional) – Deprecated, usereindex_coord=dict(angle=...)instead.fix_second_angle (
bool) – For PPI only. If True, fixes erroneous second angle data. Defaults toFalse.site_as_coords (
bool) – Attach radar site-coordinates to Dataset, defaults toTrue.kwargs (
dict) – Additional kwargs are fed toxarray.open_dataset().
- __init__()#
Methods
__init__()guess_can_open(filename_or_obj)GAMIC HDF5 file (
whatandscan0groups).open_dataset(filename_or_obj, *[, ...])Backend open_dataset method used by Xarray in
open_dataset().open_datatree(filename_or_obj, **kwargs)Open a GAMIC HDF5 file as
xarray.DataTree.open_groups_as_dict(filename_or_obj, *[, ...])Open a GAMIC HDF5 file as a CfRadial2-shaped dict of group datasets.
Attributes
open_dataset_parameters- 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='sweep_0', invalid_netcdf=None, phony_dims='access', decode_vlen_strings=True, first_dim='auto', reindex_coord=None, reindex_angle=False, fix_second_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 GAMIC HDF5 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=None, format=None, invalid_netcdf=None, phony_dims='access', decode_vlen_strings=True, first_dim='auto', reindex_coord=None, reindex_angle=False, fix_second_angle=False, site_coords=True, sweep=None, optional=True, optional_groups=False)[source]#
Open a GAMIC HDF5 file as a CfRadial2-shaped dict of group datasets.
- 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.format (
str, optional) – h5netcdf format string. Defaults toNone.invalid_netcdf (
bool, optional) – Accept HDF5 files that are not strictly NetCDF-conformant.phony_dims (
{"access", "sort", None}, optional) – How h5netcdf labels unnamed dimensions. Defaults to"access".decode_vlen_strings (
bool, optional) – Decode variable-length strings stored in HDF5. Defaults toTrue.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.fix_second_angle (
bool, optional) – Correct erroneous secondary-angle values (azimuth on RHI, elevation on PPI). Only effective withfirst_dim="auto". Defaults toFalse.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().