tidy3d.components.data.ScalarFieldData#

class tidy3d.components.data.ScalarFieldData#

Stores a single scalar field in frequency-domain.

Parameters
  • values (Array = None) – Multi-dimensional array storing the raw scalar field values in freq. domain.

  • data_attrs (Optional[Mapping[str, str]] = None) – Dictionary storing extra attributes associated with the monitor data.

  • f (Array = None) – [units = Hz]. Array of frequency values to use as coordintes.

  • x (Array = None) – [units = um]. Array of x location values to use as coordintes.

  • y (Array = None) – [units = um]. Array of y location values to use as coordintes.

  • z (Array = None) – [units = um]. Array of z location values to use as coordintes.

Example

>>> f = np.linspace(1e14, 2e14, 1001)
>>> x = np.linspace(-1, 1, 10)
>>> y = np.linspace(-2, 2, 20)
>>> z = np.linspace(0, 0, 1)
>>> values = (1+1j) * np.random.random((len(x), len(y), len(z), len(f)))
>>> data = ScalarFieldData(values=values, x=x, y=y, z=z, f=f)

Show JSON schema
{
   "title": "ScalarFieldData",
   "description": "Stores a single scalar field in frequency-domain.\n\nParameters\n----------\nvalues : Array = None\n    Multi-dimensional array storing the raw scalar field values in freq. domain.\ndata_attrs : Optional[Mapping[str, str]] = None\n    Dictionary storing extra attributes associated with the monitor data.\nf : Array = None\n    [units = Hz].  Array of frequency values to use as coordintes.\nx : Array = None\n    [units = um].  Array of x location values to use as coordintes.\ny : Array = None\n    [units = um].  Array of y location values to use as coordintes.\nz : Array = None\n    [units = um].  Array of z location values to use as coordintes.\n\nExample\n-------\n>>> f = np.linspace(1e14, 2e14, 1001)\n>>> x = np.linspace(-1, 1, 10)\n>>> y = np.linspace(-2, 2, 20)\n>>> z = np.linspace(0, 0, 1)\n>>> values = (1+1j) * np.random.random((len(x), len(y), len(z), len(f)))\n>>> data = ScalarFieldData(values=values, x=x, y=y, z=z, f=f)",
   "type": "object",
   "properties": {
      "type": {
         "title": "Type",
         "default": "ScalarFieldData",
         "enum": [
            "ScalarFieldData"
         ],
         "type": "string"
      },
      "values": {
         "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"
         }
      },
      "f": {
         "title": "NumpyArray",
         "description": "Wrapper around numpy arrays that has a well defined json schema.",
         "units": "Hz",
         "type": "object",
         "properties": {
            "data_list": {
               "title": "Data List",
               "type": "array",
               "items": {}
            }
         },
         "required": [
            "data_list"
         ]
      },
      "x": {
         "title": "NumpyArray",
         "description": "Wrapper around numpy arrays that has a well defined json schema.",
         "units": "um",
         "type": "object",
         "properties": {
            "data_list": {
               "title": "Data List",
               "type": "array",
               "items": {}
            }
         },
         "required": [
            "data_list"
         ]
      },
      "y": {
         "title": "NumpyArray",
         "description": "Wrapper around numpy arrays that has a well defined json schema.",
         "units": "um",
         "type": "object",
         "properties": {
            "data_list": {
               "title": "Data List",
               "type": "array",
               "items": {}
            }
         },
         "required": [
            "data_list"
         ]
      },
      "z": {
         "title": "NumpyArray",
         "description": "Wrapper around numpy arrays that has a well defined json schema.",
         "units": "um",
         "type": "object",
         "properties": {
            "data_list": {
               "title": "Data List",
               "type": "array",
               "items": {}
            }
         },
         "required": [
            "data_list"
         ]
      }
   },
   "required": [
      "values",
      "f",
      "x",
      "y",
      "z"
   ]
}

Fields
attribute data_attrs: Dict[str, str] = None#

explanation of values values is a numpy array that stores the raw data associated with each MonitorData. It can be complex-valued or real valued, depending on whether data is in the frequency or time domain, respectively. Each axis in values corresponds to a specific dimension in the MonitorData, which are supplied as arguments to the MonitorData subclasses. The order of the dimensions is specified in the _dims attribute of each MonitorData subclass

Dictionary storing extra attributes associated with the monitor data.

attribute f: tidy3d.components.types.Array [Required]#

Array of frequency values to use as coordintes.

Constraints
  • 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’]

attribute values: tidy3d.components.types.Array [Required]#

Multi-dimensional array storing the raw scalar field values in freq. domain.

Constraints
  • 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’]

attribute x: tidy3d.components.types.Array [Required]#

Array of x location values to use as coordintes.

Constraints
  • 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’]

attribute y: tidy3d.components.types.Array [Required]#

Array of y location values to use as coordintes.

Constraints
  • 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’]

attribute z: tidy3d.components.types.Array [Required]#

Array of z location values to use as coordintes.

Constraints
  • 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’]

normalize(source_freq_amps: tidy3d.components.types.Array) None#

normalize the values by the amplitude of the source.