Hi All,
I’m trying to automate some Geometric Image Analysis tasks but am struggling to change the wavelength in geometric image analysis.
python 3.10.9
Optics Studio 23.1
I’ve set up the image analysis I want in the project (Cross X, Field size, image size, pixels etc). I’m trying now to loop over wavelengths and save the results. My problem is I can’t figure out how to change the wavelength number within ZOS-API. As far as I can tell the IMA keywords don’t have Wavelength. Thanks for any help!
from the help of ModifySettings keywords
Geometric Image Analysis | IMA_FIELD: The field size. IMA_IMAGESIZE: The image size. IMA_IMANAME: The image file name. IMA_KRAYS: The number of rays x 1000. IMA_NA: The numerical aperture. IMA_OUTNAME: The output file name. IMA_SURFACE: The surface number. IMA_PIXELS: The number of pixels. |
example code:
geo = TheSystem.Analyses.New_GeometricImageAnalysis()
geo_set = geo.GetSettings()
cfgfile = os.path.join(pth,'geo_an_sett.cfg')
geo_set.SaveTo(cfgfile)
geo_set.ModifySettings(cfgfile,'IMA_Wavelength'?,'1') # I can’t find an appropriate keyword to give here
geo_set.LoadFrom(cfgfile)
geo.ApplyAndWaitForCompletion()
res = geo.GetResults()
res.GetTextFile(os.path.join(pth,'textfile.txt'))
r1 = np.loadtxt('analysis/textfile.txt',skiprows=18)x:,1]
nb.
geo_set.Wavelength gives an attribute error.
In 33]: geo_set.Wavelength.SetWavelengthNumber(1)
Traceback (most recent call last):
Cell In:33], line 1
geo_set.Wavelength.SetWavelengthNumber(1)
AttributeError: 'IAS_' object has no attribute 'Wavelength'