tidy3d.components.data.CollectionData
tidy3d.components.data.CollectionData#
- class tidy3d.components.data.CollectionData#
Abstract base class. Stores a collection of data with same dimension types (such as a field with many components).
- Parameters
data_dict (Mapping[str, MonitorData]) – Mapping of name to each
MonitorData
in the collection.
Show JSON schema
{ "title": "CollectionData", "description": "Abstract base class.\nStores a collection of data with same dimension types (such as a field with many components).\n\n\nParameters\n----------\ndata_dict : Mapping[str, MonitorData]\n Mapping of name to each :class:`.MonitorData` in the collection.", "type": "object", "properties": { "type": { "title": "Type", "default": "CollectionData", "enum": [ "CollectionData" ], "type": "string" }, "data_dict": { "title": "Data Dictionary", "description": "Mapping of name to each :class:`.MonitorData` in the collection.", "type": "object", "additionalProperties": { "$ref": "#/definitions/MonitorData" } } }, "required": [ "data_dict" ], "definitions": { "MonitorData": { "title": "MonitorData", "description": "Abstract base class for objects storing individual data from simulation.\n\nParameters\n----------\nvalues : Union[Array, Array]\n Values of the raw data being stored.\ndata_attrs : Optional[Mapping[str, str]] = None\n Dictionary storing extra attributes associated with the monitor data.", "type": "object", "properties": { "type": { "title": "Type", "default": "MonitorData", "enum": [ "MonitorData" ], "type": "string" }, "values": { "title": "Values", "description": "Values of the raw data being stored.", "anyOf": [ { "title": "NumpyArray", "description": "Wrapper around numpy arrays that has a well defined json schema.", "type": "object", "properties": { "data_list": { "title": "Data List", "type": "array", "items": {} } }, "required": [ "data_list" ] }, { "title": "NumpyArray", "description": "Wrapper around numpy arrays that has a well defined json schema.", "type": "object", "properties": { "data_list": { "title": "Data List", "type": "array", "items": {} } }, "required": [ "data_list" ] } ] }, "data_attrs": { "title": "Data Attributes", "description": "Dictionary storing extra attributes associated with the monitor data.", "type": "object", "additionalProperties": { "type": "string" } } }, "required": [ "values" ] } } }
- attribute data_dict: Dict[str, tidy3d.components.data.MonitorData] [Required]#
Mapping of name to each
MonitorData
in the collection.
- add_to_group(hdf5_grp) None #
Add data from a
AbstractFieldData
to an hdf5 group .
- ensure_member_exists(member_name: str)#
make sure a member of collection is present in data
- classmethod load_from_group(hdf5_grp)#
Load a
AbstractFieldData
from hdf5 group containing data.
- property data: Dict[str, xarray.core.dataarray.DataArray]#
For field quantities, store a single xarray DataArray for each
field
. These all go in a single xarray Dataset, which keeps track of the shared coords.- Returns
Mapping of data dict keys to corresponding DataArray from .data property. For more details refer to xarray’s Documentaton.
- Return type
Dict[str, xarray.DataArray]
- property sim_data_getitem: tidy3d.components.data.Tidy3dData#
What gets returned by sim_data[‘monitor_data_name’]