tidy3d.ModeIndexData#

class tidy3d.ModeIndexData#

Stores effective propagation index from a ModeMonitor.

Parameters
  • values (Array) – Values of the mode’s complex effective refractive index.

  • data_attrs (Mapping[str, str] = {'units': '', 'long_name': 'effective index'}) – Dictionary storing extra attributes associated with the monitor data.

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

  • mode_index (Array) – Array of mode index values to use as coordintes.

Example

>>> f = np.linspace(2e14, 3e14, 1001)
>>> values = (1+1j) * np.random.random((len(f), 2))
>>> data = ModeIndexData(values=values, mode_index=np.arange(1, 3), f=f)

Show JSON schema
{
   "title": "ModeIndexData",
   "description": "Stores effective propagation index from a :class:`.ModeMonitor`.\n\nParameters\n----------\nvalues : Array\n    Values of the mode's complex effective refractive index.\ndata_attrs : Mapping[str, str] = {'units': '', 'long_name': 'effective index'}\n    Dictionary storing extra attributes associated with the monitor data.\nf : Array\n    [units = Hz].  Array of frequency values to use as coordintes.\nmode_index : Array\n    Array of mode index values to use as coordintes.\n\nExample\n-------\n>>> f = np.linspace(2e14, 3e14, 1001)\n>>> values = (1+1j) * np.random.random((len(f), 2))\n>>> data = ModeIndexData(values=values, mode_index=np.arange(1, 3), f=f)",
   "type": "object",
   "properties": {
      "type": {
         "title": "Type",
         "default": "ModeIndexData",
         "enum": [
            "ModeIndexData"
         ],
         "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.",
         "default": {
            "units": "",
            "long_name": "effective index"
         },
         "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"
         ]
      },
      "mode_index": {
         "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"
         ]
      }
   },
   "required": [
      "values",
      "f",
      "mode_index"
   ]
}

Fields
  • data_attrs (Dict[str, str])

  • values (tidy3d.components.types.Array)

attribute data_attrs: Dict[str, str] = {'long_name': 'effective index', 'units': ''}#

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 values: tidy3d.components.types.Array [Required]#

Values of the mode’s complex effective refractive index.

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.

property k_eff#

Get imaginary part of effective index.

property n_complex#

Complex effective index.

property n_eff#

Get real part of effective index.