Is there a way to load preset tables for the Field Data Editor (.fld) and Wavelength Data (.wav) in the API?
I’m not seeing a way in the syntax help guide for any type of loading of files in the SystemData namespace.
Is there a way to load preset tables for the Field Data Editor (.fld) and Wavelength Data (.wav) in the API?
I’m not seeing a way in the syntax help guide for any type of loading of files in the SystemData namespace.
Hi Alex,
Currently there is no way to load a WAV or FLD file via the ZOS-API.
Adding and removing wavelengths is extremely fast via the ZOS-API, so I would simply read the WAV file as a text file and change the IWavelength interface manually.
If speed isn’t an issue, then you can use the same approach for a FLD file since this is also text based & human readable.
However, if speed is an issue, adding and removing fields, is extremely slow via the ZOS-API. When Zemax extended from 12 to 50 (Professional) or 2025 (Premium/Enterprise) fields, they did not refactor the underlying source code for handling fields. Each addition/removal of a field causes a full optical system update and with complex systems or systems with a lot of fields, this update can take seconds. The 2 recommendations I have for dealing with a lot of fields are:
XFLN
, YFLN
, FWGN
, VDXN
, VDYN
, VCXN
, VCYN
, VANN
commands. Any fields higher than 12 are designated with the FENF
command to let OpticStudio know the total number of fields. Then, fields 13 and above are each defined on a single line using the FEFD
command. Approach #2 will be faster since the core code only needs to update/load the fields one time, but will be more error prone.
Hi Michael,
Thanks for your response. Yeah sadly speed is a bit of an issue as my simulation already takes a full work day.
I wonder then if it is any quicker just to load a completely new .zmx file?
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.