-
-
November 1, 2021 at 1:28 pm
nerrror
SubscriberI 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
November 2, 2021 at 12:24 amKyle
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.
Ansys Innovation SpaceTrending discussionsTop Contributors-
3387
-
1052
-
1050
-
886
-
852
Top Rated Tags© 2025 Copyright ANSYS, Inc. All rights reserved.
Ansys does not support the usage of unauthorized Ansys software. Please visit www.ansys.com to obtain an official distribution.
-

Ansys Assistant

Welcome to Ansys Assistant!
An AI-based virtual assistant for active Ansys Academic Customers. Please login using your university issued email address.

Hey there, you are quite inquisitive! You have hit your hourly question limit. Please retry after '10' minutes. For questions, please reach out to ansyslearn@ansys.com.
RETRY