Improve CoregPipeline.apply()
and .fit()
performance by merging matrices
#79
Labels
performance
Improvement to feature performance
If parts or all steps of a pipeline can be described as matrices, the current apply loop is inefficient and might induce resampling-related errors:
xdem/xdem/coreg.py
Line 1531 in 82b87eb
A better approach would be to merge transformation matrices (when possible) and therefore do fewer resampling iterations, potentially lowering the error and the processing time.
A conceptual example is:
Currently, the pipeline would modify the DEM four times. By combining the matrices of A, B and C, only two modifications are needed:
This could be done by first implementing a property of
Coreg
, for example calledis_rigid
which is True if it can be represented as a rigid transform (4x4 matrix). Then, the following pseudocode could work:where the
combine_matrix()
andapply_matrix()
functions need to be created.The text was updated successfully, but these errors were encountered: