Closed dkirkby closed 8 years ago
This looks good in that it is faster, much less memory hungry, and returns equivalent results. Thanks for the update, let's merge this now.
Heads up: as we exercise quickgen/quickbrick more we may have more requests about this. In particular I expect that we have a desispec constraint that the number of resolution matrix diagonals is odd (the diagonal + an equal number of upper+lower off diagonals), while specsim can currently return an even number of diagonals.
Camera.get_output_resolution_matrix() now returns a DIA-format sparse matrix, which uses significantly less memory and runs 4-5x faster.
A new unit test compares the previous dense downsampling algorithm with the new sparse algorithm to ensure that the values are
np.allclose
.This is ready for review and merge and fixes #43.
Since the
desispec.resolution.Resolution
constructor accepts either a dense or DIA-sparse matrix, no API changes should be required for thesedesisim
lines inquickbrick.py
:and
quickgen.py
:However, the internals of the Resolution constructor might need some work if the list of diagonals provided does not match what the brick datamodel expects.