- This topic has 2 replies, 2 voices, and was last updated 6 years, 9 months ago by Christopher Dirdal.
-
AuthorPosts
-
-
February 14, 2018 at 2:52 am #47753Christopher DirdalParticipant
Hi!
I’m currently using optiFDTD to analyze the polarization of light after scattering. I currently use VB-scripting to export the Ex and Ey field data from an observation area using GetField(FieldComponent, WaveLength), and then I use this data to plot the Stoke’s parameters on a PoincarĂ© sphere. I am however limited to using the center-wavelength, while I’d like to export the field data from all wavelengths from the DFT list. In the VB-script reference I see that I am able to find the start and end wavelength using
SimCtrlParams3D.GetDFTStartWavelength()
SimCtrlParams3D.GetDFTEndWavelength()However, it seems that the intermediate wavelength points are not linearly placed (i.e. rather the corresponding frequencies have fixed increments). I’ve attempted to solve this by calculating the frequency increment and using it to find the next wavelength, but this ultimately fails because the GetField() function seems to require exact wavelengths to ~15 digits, which is hard due to rounding etc.
So: Is there any way I can get hold of the actual DFT list? Or is there any other way of characterizing the polarization state within the OptiFDTD analyzer?
Thank you
-
March 9, 2018 at 9:01 am #48044Scott NewmanModerator
Hello Christopher,
You are correct in that there is currently no direct way to access the wavlengths for a given DFT. This has been noted as a feature that is required and will be remedied when we can. In the mean time I do have a work around that I use. When you use the CalculatePowerSpectrumTotal() function for a given observation area you will get a XY vector where X is the wavlengths and Y is the DFT amplitude. You can use this to parse through and obtain your wavelengths. You can find an example of this script I used on a simulation with “ObservationArea1” where I was interested in the Ey field.
ParamMgr.Simulate
WGMgr.Sleep( 50 )N = SimCtrlParams2D.GetDFTNumberOfSpectrumSamples()
set area = ObservePtMgr.GetObjFromID(“ObservationArea1”)
set spectrum = area.CalculatePowerSpectrumTotal()For i = 1 to N
lambda = spectrum.GetXat(i)
set field = area.GetField(“Ey”, lambda)
field.WriteF3D(“Ey_”&lambda&”.f3d”)
Next -
March 15, 2018 at 3:45 am #48096Christopher DirdalParticipant
Thanks! This did the trick.
-
-
AuthorPosts
- You must be logged in to reply to this topic.