-
-
June 22, 2023 at 12:34 pmAlex LambertzSubscriberHi, 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 pmGuilin SunAnsys Employee
It 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 pmGuilin SunAnsys Employee
Please refer to this article: https://optics.ansys.com/hc/en-us/articles/360041401434-Passing-Data-Python-API
Â
-
June 23, 2023 at 9:28 amAlex LambertzSubscriber
Hi 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 pmGuilin SunAnsys Employee
Thank you Alex for the suggestion. I will pass it to the team.
-
June 29, 2023 at 2:48 pmThomas MartineauAnsys Employee
Hi Alex,
Please note that this forum is for Speos and Zemax topics, for Lumerical please use the Photonics one.
Thanks
-
- The topic ‘Cannot figure out options of getresult command (pythonAPI)’ is closed to new replies.
- Errors Running Ring Modulator Example on Cluster
- INTERCONNECT – No results unless rerun simulation until it gives any
- Difference between answers in version 2024 and 2017 lumerical mode solution
- Import material .txt file with script
- Calculation of correlation values in laser modulation bandwidth simulation
- Trapezoidal ring
- Help for qINTERCONNECT
- Issues with getting result from interconnent analysis script
- Topology Optimization Error
- Edge Coupler EME Example Issue
-
1156
-
471
-
468
-
225
-
201
© 2024 Copyright ANSYS, Inc. All rights reserved.