ansys_optical_automation.interop_process package#

Submodules#

ansys_optical_automation.interop_process.BSDF_converter module#

class ansys_optical_automation.interop_process.BSDF_converter.BsdfStructure[source]#

Bases: object

class of BSDF data contains method to host bsdf data

Methods

calculate_tis_data(bool_log)

That function computes the TIS values from the BSDF data and one TIS value

convert_rgb_to_spectrum_value(rgb_tuple, ...)

function to convert an RGB tuple to a spectrum Parameters ---------- wavelength: float wavelength of conversion rgb_tuple: tuple 3 floats of RGB Returns ------- spectrumvalue at wavelength: floats

converter_coordinate_system_bsdf(...)

That function converts the bsdf data

get_srgb_spectrum_at_wavelength(...)

Method to extrapolar Parameters ---------- conversion_spectrum: list Spectrum data in % values 0-100 wl_start: float start wavelength in nm wl_end: float end wavelength in nm Returns ------- spectrum value in % 0-100

normalize_bsdf_data(bool_log)

That function normalizes the BSDF data vs the TIS values

obsolete_phi_theta_output()

That function writes the text nLines in the file

read_speos_anisotropicbsdf(bool_log)

That function reads Speos anisotropicbsdf file

read_speos_brdf(bool_log)

That function reads Speos BSDF file

read_zemax_bsdf(bool_log)

That function reads Zemax BSDF file

write_speos_data_anisotropicbsdf(nLines)

That function writes the main data of Speos BSDF file

write_speos_header_anisotropicbsdf()

That function writes the header of Speos BSDF file

write_zemax_data_bsdf(index_RT, index_wavelength)

That function writes the main data of Zemax BSDF file

write_zemax_header_bsdf(index_RT, ...)

That function writes the header of Zemax BSDF file

import_data

write_speos_anisotropicbsdf_file

write_zemax_file

calculate_tis_data(bool_log)[source]#

That function computes the TIS values from the BSDF data and one TIS value

convert_rgb_to_spectrum_value(rgb_tuple, wavelength)[source]#

function to convert an RGB tuple to a spectrum Parameters ———- wavelength: float

wavelength of conversion

rgb_tuple: tuple

3 floats of RGB

spectrumvalue at wavelength: floats

converter_coordinate_system_bsdf(bool_normal_1, bool_log)[source]#

That function converts the bsdf data

static get_srgb_spectrum_at_wavelength(conversion_spectrum, wl_start, wl_end, wl)[source]#

Method to extrapolar Parameters ———- conversion_spectrum: list

Spectrum data in % values 0-100

wl_start: float

start wavelength in nm

wl_end: float

end wavelength in nm

spectrum value in % 0-100

import_data(bool_log=True)[source]#
normalize_bsdf_data(bool_log)[source]#

That function normalizes the BSDF data vs the TIS values

obsolete_phi_theta_output()[source]#

That function writes the text nLines in the file

read_speos_anisotropicbsdf(bool_log)[source]#

That function reads Speos anisotropicbsdf file

Parameters
bool_logboolean

0 –> no report / 1 –> reports values

read_speos_brdf(bool_log)[source]#

That function reads Speos BSDF file

Parameters
bool_logboolean

0 –> no report / 1 –> reports values

read_zemax_bsdf(bool_log)[source]#

That function reads Zemax BSDF file

Parameters
bool_logboolean

0 –> no report / 1 –> reports values

write_speos_anisotropicbsdf_file()[source]#
write_speos_data_anisotropicbsdf(nLines)[source]#

That function writes the main data of Speos BSDF file

write_speos_header_anisotropicbsdf()[source]#

That function writes the header of Speos BSDF file

write_zemax_data_bsdf(index_RT, index_wavelength)[source]#

That function writes the main data of Zemax BSDF file

write_zemax_file(bool_log)[source]#
write_zemax_header_bsdf(index_RT, index_wavelength)[source]#

That function writes the header of Zemax BSDF file

ansys_optical_automation.interop_process.BSDF_converter.compute_new_value_matrix(matrix_z, line_x, line_y, new_x, new_y)[source]#

