zospy.analyses.reports.surface_data

Contents

zospy.analyses.reports.surface_data#

zospy.analyses.reports.surface_data(oss: OpticStudioSystem, surface: int, oncomplete: OnComplete | str = OnComplete.Close, cfgoutfile: str | None = None, txtoutfile: str | None = None) AnalysisResult#

Wrapper around the OpticStudio Surface Data Analysis.

Due to limitations in the ZOS-API, the output is obtained by writing the OpticStudio results to a file and subsequently reading in this file

Parameters:
oss: zospy.zpcore.OpticStudioSystem

A ZOSPy OpticStudioSystem instance. Should be sequential.

surface: int

The surface number that is to be analyzed

oncomplete: OnComplete | str

Defines behaviour upon completion of the analysis. Should be one of [‘Close’, ‘Release’, ‘Sustain’]. If ‘Close’, the analysis will be closed after completion. If ‘Release’, the analysis will remain open in OpticStudio, but the link with python will be destroyed. If ‘Sustain’ the analysis will be kept open in OpticStudio and the link with python will be sustained. To enable interaction when oncomplete == ‘Sustain’, the OpticStudio Analysis instance will be available in the returned AnalysisResult through AnalysisResult.Analysis. Defaults to ‘Close’.

cfgoutfile: str | None

The configuration file to which the current configuration is saved. If None, a temporary file will be created and deleted. If string, it should be a full system path with ‘.CFG’ as extension, after which the file will be saved in that location. (Allowing usage of this configuration file using surface_data_fromcfg()). Defaults to None.

txtoutfile: str | None

The textfile to which the OpticStudio output is saved. If None, a temporary file will be created and deleted. If string, it should be a full system path with ‘.txt’ as extension, after which the file will be saved in that location. Defaults to None.

Returns:
AnalysisResult

A SurfaceDataSettings analysis result. Next to the standard data, the raw text return obtained from the analysis will be present under ‘RawTextData’, the cfgoutfile under ‘CfgOutFile’, and the txtoutfile under ‘TxtOutFile’.