The current bottleneck is the extention of the mode basis by each new segment. Scipy interprets the transformation matrices in my bases as non-sparse matrices, which makes extend() use a concatenation, which takes an awful lot of time.
My initial idea is to make sure the transformation matrices in the basis is a sparse matrix object by scipy, and then check whether this helps.
In any case, building my mirrors is a one-time operation so it’s not that awful if it takes a long time, but it’s annoying and it would be nice to improve that.
Script that can be used to test that can be found in #159
Theh
create_segmented_mirror()
method in theSegmentedTelescope
class takes an awful lot of time and scales with the number of segments: https://github.com/spacetelescope/PASTIS/blob/df1c8110b132a4f29f0dde5ba7b57e6a127c0949/pastis/simulators/generic_segmented_telescopes.py#L647The current bottleneck is the extention of the mode basis by each new segment. Scipy interprets the transformation matrices in my bases as non-sparse matrices, which makes extend() use a concatenation, which takes an awful lot of time.
My initial idea is to make sure the transformation matrices in the basis is a sparse matrix object by scipy, and then check whether this helps.
In any case, building my mirrors is a one-time operation so it’s not that awful if it takes a long time, but it’s annoying and it would be nice to improve that.
Script that can be used to test that can be found in #159