Skip to content

Instantly share code, notes, and snippets.

@Omnistic
Created May 10, 2021 14:21
Show Gist options
  • Save Omnistic/efcb02f11c3e1764d1f7e623404b19e3 to your computer and use it in GitHub Desktop.
Save Omnistic/efcb02f11c3e1764d1f7e623404b19e3 to your computer and use it in GitHub Desktop.
ZOS-API: Save Polarization Pupil Map results to a text file
# Create a Polarization Pupil Map analysis
MyPolarizationPupilMap = TheSystem.Analyses.New_Analysis(ZOSAPI.Analysis.AnalysisIDM.PolarizationPupilMap)
# Check the implementation status of this analysis feature in the ZOSAPI
print('Does Polarization Pupil Map have fully-implemented settings?', MyPolarizationPupilMap.HasAnalysisSpecificSettings)
# This means the settings needs to be accessed through IAS_.ModifySettings (see Example 17 in the ZOSAPI Syntax Help)
# Retrieve Polarization Pupil Map results
MyPolarizationResults = MyPolarizationPupilMap.GetResults()
# Save results as text file
MyFileName = 'PolarizationPupilMapResults.txt'
if MyPolarizationResults.GetTextFile(TheApplication.SamplesDir + '\\' + MyFileName):
print('Text file created successfully')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment