Home Forums FDTD Write phase data of observation point to a text-file Reply To: Write phase data of observation point to a text-file

#47646
Profile Photo
Scott Newman
Moderator

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

Categories