Skip to main content
Solved

How to change settings in Ima for GETTEXTFILE

  • June 25, 2022
  • 1 reply
  • 230 views

Hi,

 

I am  trying to calculate multimode fiber coupling efficiency by using Geometric Image Analysis through GETTEXTFILE, and I want to do this for different fields and wavelengths. I am trying to change field# and wavelength# by MODIFYSETTINGS, but looks like these two parameters are not allowed to be changed. Following is the list of parameters that MODIFYSETTINGS provides:

 

 

I wonder if anyone knows how to make the changes so I can do this calculation using ZPL.

 

Thanks!

Jizuo

Best answer by David.Nguyen

Hi Jizuo,

 

As you have noted, the field and wave numbers don’t seem to be editable with MODIFYSETTINGS in ZPL. One solution, if you want to keep using ZPL, is to manually create multiple CFG files prior to running the macro. Each CFG file would have a field and wave number that is identified in its name, and whenever you run an analysis, you start by specifying the CFG file you require with:

OPENANALYSISWINDOW type, settingsfilename

 

For example, you could have a CFG file syntax like so:

MyCFGFile_<field_number>_<wave_number>.CFG

 

And so, for field 1, and wavelength 1, your CFG file is called: MyCFGFile_1_1.CFG, and for field 1, and wavelength 2, it is: MyCFGFile_1_2.CFG, ...etc.

Then, when you call OPENANALYSISWINDOW, you specified which CFG file to use, therefore, which field and wavenumber:

OPENANALYSISWINDOW “IMA”, “C:\MyCFGFile_1_1.CFG”

 

It does require you to create those CFG files manually once before though.

Otherwise, I think you have to use the ZOSAPI until it gets implemented (if ever) in ZPL. In the ZOSAPI, the field and wave numbers are already implemented:

And so, you can access those directly with:

# Open Geometric Image Analysis
MyIma = TheSystem.Analyses.New_GeometricImageAnalysis()


# Retrieve settings
MyImaSettings = MyIma.GetSettings()


# Modify field number to field 2
MyImaSettings.Field.SetFieldNumbr(2)


# Apply settings and run analysis
MyIma.ApplyAndWaitForCompletion()

 

I hope this helps. Take care,

 

David

View original
Did this topic help you find an answer to your question?

1 reply

David.Nguyen
Luminary
Forum|alt.badge.img+2
  • Luminary
  • 1089 replies
  • Answer
  • June 27, 2022

Hi Jizuo,

 

As you have noted, the field and wave numbers don’t seem to be editable with MODIFYSETTINGS in ZPL. One solution, if you want to keep using ZPL, is to manually create multiple CFG files prior to running the macro. Each CFG file would have a field and wave number that is identified in its name, and whenever you run an analysis, you start by specifying the CFG file you require with:

OPENANALYSISWINDOW type, settingsfilename

 

For example, you could have a CFG file syntax like so:

MyCFGFile_<field_number>_<wave_number>.CFG

 

And so, for field 1, and wavelength 1, your CFG file is called: MyCFGFile_1_1.CFG, and for field 1, and wavelength 2, it is: MyCFGFile_1_2.CFG, ...etc.

Then, when you call OPENANALYSISWINDOW, you specified which CFG file to use, therefore, which field and wavenumber:

OPENANALYSISWINDOW “IMA”, “C:\MyCFGFile_1_1.CFG”

 

It does require you to create those CFG files manually once before though.

Otherwise, I think you have to use the ZOSAPI until it gets implemented (if ever) in ZPL. In the ZOSAPI, the field and wave numbers are already implemented:

And so, you can access those directly with:

# Open Geometric Image Analysis
MyIma = TheSystem.Analyses.New_GeometricImageAnalysis()


# Retrieve settings
MyImaSettings = MyIma.GetSettings()


# Modify field number to field 2
MyImaSettings.Field.SetFieldNumbr(2)


# Apply settings and run analysis
MyIma.ApplyAndWaitForCompletion()

 

I hope this helps. Take care,

 

David


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings