Photonics

Photonics

Visualize and export Gaussian source beam data (without running simulation) via script?

    • IanFMZ
      Subscriber

      Hi,

      One way of obtaining the beam data for a source is by clicking "Visualize beam data" for the source, then exporting to various formats from the visualizer. We can also reach the visualizer by clicking Visualize -> Fields.

    • Guilin Sun
      Ansys Employee
      I am not sure how to do this in Python, but using Lumerical script you can do it. For example source_field=getresult("source","fields");
      in the workspace you can see the dataset:
      An even better way to do this is to use script add the Gaussian source, set its parameters and extract the field data as above.
      eg addgaussian;
      set("wavelength start",.5e-6);
      set("wavelength stop",.6e-6);
      set("waist radius w0",3e-6);
      source_field=getresult("source","fields");
      Then you can further process what you want to do.
    • IanFMZ
      Subscriber

      Thank you, that is exactly what I was looking for!
      In Python, it can be done using
      fdtd_hook = lumapi.FDTD fdtd_hook.getresult("source", "fields")
      which will output the dataset as a dictionary with keys ['lambda', 'f', 'x', 'y', 'z', 'E', 'H', 'Lumerical_dataset'].
    • Guilin Sun
      Ansys Employee
      Thank you for letting me know this!
Viewing 3 reply threads
  • You must be logged in to reply to this topic.