Optimizing Performance#
Selecting sensible propagation parameters#
Performing numerical propagation is almost always the most expensive part of any model. Even the most efficient and streamlined models will experience high memory usage and slow performance when working with large arrays and many wavelengths. Understanding how the propagation method’s parameters influence accuracy and speed will allow you to identify appropriate values for your specific needs.
propagate_dft()
#
Parameter |
Usage |
Performance considerations |
---|---|---|
|
Arrays representing wavelength and the corresponding weight of each wavelength in the propagation. |
Propagation time scales linearly with the number of wavelengths. |
|
Shape of output plane. |
The output plane size has minimal impact on propagation performance
unless it is astronomically large. |
|
Shape of propagation plane. |
Propagation time scales quadtatically with |
|
Number of times to oversample the output and propagation planes. |
Propagation time scales quadratically with |
Strategies for increasing runtime performance#
Perform fewer propagations by increasing wavelength sampling#
Selecting an appropriate wavelength sampling depends on many factors. Any opportunity to reduce the number of propagations required will increase overall model performance. Two patterns for more coarse wavelength sampling are provided here
Use appropriate plane sampling#
Planes should be sized to ensure the smallest spatial features of interest are adequately sampled. Small features (e.g. secondary mirror supports, segment gaps) should be represented by at leat two samples.