- This topic has 6 replies, 4 voices, and was last updated 6 years, 10 months ago by Christopher Dirdal.
-
AuthorPosts
-
-
January 29, 2018 at 7:08 am #47586Christopher DirdalParticipant
I am doing large sweep simulations and would like to write the phase data of an observation point (found under Frequency DFT) to a text file for a given wavelength (e.g. center wavelength, or multiple wavelengths if possible). I have found the scripts for exporting the transmission power spectrum of an observation area to a text-file, but I am unsure how to extract field information.
Any help will be much appreciated!
Br
Christopher -
January 30, 2018 at 8:10 am #47597Mohamed A. A. AbouseifParticipant
you can extract data from the visualizer and save it in .dat file.
or you mean you need to save it on run time!! -
January 30, 2018 at 8:18 am #47598Christopher DirdalParticipant
Thank you for your reply,
Yes I would like to save it during run-time. Is this possible?
It takes a lot of time to access each individual analyzer file and export the field data.
Chris
-
January 30, 2018 at 10:56 am #47600Steve DodsParticipant
It appears that OptiFDTD can export DFT data from Observation Area and Observation Lines. It can also export time series data from Observation Points. However, the function of export of DFT data from Observation Points seems to be missing. Sorry about that. 🙁
-
February 5, 2018 at 4:58 pm #47646Scott NewmanModerator
Hello Christopher,
As Steve stated you are limited to only exporting the time series data for an observation point. You would need to perform the DFT yourself. The script you would need to run within OptiFDTD would be the following (note that my observation point is ObservationPoint1 and I am running an Ey polarized source).
dim observationPoint1
set observationPoint1 = ObservePtMgr.GetObjFromID(“ObservationPoint1”)ParamMgr.Simulate
WGMgr.Sleep( 50 )dim TimeSeries
set TimeSeries = observationPoint1.GetTimeSeries(“Ey”)TimeSeries.WriteF2D(“Ey.f2d”)
You would then need to process this in Matlab, I have attached a matlab script that will calculate the dft with real, imag, amp, and phase. Note this fft is based on the number of time samples and will not show the oscillations at the lower frequencies. Make sure the filename in the dlmread is the same as the filename you used in the WriteF2D command.
Hope this helps.
Scott
-
February 5, 2018 at 4:59 pm #47647Scott NewmanModerator
My m file did not upload, here it is in a zip file.
-
February 14, 2018 at 2:38 am #47752Christopher DirdalParticipant
Thanks a lot! 🙂
-
-
AuthorPosts
- You must be logged in to reply to this topic.