tidy3d.FluxData#

class FluxData[source]#

Bases: MonitorData

Data associated with a FluxMonitor: flux data in the frequency-domain.

Parameters:
  • attrs (dict = {}) โ€“ Dictionary storing arbitrary metadata for a Tidy3D object. This dictionary can be freely used by the user for storing data without affecting the operation of Tidy3D as it is not used internally. Note that, unlike regular Tidy3D fields, attrs are mutable. For example, the following is allowed for setting an attr obj.attrs['foo'] = bar. Also note that Tidy3D` will raise a TypeError if attrs contain objects that can not be serialized. One can check if attrs are serializable by calling obj.json().

  • monitor (FluxMonitor) โ€“ Frequency-domain flux monitor associated with the data.

  • flux (FluxDataArray) โ€“ Flux values in the frequency-domain.

Notes

The data is stored as a DataArray object using the xarray package.

We can access the data for each monitor by indexing into the SimulationData with the monitor .name. For the flux monitor data, we can access the raw flux data as a function of frequency with .flux. As most data are multidimensional, itโ€™s often very helpful to print out the data and directly inspect its structure.

Example

>>> from tidy3d import FluxDataArray
>>> f = [2e14, 3e14]
>>> coords = dict(f=f)
>>> flux_data = FluxDataArray(np.random.random(2), coords=coords)
>>> monitor = FluxMonitor(size=(2,0,6), freqs=[2e14, 3e14], name='flux')
>>> data = FluxData(monitor=monitor, flux=flux_data)

Attributes

Methods

make_adjoint_sources(dataset_names,ย fwidth)

Converts a FieldData to a list of adjoint current or point sources.

normalize(source_spectrum_fn)

Return copy of self after normalization is applied using source spectrum function.

Inherited Common Usage

monitor#
flux#
make_adjoint_sources(dataset_names, fwidth)[source]#

Converts a FieldData to a list of adjoint current or point sources.

normalize(source_spectrum_fn)[source]#

Return copy of self after normalization is applied using source spectrum function.

__hash__()#

Hash method.