NcNodeMapper¶
-
class
tollan.utils.nc.
NcNodeMapper
(nc_node_map=None, source=None, **kwargs)[source]¶ Bases:
contextlib.ExitStack
,tollan.utils.nc.NcNodeMapperMixin
A adaptor class that accesses netCDF4 dataset with a custom name map.
- Parameters
- sourcestr,
pathlib.Path
,FileLoc
,netCDF4.Dataset
The netCDF file location or netCDF dataset.
- sourcestr,
Attributes Summary
The opened file.
Methods Summary
open
(source, **kwargs)Return a context to operate on
source
.set_nc_node
(nc_node)Set the node to map.
sync
()Sync the underlying file.
Attributes Documentation
-
file_loc
¶ The opened file.
-
logger
= <Logger NcNodeMapper (WARNING)>¶
Methods Documentation
-
open
(source, **kwargs)[source]¶ Return a context to operate on
source
.- Parameters
- sourcestr,
pathlib.Path
,FileLoc
,netCDF4.Dataset
The netCDF file location or netCDF dataset.
- **kwargs :
The keyword arguments passed to
netCDF4.Dataset
constructor.
- sourcestr,