rayoptics.gui.roafile module

Read an .roa file and return a OpticalModel instance

preprocess_roa(file_name, str_replacements)[source]

Read and preprocess raw roa text file, returning preprocessed text.

postprocess_roa(opt_model, **kwargs)[source]

Post processing for raw optical_model, including sync_to_restore.

open_roa(file_name, mapping=None, **kwargs)[source]

open a ray-optics file and populate an optical model with the data

Parameters:
  • file_name (str) – a filename with a .roa extension

  • mapping – dict mapping old modules to new. If None, use module_repl_050

Returns:

if successful, an OpticalModel instance, otherwise, None