Theh create_segmented_mirror() method in the SegmentedTelescope class takes an awful lot of time and scales with the number of segments:
|
def create_segmented_mirror(self, n_zernikes): |
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 theSegmentedTelescopeclass takes an awful lot of time and scales with the number of segments:PASTIS/pastis/simulators/generic_segmented_telescopes.py
Line 647 in df1c811
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