Photonics

Photonics

Topics related to Lumerical and more.

How to pass E and H data as rectilinear dataset to Lumerical from python?

    • nerrror
      Subscriber

      I have electric and magnetic field profiles from my python program which I would like to pass to Lumerical and use as an import source. Creating a rectilinear dataset is not a problem, however, how do I add the E and H field to it?

      And how do I use this new rectilinear dataset for the import source in Phyton?


      Thank you for your help and kind regards

    • Kyle
      Ansys Employee

      The E and H field data can be passed from the Python workspace to the Lumerical workspace using the putv Python method. The field data needs to be in matrices in the Lumerical workspace, so they should be in NumPy arrays in the Python workspace before transferring them to Lumerical.
      Once they are in the Lumerical workspace they can be added to the rectilinear dataset using the addattribute command. I believe this will have to be done through the eval command due to the special syntax of the addattribute command. Once the E and H field data are in the rectilinear dataset in the Lumerical workspace they can be moved back to the Python workspace through getv. Then they can be imported to the Import Source with the importdataset command.
      In theory you should be able to build the rectilinear dataset as a Python dictionary without using putv, getv, eval, etc. but I think getting the exact format of all the data correct would be complicated.
Viewing 1 reply thread
  • The topic ‘How to pass E and H data as rectilinear dataset to Lumerical from python?’ is closed to new replies.