ansys_optical_automation.post_process package#

Submodules#

ansys_optical_automation.post_process.dpf_base module#

class ansys_optical_automation.post_process.dpf_base.DataProcessingFramework(extension, application=None)[source]#

Bases: object

Provides DPF (Data Processing Framework).

The class contains opening and saving functionalities to allow interacting with any results file.

Methods

close()

Function to close open files and applications

open_file(str_path)

Open a file in DPF.

valid_dir(str_path)

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

application_list = ['SimpleBSDFSurfaceViewer.Application', 'HDRIViewer.Application', 'XMPViewer.Application']#
binary_format = {'.dat', '.ray', '.sdf'}#
close()[source]#

Function to close open files and applications

Returns
None
open_file(str_path)[source]#

Open a file in DPF.

Parameters
str_pathstr

Path for the file to open. For example, r"C:\temp\Test.speos360".

Returns
None
text_format = {'.spcd', '.spectrum'}#
valid_dir(str_path)[source]#

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

Parameters
str_pathstr

Path for the folder to validate or create. For example, r"C:\temp".

Returns
None

ansys_optical_automation.post_process.dpf_brdf_viewer module#

class ansys_optical_automation.post_process.dpf_brdf_viewer.BrdfMeasurementPoint(input_incidence, input_wavelength, input_theta, input_brdf)[source]#

Bases: object

class of a single brdf point measure: brdf = f(wavelength, incidence, theta) no phi dependency for measured brdf

class ansys_optical_automation.post_process.dpf_brdf_viewer.BrdfStructure(wavelength_list)[source]#

Bases: object

class of BRDF contains method to host and convert 2d reflectance brdf values into 3d brdf file.

Methods

brdf_1d_function(wavelength, incident)

to provide a 1d linear fitting function for 2d measurement brdf points.

convert([sampling])

convert the provided 2d measurement brdf data.

export_to_speos(export_dir)

save the 4d brdf structure into a brdf file.

brdf_1d_function(wavelength, incident)[source]#

to provide a 1d linear fitting function for 2d measurement brdf points.

Parameters
wavelengthfloat

wavelength used to find the target brdf values.

incidentfloat

incident used to find the target brdf values.

Returns
convert(sampling=1)[source]#

convert the provided 2d measurement brdf data.

Parameters
samplingint

sampling used for exported 4d brdf structure.

Returns
None
export_to_speos(export_dir)[source]#

save the 4d brdf structure into a brdf file.

Parameters
export_dirstr

directory to be exported

Returns

ansys_optical_automation.post_process.dpf_hdri_viewer module#

class ansys_optical_automation.post_process.dpf_hdri_viewer.DpfHdriViewer[source]#

Bases: ansys_optical_automation.post_process.dpf_base.DataProcessingFramework

Provides for launching Speos postprocessing software, Virtual reality lab.

This framework is used to interact with the software and automatically perform analysis and postprocessing on the simulation results

Methods

close()

Function to close open files and applications

export_vr_views([export_path, phi_angles, ...])

Export VR results for all or specific configurations for defined angles or all angles as image (JPG) files.

get_source_list()

Get the source list stored in the simulation result.

open_file(str_path)

Open a file in DPF.

set_source_power(source, value)

Set the source with power value provided.

set_source_ratio(source, value)

Set the source with power ratio value provided.

timeline_animation_run(csv_file)

function to run animation in observer result.

valid_dir(str_path)

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

export_vr_views(export_path=None, phi_angles=None, theta_angles=None, config_ids=None)[source]#

Export VR results for all or specific configurations for defined angles or all angles as image (JPG) files.

Parameters
export_pathstring

Path for exporting the JPG files. If this path does not exist, it is created.

phi_angleslist of floats, optional

List of phi angles to export. The default is None, in which case all phi angles are exported.

theta_angleslist of floats, optional

List of theta angles to export. The default is None, in which case all theta angles are exported.

config_idslist of positive integers or list of strings or a string or an integer, optional

List of configurations IDs to export. The default is None, in which case all configuration IDs are exported.

get_source_list()[source]#

Get the source list stored in the simulation result.

Returns
list

List of sources available in the postprocessing file.

set_source_power(source, value)[source]#

Set the source with power value provided.

Parameters
sourceint/str

source defined by id or name.

valuefloat

source power.

Returns
set_source_ratio(source, value)[source]#

Set the source with power ratio value provided.

Parameters
sourceint/str

source defined by id or name

valuefloat

source power ratio

Returns
timeline_animation_run(csv_file)[source]#

function to run animation in observer result.

Parameters
csv_filestr

file path of time line csv file

Returns

ansys_optical_automation.post_process.dpf_rayfile module#

class ansys_optical_automation.post_process.dpf_rayfile.DpfRay(x, y, z, l_dir, m_dir, n_dir, wavelength, e)[source]#

Bases: object

this class defines the ray property

Attributes
coordinate_x

return ray cardinal_coordinate_x

coordinate_y

return ray cardinal_coordinate_y

coordinate_z

return ray cardinal_coordinate_z

energy

return ray energy

radiation_l

return ray vector_radiation_l

radiation_m

return ray vector_radiation_m

radiation_n

return ray vector_radiation_n

wavelength

return ray wavelength

property coordinate_x: float#

return ray cardinal_coordinate_x Returns:

cardinal_coordinate_x

property coordinate_y: float#

return ray cardinal_coordinate_y Returns:

cardinal_coordinate_y

property coordinate_z: float#

