xicsrt_raytrace

xicsrt.xicsrt_raytrace

Entry point to XICSRT. Contains the main functions that are called to perform raytracing.

raytrace(config)[source]

Perform a series of ray tracing runs.

Each run will rebuild all objects, reset the random seed and then perform the requested number of iterations.

If the option ‘save_images’ is set, then images will be saved at the completion of each run. The saving of these run images is one reason to use this routine rather than just increasing the number of iterations: periodic outputs during long computations.

Also see raytrace() for a multiprocessing version of this routine.

raytrace_single(config, _internal=False)[source]

Perform a single raytrace run consisting of multiple iterations.

If history is enabled, sort the rays into those that are detected and those that are lost (found and lost). The found ray history will be returned in full. The lost ray history will be truncated to allow analysis of lost ray pattern while still limiting memory usage.

private keywords

_internal : bool (False)
Used when calling this function from raytrace as part of the execution of multiple runs. Controls how history_max_lost is handled along with how save_config and save_results are interpreted.
combine_raytrace(input_list)[source]

Produce a combined results dictionary from a list of raytrace results.

Example

results_1 = xicsrt.raytrace(config_1) results_2 = xicsrt.raytrace(config_2) results = xicsrt_raytrace.combine_raytrace([results_1, results_2])

Utility Members

These functions are used internally and are not typically needed by the user. They may, however, be useful in some circumstances. An example is combining of multiple separate raytracing runs.

combine_raytrace(input_list)[source]

Produce a combined results dictionary from a list of raytrace results.

Example

results_1 = xicsrt.raytrace(config_1) results_2 = xicsrt.raytrace(config_2) results = xicsrt_raytrace.combine_raytrace([results_1, results_2])

check_config(config)[source]

Check the general section of the configuration dictionary.

print_raytrace(results)[source]

Print out some information and statistics from the raytracing results.

Private Members

_raytrace_iter(config, sources, optics)[source]

Perform a single iteration of raytracing with the given sources and optics. The returned rays are unsorted.

_sort_raytrace(input, max_lost=None)[source]

Sort the rays into ‘lost’ and ‘found’ rays, then truncate the number of lost rays.