-
-
June 22, 2023 at 12:34 pm
Alex Lambertz
SubscriberHi, I want to extract the field values from a monitor using the pythonAPI and getresult command. When you follow the procedure in the nanowire example here, in the fourth code snippet the E field is returned with E = fdtd.getresult("profile", "E"), which is an ndarray. When the profile is being plotted, the data is accessed with the following line in the second to last code snippet: ## show the field intensity profile Ey = E["E"][:,:,0,0,1] It is nowhere explained what these indices / parameters / options do! Neither on the getresult script command page nor in the function itself! E["E"][:,:,0,0,1] has five "dimensions" so to speak, where the first two give the x,y coordinates apparently, and by trial and error I found the fourth should be the wavelength / frequency index. What are the remaining two parameters "0" at position 3 and "1" at position 5? in getdata or geteletric for example, there is an 'option' optional parameter that has to do with symmetry and boundary conditions, what do they do here and how could I find this out by myself? Thanks for your help, Alex -
June 22, 2023 at 3:17 pm
Guilin Sun
Ansys EmployeeIt is unfortunate that there is no description for the matrix. Usually the field components will have the following dimensions:
x,y,z,f or t, m
where m=1 is for Ex, 2 for Ey and 3 for Ez. This is not very common. In FDTD its self the most often used is:
in frequency domain it is x,y,z,f
in time domain it is x,y,z,t
In python it may allow the dimension index begins at 0. I am not sure for this.
-
June 22, 2023 at 3:18 pm
Guilin Sun
Ansys EmployeePlease refer to this article: https://optics.ansys.com/hc/en-us/articles/360041401434-Passing-Data-Python-API
-
June 23, 2023 at 9:28 am
Alex Lambertz
SubscriberHi Guilin,
Thank you so much, that makes sense! I can also confirm that the index in python does in fact begin at 0.
The link you sent in the second reply I had visited before, but for me it does not give clear overview of what the components are in the dataset and how they can be accessed from python.
Maybe it would be great to have a more general overview of the dataset structure somewhere in the knowledge base / in the help()-function of each of these methods.In my view, the issue can be closed / marked solved!
All the best,
Alex
-
June 23, 2023 at 3:46 pm
Guilin Sun
Ansys EmployeeThank you Alex for the suggestion. I will pass it to the team.
-
June 29, 2023 at 2:48 pm
Thomas Martineau
Ansys EmployeeHi Alex,
Please note that this forum is for Speos and Zemax topics, for Lumerical please use the Photonics one.
Thanks
-
- You must be logged in to reply to this topic.

Boost Ansys Fluent Simulations with AWS
Computational Fluid Dynamics (CFD) helps engineers design products in which the flow of fluid components is a significant challenge. These different use cases often require large complex models to solve on a traditional workstation. Click here to join this event to learn how to leverage Ansys Fluids on the cloud, thanks to Ansys Gateway powered by AWS.

Earth Rescue – An Ansys Online Series
The climate crisis is here. But so is the human ingenuity to fight it. Earth Rescue reveals what visionary companies are doing today to engineer radical new ideas in the fight against climate change. Click here to watch the first episode.

Ansys Blog
Subscribe to the Ansys Blog to get great new content about the power of simulation delivered right to your email on a weekly basis. With content from Ansys experts, partners and customers you will learn about product development advances, thought leadership and trends and tips to better use Ansys tools. Sign up here.
- “Import optical generation” or “delta generation rate”?
- Why am I getting “process exited without calling finalize”, and how do I fix it?
- Using a license file on a new license server
- Ansys Insight: Diverging Simulations
- Error: addfdtd is not a valid function or a variable name
- Questions about the calculation of the cross-polarization conversion efficiency of metasurface
- Error on Lumerical device
- Ansys Insight: About override mesh in FDTD: its use and settings
- Finding your Ansys (or Lumerical) account number
- Lumerical – error message when trying to open from Linux terminal
-
7658
-
4476
-
2957
-
1433
-
1322
© 2023 Copyright ANSYS, Inc. All rights reserved.