return ray cardinal_coordinate_z Returns:

cardinal_coordinate_z

property energy: float#

return ray energy Returns:

energy

property radiation_l: float#

return ray vector_radiation_l Returns:

vector_radiation_l

property radiation_m: float#

return ray vector_radiation_m Returns:

vector_radiation_m

property radiation_n: float#

return ray vector_radiation_n Returns:

vector_radiation_n

property wavelength: float#

return ray wavelength Returns:

wavelength

class ansys_optical_automation.post_process.dpf_rayfile.DpfRayfile(file_path)[source]#

Bases: ansys_optical_automation.post_process.dpf_base.DataProcessingFramework

this class contains method to read extract ray data from given binary rayfile

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

valid_dir(str_path)

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

conversion_extension = {'.dat': '.ray', '.ray': '.sdf', '.sdf': '.ray'}#
export_file(export_folder_dir=None, convert=False)[source]#

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

export_folder_dirstr ,optional

defines path where to export the rayfile

convertBoolean , optional

defines if the export is a conversion, default value is False

outfile: str

output file

export_to_speos()[source]#

this method convert the rayfile into speos format

Returns
None
export_to_zemax()[source]#

this method convert the rayfile into zemax format

Returns
None
load_content()[source]#

this method load the information from rayfile provided

Returns
property photometric_power: float#

this method return Photometric Power value Returns:

Photometric Power value

property radiometric_power: float#

this method return the Radiometric Power value Returns:

Radiometric Power value

property rays: [<class 'ansys_optical_automation.post_process.dpf_rayfile.DpfRay'>]#

this method return a list of rays Returns:

a list of rays

property rays_number: int#

this method return the number of rays Returns:

number of rays in rayfile

set_ray_count(raynumber)[source]#

redfine raynumber Parameters ———- raynumber : int

Returns

ansys_optical_automation.post_process.dpf_stack module#

class ansys_optical_automation.post_process.dpf_stack.DpfStack(version)[source]#

Bases: object

Provides DPF (Data Processing Framework).

The class contains opening and saving functionalities to allow interacting between stack and speos and zemax.

Methods

convert_stack_to_speos()

conver the stack result into required information by speos coated file.

convert_stack_to_zemax()

conver the stack result into required information by Zemax .dat coating file.

open_file(stack_file)

Open a stack file.

convert_stack_to_speos()[source]#

conver the stack result into required information by speos coated file.

convert_stack_to_zemax()[source]#

conver the stack result into required information by Zemax .dat coating file.

open_file(stack_file)[source]#

Open a stack file.

Parameters
stack_filestr

directory of stack file

ansys_optical_automation.post_process.dpf_xmp_viewer module#

class ansys_optical_automation.post_process.dpf_xmp_viewer.DpfXmpViewer[source]#

Bases: ansys_optical_automation.post_process.dpf_base.DataProcessingFramework

Provides for launching Speos postprocessing software, XMP Viewer.

This framework is used to interact with the software and automatically perform analysis and postprocessing on the simulation results

Methods

close()

Function to close open files and applications

export([format])

function to export an XMP map to another format

export_template_measures(template_path, ...)

Function to import measurement tamplate and export measures as text Parameters ---------- template_path : str path to XML template file export_path : str path to measurement text export

open_file(str_path)

Open a file in DPF.

read_txt_export(txt_path[, inc_data])

Parameters

rect_export_spectrum(x_pos, y_pos, width, height)

Parameters

valid_dir(str_path)

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

export(format='txt')[source]#

function to export an XMP map to another format

Parameters
formatstr

export format allowed values [“txt”, “png”, “bmp”, “jpg”, “tiff”, “pf”, “ies”, “ldt”, “extended.txt”]

export_template_measures(template_path, export_path)[source]#

Function to import measurement tamplate and export measures as text Parameters ———- template_path : str

path to XML template file

export_pathstr

path to measurement text export

Returns
None
open_file(str_path)[source]#

Open a file in DPF.

Parameters
str_pathstr

Path for the file to open. For example, r"C:\temp\Test.speos360".

Returns
None
read_txt_export(txt_path, inc_data=False)[source]#
Parameters
txt_pathstr

string pointing to the textfile

inc_databool

Boolean to determine if to include data matrix as list currently not working correctly

Returns
MapStruct:

MapStruct created according to the text file.

rect_export_spectrum(x_pos, y_pos, width, height)[source]#
Parameters
x_posfloat

x position of rectangle

y_posfloat

y position of rectangle

widthfloat

width or rectangle

heightfloat

height of rectangle

Returns
return list of wavelength and list of energy values
class ansys_optical_automation.post_process.dpf_xmp_viewer.MapStruct(map_type, value_type, intensity_type, unit_type, axis_unit, size, resolution, layers=1, layer_name=None, wl_res=None)[source]#

Bases: object

Provides a DPF to represent the data stored in an Ansys Speos XMP file

Methods

export_to_xmp([export_path])

this function exports the current mapstruct in the dir defined as Mapstruct.xmp. Parameters ---------- export_path: str path to be exported. Default at C: emp.

valid_dir(str_path)

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

export_to_xmp(export_path='C:\\temp')[source]#

this function exports the current mapstruct in the dir defined as Mapstruct.xmp. Parameters ———- export_path: str

path to be exported. Default at C: emp

Returns
DpfXmpViewer object
valid_dir(str_path)[source]#

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

Parameters
str_pathstr

Path for the folder to validate or create. For example, r"C:\temp".

Returns
None

Module contents#