zospy.analyses.base.Analysis#

class zospy.analyses.base.Analysis#

Bases: object

Attributes:
Results

Analysis results.

Settings

Analysis-specific settings.

Methods

complete(oncomplete, result)

Completes the analysis by either closing, releasing or sustaining it.

get_field()

Gets the wavelength value of the analysis.

get_header_data()

Obtains the header data from an OpticStudio analysis.

get_messages()

Obtains the messages from the analysis.

get_metadata()

Obtains the metadata from the analysis.

get_wavelength()

Gets the wavelength value of the analysis.

set_field(value)

Sets the field value for the analysis.

set_surface(value)

Sets the surface value for the analysis.

set_wavelength(value)

Sets the wavelength value for the analysis.

property Results: ZOSAPI.Analysis.Data.IAR_#

Analysis results.

property Settings: ZOSAPI.Analysis.Settings.IAS_#

Analysis-specific settings.

__init__(analysis: ZOSAPI.Analysis.IA_)#

Zemax OpticStudio Analysis with full access to its Settings and Results attributes.

Parameters:
analysis: ZOSAPI.Analysis.IA_

analysis object

complete(oncomplete: OnComplete | str, result: AnalysisResult) AnalysisResult#

Completes the analysis by either closing, releasing or sustaining it.

Parameters:
oncomplete: OnComplete | str

Action to perform on completion.

result: AnalysisResult

Result of the analysis.

Returns:
result if the analysis is closed or released, result extended with the Analysis object if the analysis
is sustained.
get_field() int | str#

Gets the wavelength value of the analysis.

Returns:
int | str

Either the field number, or ‘All’ if field was set to ‘All’.

get_header_data() list[str]#

Obtains the header data from an OpticStudio analysis.

Returns:
list

The header data.

get_messages() list[AnalysisMessage]#

Obtains the messages from the analysis.

Returns:
list[AnalysisMessage]

A list of messages. Each item is a NamedTuple with names (ErrorCode, Message).

get_metadata() AnalysisMetadata#

Obtains the metadata from the analysis.

Returns:
AnalysisMetadata

A named tuple containing the MetaData including ‘DateTime’, ‘FeatureDescription’, ‘LensFile’ and ‘LensTitle’.

get_wavelength() int | str#

Gets the wavelength value of the analysis.

Returns:
int | str

Either the wavelength number, or ‘All’ if wavelength was set to ‘All’.

set_field(value: int | str)#

Sets the field value for the analysis.

Parameters:
value: int or str

The value to which the field should be set. Either int or str. Accepts only ‘All’ as string.

Returns:
None
Raises:
ValueError

When ‘value’ is not integer or string. When it is a string, it also raises an error when the string does not equal ‘All’.

set_surface(value: int | str)#

Sets the surface value for the analysis.

Parameters:
value: int or str

The value to which the surface should be set. Either int or str. Accepts only ‘Image’ or ‘Objective’ as string.

Returns:
None
Raises:
ValueError

When ‘value’ is not integer or string. When it is a string, it also raises an error when the string does not equal ‘Image’ or ‘Objective’.

set_wavelength(value: int | str)#

Sets the wavelength value for the analysis.

Parameters:
value: int | str

The value to which the wavelength should be set. Either int or str. Accepts only ‘All’ as string.

Returns:
None
Raises:
ValueError

When ‘value’ is not integer or string. When it is a string, it also raises an error when the string does not equal ‘All’.