Details
-
Type:
Improvement
-
Status: Done
-
Resolution: Done
-
Fix Version/s: None
-
Component/s: afw, meas_algorithms, meas_astrom, meas_base, meas_modelfit, shapelet
-
Labels:
-
Story Points:4
-
Epic Link:
-
Team:Alert Production
Description
Use the ndarray::Array functions added in DM-14728 instead of ndarray::Array::asEigen to eliminate our use of ndarray::EigenView in our C++ code.
Warning: these new functions return Eigen::Map, which does not use reference counting to manage memory, so be careful when converting old code. In most instances nothing needs to change as the Eigen object will to out of scope before the ndarray array. However, there are likely to be a few bits of code that will require non-trivial changes in order to avoid memory leaks (e.g. if the Eigen Map is passed around or stored); in that case we have to copy the array data or keep the data as an ndarray::Array and delay extracting the Eigen version until deeper in the code.
Note that updating our pybind11 wrappers will be done on a different ticket.
This has passed Jenkins with the DN-14728 ticket branch of ndarray and so is ready for review, but not quite ready for merging (that branch needs a bit of cleanup before merging).
Changes, where arr is an ndarray::Array: