imas.backends.netcdf.ids2nc.IDS2NC¶
- class imas.backends.netcdf.ids2nc.IDS2NC(ids: IDSToplevel, group: Group)¶
Bases:
IDSTensorizerClass responsible for storing an IDS to a NetCDF file.
- __init__(ids: IDSToplevel, group: Group)¶
Initialize IDS2NC converter.
- Parameters:
- ids: IDSToplevel¶
IDSToplevel to store in the netCDF group
- group: Group¶
Empty netCDF group to store the IDS in.
Methods
__init__(ids, group)Initialize IDS2NC converter.
Collect all filled data in the IDS and determine dimension sizes.
Create netCDF dimensions.
Create netCDF variables.
Determine tensorized data shapes and sparsity, save in
shapes.filter_coordinates(path)Filter the coordinates list from NCMetadata to filled variables only.
Append all paths that are coordinates of self.paths_to_tensorize
run()Store the IDS in the NetCDF group.
Store data in the netCDF variables
tensorize(path, fillvalue)Tensorizes the data at the given path with the specified fill value.
Attributes
NetCDF Group to store the IDS in.
IDS to tensorize.
List of paths to tensorize
NetCDF related metadata.
Map dimension name to its size.
Map of IDS paths to filled data nodes.
Set of filled IDS variables
True iff the IDS time mode is homogeneous.
Map of IDS paths to data shape arrays.
- collect_filled_data() None¶
Collect all filled data in the IDS and determine dimension sizes.
Results are stored in
filled_dataanddimension_size.
- dimension_size¶
Map dimension name to its size.
- filled_data¶
Map of IDS paths to filled data nodes.
- filled_variables¶
Set of filled IDS variables
- filter_coordinates(path: str) str¶
Filter the coordinates list from NCMetadata to filled variables only.
- group¶
NetCDF Group to store the IDS in.
- homogeneous_time¶
True iff the IDS time mode is homogeneous.
- ids¶
IDS to tensorize.
- ncmeta¶
NetCDF related metadata.
- paths_to_tensorize¶
List of paths to tensorize
- shapes¶
Map of IDS paths to data shape arrays.