Utility Functions#

These functions are provided as general utility to skZemax.

skZemax.skZemax_subfunctions._utility_functions.Utilities_AnalysesFilesDir(self) str[source]#

Returns a skZemax default directory of Zemax (intermediate) analyses files.

Returns:

Absolute path to the analysis files directory.

Return type:

str

skZemax.skZemax_subfunctions._utility_functions.Utilities_ConfigFilesDir(self) str[source]#

Returns a skZemax default directory of Zemax configuration files. For instance, the ZOS-API for analyses functions does not generally work natively. To bypass this, skZemax writes - and then loads - intermediate configuration files for it. These files are stored in this directory.

Returns:

Path to dir.

Return type:

str

skZemax.skZemax_subfunctions._utility_functions.Utilities_DetectorFilesDir(self) str[source]#

Returns a skZemax default directory of Zemax detector files (.DDR or .DDP files).

Returns:

Absolute path to the detector files directory.

Return type:

str

skZemax.skZemax_subfunctions._utility_functions.Utilities_GetAllSystemUnits(self) dict[source]#

Returns the units the current system is working in.

Returns:

dict[property] = “units”

Return type:

dict

skZemax.skZemax_subfunctions._utility_functions.Utilities_MainProgramDir(self) str[source]#

Returns an absolute path to the directory of the first python file being run in any python program (sys.argv[0]).

Returns:

Absolute path to the main python file being run.

Return type:

str

skZemax.skZemax_subfunctions._utility_functions.Utilities_MakeNewZemaxFile(self, in_file_path: str, save_first: bool = False) None[source]#

Makes a new Zemax file.

Parameters:
  • in_file_path (str) – Path to file.

  • save_first (bool, optional) – Indicates if one should save the current Zemax file (if any) before making the new file, defaults to False

skZemax.skZemax_subfunctions._utility_functions.Utilities_OpenZemaxFile(self, in_file_path: str, save_first: bool = False)[source]#

Opens a Zemax file.

Parameters:
  • in_file_path (str) – Path to file.

  • save_first (bool, optional) – Indicates if one should save the current Zemax file (if any) before making the new file, defaults to False

skZemax.skZemax_subfunctions._utility_functions.Utilities_SaveZemaxFile(self) None[source]#

Saves the current Zemax file

skZemax.skZemax_subfunctions._utility_functions.Utilities_SaveZemaxFileAs(self, in_file_path: str) None[source]#

Saves the current Zemax file a a new file.

Parameters:

in_file_path (str) – Path to file.

skZemax.skZemax_subfunctions._utility_functions.Utilities_ZemaxInstallationCADObjectDir(self) str[source]#

Returns directory of the default Zemax CAD object (.stp , .stl , .igs) files given with the installation.

Returns:

Path to dir.

Return type:

str

skZemax.skZemax_subfunctions._utility_functions.Utilities_ZemaxInstallationCoatingDir(self) str[source]#

Returns directory of the default Zemax coating (.zec) files given with the installation.

Returns:

Path to dir.

Return type:

str

skZemax.skZemax_subfunctions._utility_functions.Utilities_ZemaxInstallationExampleDir(self) str[source]#

Returns directory of the default Zemax example files given with the installation.

Returns:

Path to dir.

Return type:

str

skZemax.skZemax_subfunctions._utility_functions.Utilities_ZemaxInstallationImageDir(self) str[source]#

Returns directory of the default Zemax images (.png , .bmp , .ima) files given with the installation.

Returns:

Path to dir.

Return type:

str

skZemax.skZemax_subfunctions._utility_functions.Utilities_ZemaxInstallationMaterialDir(self) str[source]#

Returns directory of the default Zemax material (.agf , .bgf) files given with the installation.

Returns:

Path to dir.

Return type:

str

skZemax.skZemax_subfunctions._utility_functions.Utilities_ZemaxInstallationPolygonObjectDir(self) str[source]#

Returns directory of the default Zemax polygon object (.pob) files given with the installation.

Returns:

Path to dir.

Return type:

str

skZemax.skZemax_subfunctions._utility_functions.Utilities_ZemaxInstallationScatterDir(self) str[source]#

Returns directory of the default Zemax scatter (.bsdf) files given with the installation.

Returns:

Path to dir.

Return type:

str

skZemax.skZemax_subfunctions._utility_functions.Utilities_skZemaxExampleDir(self) str[source]#

Returns directory of skZemax example files adapted to use skZemax.

Returns:

Path to dir.

Return type:

str