How do I change the phase of fields obtained from frequency-domain monitors?#
Date |
Category |
---|---|
2023-12-19 20:07:15 |
Monitors |
You can use the apply_phase()
function to change the phase of fields obtained from frequency-domain monitors. For example:
import numpy as np
# Run the simulation and get the data.
sim_data = tidy3d.web.run(simulation, task_name="task", path="data/data.hdf5", verbose=True)
# Get data from a field monitor.
field_data = sim_data["field_monitor"]
# Change the field phase by phi.
phi = 90 * np.pi / 180
field_phi = field_data.apply_phase(phi)
Itโs useful in observing resonance details or producing animations.