That function takes (x,y) as an argument and returns a new interpolated value from a matrix[x,y]

Parameters
matrix_zmatrix of z values

matrix giving a z value for a set of x,y values

line_xlist

List of x

line_ylist

List of y

new_xflaot

New value of theta

new_yflaot

New value of phi

ansys_optical_automation.interop_process.BSDF_converter.convert_normal_to_specular_using_cartesian(theta_i, phi_i, angle_inc)[source]#

That function converts from normal to specular reference using cartesian coordinates phi_i = 0 in the normal reference = phi_o = 180 in the specular reference

Parameters
theta_ifloat

Scattered polar angle in the normal reference

phi_ifloat

Scattered azimuthal angle in the normal reference

angle_incfloat

Angle of incidence

ansys_optical_automation.interop_process.BSDF_converter.convert_normal_to_specular_using_cylindrical(theta_i, phi_i, angle_inc)[source]#

That function converts from normal to specular reference using cylindrical cartesian conversion phi = 0 top of the plot

Parameters
theta_ifloat

Scattered polar angle in the normal reference

phi_ifloat

Scattered azimuthal angle in the normal reference

angle_incfloat

Angle of incidence

ansys_optical_automation.interop_process.BSDF_converter.convert_normal_to_specular_using_cylindrical_phiref(theta_i, phi_i, angle_inc)[source]#

That function converts from normal to specular reference using cylindrical cartesian conversion phi=0 for OpticStudio is phi=180 for speos phi = 0 top of the plot

Parameters
theta_ifloat

Scattered polar angle in the normal reference

phi_ifloat

Scattered azimuthal angle in the normal reference

angle_incfloat

Angle of incidence

ansys_optical_automation.interop_process.BSDF_converter.convert_specular_to_normal_using_cartesian(theta_i, phi_i, angle_inc)[source]#

That function converts from specular to normal reference using cartesian coordinates Specular reference: phi = 0 top of the plot Normal reference: phi = 0 bottom of the plot

Parameters
theta_ifloat

Scattered polar angle in the specular reference

phi_ifloat

Scattered azimuthal angle in the specular reference

angle_incfloat

Angle of incidence

ansys_optical_automation.interop_process.BSDF_converter.phi_theta_output(theta_input, phi_input, zemax_or_speos)[source]#

That function writes the text nLines in the file

ansys_optical_automation.interop_process.BSDF_converter.swap_columns(arr)[source]#
ansys_optical_automation.interop_process.BSDF_converter.swap_rows(arr)[source]#
ansys_optical_automation.interop_process.BSDF_converter.write_file(outputFilepath, nLines)[source]#

That function writes the text nLines in the file

Parameters
nLinestext

Text containing the data

outputFilepathfilename

file to write

ansys_optical_automation.interop_process.coating_converter module#

ansys_optical_automation.interop_process.rayfile_converter module#

class ansys_optical_automation.interop_process.rayfile_converter.RayfileConverter(file_path)[source]#

Bases: ansys_optical_automation.post_process.dpf_rayfile.DpfRayfile

This class contains the methods to convert rayfile between speos and zemax

Attributes
photometric_power

this method return Photometric Power value

radiometric_power

this method return the Radiometric Power value

rays

this method return a list of rays

rays_number

this method return the number of rays

Methods

close()

Function to close open files and applications

export_file([export_folder_dir, convert])

this method generates a file to be exported Parameters ----------

export_to_speos()

this method convert the rayfile into speos format

export_to_zemax()

this method convert the rayfile into zemax format

load_content()

this method load the information from rayfile provided

open_file(str_path)

Open a file in DPF.

set_ray_count(raynumber)

redfine raynumber Parameters ---------- raynumber : int

speos_to_zemax()

this method will read the speos rayfile content and convert it to zemax format

valid_dir(str_path)

Check if a folder is present and, if not, create it.

zemax_to_speos()

this method convert the zemax rayfile into speos format

speos_to_zemax()[source]#

this method will read the speos rayfile content and convert it to zemax format

Returns
None
zemax_to_speos()[source]#

this method convert the zemax rayfile into speos format

Returns
None

Module contents#