tidy3d.ModeMonitor
tidy3d.ModeMonitor#
- class tidy3d.ModeMonitor#
Monitor
that records amplitudes from modal decomposition of fields on plane.- Parameters
center (Tuple[float, float, float] = (0.0, 0.0, 0.0)) – [units = um]. Center of object in x, y, and z.
size (Tuple[NonNegativeFloat, NonNegativeFloat, NonNegativeFloat] = None) – [units = um]. Size in x, y, and z directions.
name (ConstrainedStrValue = None) – Unique name for monitor.
freqs (Union[List[float], tidynumpy, NumpyArray, List] = None) – [units = Hz]. Array or list of frequencies stored by the field monitor.
mode_spec (ModeSpec = None) – Parameters to feed to mode solver which determine modes measured by monitor.
Example
>>> mode_spec = ModeSpec(num_modes=3) >>> monitor = ModeMonitor( ... center=(1,2,3), ... size=(2,2,0), ... freqs=[200e12, 210e12], ... mode_spec=mode_spec, ... name='mode_monitor')
Show JSON schema
{ "title": "ModeMonitor", "description": ":class:`Monitor` that records amplitudes from modal decomposition of fields on plane.\n\nParameters\n----------\ncenter : Tuple[float, float, float] = (0.0, 0.0, 0.0)\n [units = um]. Center of object in x, y, and z.\nsize : Tuple[NonNegativeFloat, NonNegativeFloat, NonNegativeFloat] = None\n [units = um]. Size in x, y, and z directions.\nname : ConstrainedStrValue = None\n Unique name for monitor.\nfreqs : Union[List[float], tidynumpy, NumpyArray, List] = None\n [units = Hz]. Array or list of frequencies stored by the field monitor.\nmode_spec : ModeSpec = None\n Parameters to feed to mode solver which determine modes measured by monitor.\n\nExample\n-------\n>>> mode_spec = ModeSpec(num_modes=3)\n>>> monitor = ModeMonitor(\n... center=(1,2,3),\n... size=(2,2,0),\n... freqs=[200e12, 210e12],\n... mode_spec=mode_spec,\n... name='mode_monitor')", "type": "object", "properties": { "center": { "title": "Center", "description": "Center of object in x, y, and z.", "default": [ 0.0, 0.0, 0.0 ], "units": "um", "type": "array", "minItems": 3, "maxItems": 3, "items": [ { "type": "number" }, { "type": "number" }, { "type": "number" } ] }, "type": { "title": "Type", "default": "ModeMonitor", "enum": [ "ModeMonitor" ], "type": "string" }, "size": { "title": "Size", "description": "Size in x, y, and z directions.", "units": "um", "type": "array", "minItems": 3, "maxItems": 3, "items": [ { "type": "number", "minimum": 0 }, { "type": "number", "minimum": 0 }, { "type": "number", "minimum": 0 } ] }, "name": { "title": "Name", "description": "Unique name for monitor.", "minLength": 1, "type": "string" }, "freqs": { "title": "Frequencies", "description": "Array or list of frequencies stored by the field monitor.", "units": "Hz", "anyOf": [ { "type": "array", "items": { "type": "number" } }, { "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" ] }, { "$ref": "#/definitions/NumpyArray" }, { "type": "array", "items": {} } ] }, "mode_spec": { "title": "Mode Specification", "description": "Parameters to feed to mode solver which determine modes measured by monitor.", "allOf": [ { "$ref": "#/definitions/ModeSpec" } ] } }, "required": [ "size", "name", "freqs", "mode_spec" ], "additionalProperties": false, "definitions": { "NumpyArray": { "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" ] }, "ModeSpec": { "title": "ModeSpec", "description": "Stores specifications for the mode solver to find an electromagntic mode.\nNote, the planar axes are found by popping the injection axis from {x,y,z}.\nFor example, if injection axis is y, the planar axes are ordered {x,z}.\n\nParameters\n----------\nnum_modes : PositiveInt = 1\n Number of modes returned by mode solver.\ntarget_neff : Optional[PositiveFloat] = None\n Guess for effective index of the mode.\nnum_pml : Tuple[NonNegativeInt, NonNegativeInt] = (0, 0)\n Number of standard pml layers to add in the two tangential axes.\nsort_by : Literal['largest_neff', 'te_fraction', 'tm_fraction'] = largest_neff\n The solver will always compute the ``num_modes`` modes closest to the ``target_neff``, but they can be reordered by the largest ``te_fraction``, defined as the integral of the intensity of the E-field component parallel to the first plane axis normalized to the total in-plane E-field intensity. Similarly, ``tm_fraction`` uses the E field component parallel to the second plane axis.\nangle_theta : float = 0.0\n [units = rad]. Polar angle of the propagation axis from the injection axis.\nangle_phi : float = 0.0\n [units = rad]. Azimuth angle of the propagation axis in the plane orthogonal to the injection axis.\nbend_radius : Optional[float] = None\n [units = um]. A curvature radius for simulation of waveguide bends. Can be negative, in which case the mode plane center has a smaller value than the curvature center along the tangential axis perpendicular to the bend axis.\nbend_axis : Optional[Literal[0, 1]] = None\n Index into the two tangential axes defining the normal to the plane in which the bend lies. This must be provided if ``bend_radius`` is not ``None``. For example, for a ring in the global xy-plane, and a mode plane in either the xz or the yz plane, the ``bend_axis`` is always 1 (the global z axis).\n\nExample\n-------\n>>> mode_spec = ModeSpec(num_modes=3, target_neff=1.5)", "type": "object", "properties": { "num_modes": { "title": "Number of modes", "description": "Number of modes returned by mode solver.", "default": 1, "exclusiveMinimum": 0, "type": "integer" }, "target_neff": { "title": "Target effective index", "description": "Guess for effective index of the mode.", "exclusiveMinimum": 0, "type": "number" }, "num_pml": { "title": "Number of PML layers", "description": "Number of standard pml layers to add in the two tangential axes.", "default": [ 0, 0 ], "type": "array", "minItems": 2, "maxItems": 2, "items": [ { "type": "integer", "minimum": 0 }, { "type": "integer", "minimum": 0 } ] }, "sort_by": { "title": "Ordering of the returned modes", "description": "The solver will always compute the ``num_modes`` modes closest to the ``target_neff``, but they can be reordered by the largest ``te_fraction``, defined as the integral of the intensity of the E-field component parallel to the first plane axis normalized to the total in-plane E-field intensity. Similarly, ``tm_fraction`` uses the E field component parallel to the second plane axis.", "default": "largest_neff", "enum": [ "largest_neff", "te_fraction", "tm_fraction" ], "type": "string" }, "angle_theta": { "title": "Polar Angle", "description": "Polar angle of the propagation axis from the injection axis.", "default": 0.0, "units": "rad", "type": "number" }, "angle_phi": { "title": "Azimuth Angle", "description": "Azimuth angle of the propagation axis in the plane orthogonal to the injection axis.", "default": 0.0, "units": "rad", "type": "number" }, "bend_radius": { "title": "Bend radius", "description": "A curvature radius for simulation of waveguide bends. Can be negative, in which case the mode plane center has a smaller value than the curvature center along the tangential axis perpendicular to the bend axis.", "units": "um", "type": "number" }, "bend_axis": { "title": "Bend axis", "description": "Index into the two tangential axes defining the normal to the plane in which the bend lies. This must be provided if ``bend_radius`` is not ``None``. For example, for a ring in the global xy-plane, and a mode plane in either the xz or the yz plane, the ``bend_axis`` is always 1 (the global z axis).", "enum": [ 0, 1 ], "type": "integer" }, "type": { "title": "Type", "default": "ModeSpec", "enum": [ "ModeSpec" ], "type": "string" } }, "additionalProperties": false } } }
- Fields
- storage_size(num_cells: int, tmesh: int) int #
Size of monitor storage given the number of points after discretization.
- Parameters
num_cells (int) – Number of grid cells within the monitor after discretization by a
Simulation
.tmesh (Array) – The discretized time mesh of a
Simulation
.
- Returns
Number of bytes to be stored in monitor.
- Return type
int