zospy.analyses.polarization.transmission

Contents

zospy.analyses.polarization.transmission#

zospy.analyses.polarization.transmission(oss: OpticStudioSystem, sampling: str | int = '32x32', unpolarized: bool = False, jx: float = 1, jy: float = 0, x_phase: float = 0, y_phase: float = 0, oncomplete: OnComplete | str = OnComplete.Close, cfgoutfile: str | None = None, txtoutfile: str | None = None) AnalysisResult#

Wrapper around the OpticStudio Polarization Transmission 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.

WARNING: This analysis currently only works for systems with a single wavelength and field. A NotImplementedException will be raised if multiple fields or wavelengths are used. See the discussion in MREYE-LUMC/ZOSPy#14 for more details.

Parameters:
oss: zospy.zpcore.OpticStudioSystem

A ZOSPy OpticStudioSystem instance. Should be sequential.

sampling: str or int

The size of the used grid, either string (e.g. ‘128x128’) or int. The integer will be treated as if obtained from zospy.constants.Analysis.SampleSizes. Defaults to ‘32x32’.

unpolarized: bool

Defines if unpolarized light is used. Defaults to False.

jx: float

Jones x electric field. Defaults to 1.

jy: float

Jones y electric field. Defaults to 0.

x_phase: float

Phase of the X component of the Jones electric field in degrees. Defaults to 0.

y_phase: float

Phase of the Y component of the Jones electric field in degrees. Defaults to 0.

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 or 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. Defaults to None.

txtoutfile: str or 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 Polarization Transmission Analysis. Next to the standard data, the raw text return obtained from the analysis will be present under ‘RawTextData’, and the txtoutfile under ‘TxtOutFile’.

Raises:
NotImplementedException

If multiple fields or wavelenghts are present in the optical system/