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

Viewing 6 reply threads
  • Author
    Posts
    • #47586
      Christopher Dirdal
      Participant

      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

    • #47597

      you can extract data from the visualizer and save it in .dat file.
      or you mean you need to save it on run time!!

    • #47598
      Christopher Dirdal
      Participant

      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

    • #47600
      Steve Dods
      Participant

      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. 🙁

    • #47646
      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

    • #47647
      Scott Newman
      Moderator

      My m file did not upload, here it is in a zip file.

      Attachments:
    • #47752
      Christopher Dirdal
      Participant

      Thanks a lot! 🙂

Viewing 6 reply threads
  • You must be logged in to reply to this topic.