Skip to main content

ZOS-API interface 2024 R2 SP02

ZOSAPI.Analysis.Settings.IAS_Wavelength Interface Reference

Last update: 17.07.2025

Public Member Functions

int GetWavelengthNumber ()
 
IMessage SetWavelengthNumber (int N)
 
IMessage UseAllWavelengths ()
 

Member Function Documentation

◆ GetWavelengthNumber()

int ZOSAPI.Analysis.Settings.IAS_Wavelength.GetWavelengthNumber ( )

◆ SetWavelengthNumber()

IMessage ZOSAPI.Analysis.Settings.IAS_Wavelength.SetWavelengthNumber ( int  N)

Usage (see Example 22 for a full sample)

C#

// Spot Diagram Analysis Results
ZOSAPI.Analysis.IA_ spot = TheSystem.Analyses.New_Analysis(ZOSAPI.Analysis.AnalysisIDM.StandardSpot);
spot_setting.Field.SetFieldNumber(0);
spot_setting.ReferTo = ZOSAPI.Analysis.Settings.Spot.Reference.Centroid;
Base interface for all analysis windows. This interface can be accessed via the I_Analyses interface.
Definition: IA_Base.cs:29
IAS_ GetSettings()
Gets the settings for the current analysis.
Definition: IAS_Spot.cs:50
IAS_Field Field
Definition: IAS_Spot.cs:51
IAS_Wavelength Wavelength
Definition: IAS_Spot.cs:53
Definition: IAS_Spot.cs:5
Definition: IAS_FieldCurvatureAndDistortion.cs:5
Definition: IAS_FieldCurvatureAndDistortion.cs:5
The ZOSAPI namespace contains classes for initially connecting to zemax. See also ZOSAPI_Connection,...
Definition: IAS_FieldCurvatureAndDistortion.cs:5

C++

// Spot Diagram Analysis Results
IA_Ptr spot = TheSystem->Analyses->New_Analysis(AnalysisIDM::AnalysisIDM_StandardSpot);
IAS_SpotPtr spot_setting = spot->GetSettings();
spot_setting->Field->SetFieldNumber(0);
spot_setting->Wavelength->SetWavelengthNumber(0);
spot_setting->ReferTo = Reference::Reference_Centroid;

Matlab

% Spot Diagram Analysis Results
spot = TheSystem.Analyses.New_Analysis(ZOSAPI.Analysis.AnalysisIDM.StandardSpot);
spot_setting = spot.GetSettings();
spot_setting.Field.SetFieldNumber(0);
spot_setting.Wavelength.SetWavelengthNumber(0);
spot_setting.ReferTo = ZOSAPI.Analysis.Settings.Spot.Reference.Centroid;

Python

# Spot Diagram Analysis Results
spot = TheSystem.Analyses.New_Analysis(ZOSAPI.Analysis.AnalysisIDM.StandardSpot)
spot_setting = spot.GetSettings()
spot_setting.Field.SetFieldNumber(0)
spot_setting.Wavelength.SetWavelengthNumber(0)
spot_setting.ReferTo = ZOSAPI.Analysis.Settings.RMS.ReferTo.Centroid
Examples
CSharpStandalone_22_seq_spot_diagram.cs.

◆ UseAllWavelengths()

IMessage ZOSAPI.Analysis.Settings.IAS_Wavelength.UseAllWavelengths ( )

Usage (see Example 23 for a full sample)

C#

// Read batch raytrace and save results
normUnPolData.StartReadingResults();
int rayNumber, ErrorCode, vignetteCode;
double double_X, double_Y, double_Z, double_L, double_M, double_N, double_L2, double_M2, double_N2, OPD, Intensity;
bool success;
success = normUnPolData.ReadNextResult(out rayNumber, out ErrorCode, out vignetteCode, out double_X, out double_Y, out double_Z, out double_L, out double_M, out double_N, out double_L2, out double_M2, out double_N2, out OPD, out Intensity);
while (success)
{
if ((ErrorCode == 0) && (vignetteCode == 0))
{
y_ary[field - 1, wave - 1, rayNumber - 1] = double_Y;
sbReport.AppendLine((field).ToString() + "\t" + (wave).ToString() + "\t" + py_ary[rayNumber - 1].ToString() + "\t" + ((double_Y - chief_ary[field - 1]) * 1000).ToString());
}
success = normUnPolData.ReadNextResult(out rayNumber, out ErrorCode, out vignetteCode, out double_X, out double_Y, out double_Z, out double_L, out double_M, out double_N, out double_L2, out double_M2, out double_N2, out OPD, out Intensity);
}
sbReport.AppendLine("");

C++

// Read and display results
normUnPolData->StartReadingResults();
long rayNumber, errCode, vigCode;
double rayX, rayY, rayZ, rayL, rayM, rayN, rayl2, raym2, rayn2, rayopd, rayintensiry;
textfile << "Field [" << field << "] and Wave# [" << wave << "]\n";
textfile << "Ray# Py REAY\n";
VARIANT_BOOL success = normUnPolData->ReadNextResult(&rayNumber, &errCode, &vigCode, &rayX, &rayY, &rayZ, &rayL, &rayM, &rayN, &rayl2, &raym2, &rayn2, &rayopd, &rayintensiry);
while (success) {
if ((errCode == 0) && (vigCode == 0)) {
textfile << setw(7) << rayNumber << setw(15) << left << py_ary[rayNumber - 1] << setw(15) << left << ((rayY - chief_ary[field - 1]) * 1000) << "\n";
y_ary[field - 1][wave - 1][rayNumber - 1] = rayY;
}
success = normUnPolData->ReadNextResult(&rayNumber, &errCode, &vigCode, &rayX, &rayY, &rayZ, &rayL, &rayM, &rayN, &rayl2, &raym2, &rayn2, &rayopd, &rayintensiry);
}
textfile << endl;

Matlab

% Read and display results
normUnPolData.StartReadingResults();
[success, rayNumber, errCode, vigCode, ~, y, ~, ~, ~, ~, ~, ~, ~, ~, ~] = normUnPolData.ReadNextResult();
while success
if ((errCode == 0 ) && (vigCode == 0))
y_ary(field, wave, rayNumber) = y;
end
[success, rayNumber, errCode, vigCode, ~, y, ~, ~, ~, ~, ~, ~, ~, ~, ~] = normUnPolData.ReadNextResult();
end
plot(py_ary(:), squeeze((y_ary(field, wave, :) - chief_ary(field)) * 1000), '-', 'MarkerSize', 4);

Python

# Read and display results
normUnPolData.StartReadingResults()
# Python NET requires all arguments to be passed in as reference, so need to have placeholders
sysInt = Int32(1)
sysDbl = Double(1.0)
output = normUnPolData.ReadNextResult(sysInt, sysInt, sysInt,
sysDbl, sysDbl, sysDbl, sysDbl, sysDbl, sysDbl, sysDbl, sysDbl, sysDbl, sysDbl, sysDbl);
while output[0]:
if (output[2] == 0 and output[3] == 0):
y_ary[field, wave, output[1] - 1] = output[5]
# Python NET requires all arguments to be passed in as reference, so need to have placeholders
output = normUnPolData.ReadNextResult(sysInt, sysInt, sysInt,
sysDbl, sysDbl, sysDbl, sysDbl, sysDbl, sysDbl, sysDbl, sysDbl, sysDbl, sysDbl, sysDbl);
plt.plot(py_ary[:], np.squeeze((y_ary[field, wave,:] - chief_ary[field - 1]) * 1000), '-', ms = 4)
Examples
CSharpStandalone_23_ray_fan_native_manual_comparison.cs.

Connect with Ansys