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

normalize(source_spectrum_fn)

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

Inherited Common Usage

monitor#
flux#
normalize(source_spectrum_fn)[source]#

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

__hash__()#

Hash method.