The bolometry demos use cherab.tools.inversions.invert_regularised_nnls, since in the past this has produced the most reasonable-looking inversions in test cases using all the available Cherab inversion routines (least squares, NN least squares, SART). However, bolometer geometry matrices (and regularisation operators) are typically very sparse and so algorithms developed for inverting dense matrices may not be optimal.
Switching to scipy.optimize.lsq_linear, which can use the LSMR algorithm for computing sparse matrix inverses, potentially offers several benefits:
Reduced sensitivity to noise/floating point precision.
Improved runtime performance.
Reduced memory footprint if the input matrices are sparse.
i'll have a play with some test cases to see whether it's worthwhile providing additional inversion routines in Cherab which better deal with sparse cases and report back.
Following on from https://github.com/cherab/core/pull/439#issuecomment-2120494947:
The bolometry demos use
cherab.tools.inversions.invert_regularised_nnls
, since in the past this has produced the most reasonable-looking inversions in test cases using all the available Cherab inversion routines (least squares, NN least squares, SART). However, bolometer geometry matrices (and regularisation operators) are typically very sparse and so algorithms developed for inverting dense matrices may not be optimal.Switching to scipy.optimize.lsq_linear, which can use the LSMR algorithm for computing sparse matrix inverses, potentially offers several benefits:
i'll have a play with some test cases to see whether it's worthwhile providing additional inversion routines in Cherab which better deal with sparse cases and report back.