Serge, up for a review of some semi-unfamiliar code? I've already overloaded pretty much all of the apps developers with big reviews recently, and I'd like to get your feedback on this pattern before I implement too many incarnations of it.
For some background, these are convenience classes that inherit from afw::table::FunctorKey, a moderately recent interface for extracting and assigning complex C++ objects via a set of fields in a record (I expect this to replace the true compound fields in the near future, as those are a pain to map to SQL and we only have a limited number of compound types we can support that way).
These two FunctorKeys delegate most of their work to other FunctorKeys already defined in afw, EllipseKey and ArrayKey. Just like regular Keys, one uses a FunctorKey by constructing it in advance from a Schema, and then using it repeatedly for more efficient access to multiple records.
The C++ objects these FunctorKeys map to are the two main workhorse classes of the shapelet package, ShapeletFunction and MultiShapeletFunction. The mathematical details aren't important here, but it may help to know that a ShapeletFunction is just a polynomial expansion on top of an elliptical Gaussian, so it consists of an ellipse and a number of coefficients. There are also two common conventions for defining the polynomial basis, which I call "basis type" in the code.
Please let me know if you won't be able to get to this in the next day or so, or if you have any questions.
The changes are in the shapelet package, on branch u/jbosch/DM-1224. But to build it (if you want to), you'll need branch u/jbosch/DM-1222 (also in review).
shapelet:u/jbosch/DM-1224 % git diff --stat master...u/jbosch/DM-1224
|
include/lsst/shapelet.h | 1 +
|
include/lsst/shapelet/FunctorKeys.h | 229 ++++++++++++++++++++++++++++++
|
include/lsst/shapelet/ShapeletFunction.h | 2 +-
|
include/lsst/shapelet/constants.h | 16 +++
|
python/lsst/shapelet/shapeletLib.i | 21 +++
|
src/FunctorKeys.cc | 162 +++++++++++++++++++++
|
src/ShapeletFunction.cc | 2 +-
|
tests/testFunctorKeys.py | 102 +++++++++++++
|
8 files changed, 533 insertions(+), 2 deletions(-)
|
Serge, up for a review of some semi-unfamiliar code? I've already overloaded pretty much all of the apps developers with big reviews recently, and I'd like to get your feedback on this pattern before I implement too many incarnations of it.
For some background, these are convenience classes that inherit from afw::table::FunctorKey, a moderately recent interface for extracting and assigning complex C++ objects via a set of fields in a record (I expect this to replace the true compound fields in the near future, as those are a pain to map to SQL and we only have a limited number of compound types we can support that way).
These two FunctorKeys delegate most of their work to other FunctorKeys already defined in afw, EllipseKey and ArrayKey. Just like regular Keys, one uses a FunctorKey by constructing it in advance from a Schema, and then using it repeatedly for more efficient access to multiple records.
The C++ objects these FunctorKeys map to are the two main workhorse classes of the shapelet package, ShapeletFunction and MultiShapeletFunction. The mathematical details aren't important here, but it may help to know that a ShapeletFunction is just a polynomial expansion on top of an elliptical Gaussian, so it consists of an ellipse and a number of coefficients. There are also two common conventions for defining the polynomial basis, which I call "basis type" in the code.
Please let me know if you won't be able to get to this in the next day or so, or if you have any questions.
The changes are in the shapelet package, on branch u/jbosch/
DM-1224. But to build it (if you want to), you'll need branch u/jbosch/DM-1222(also in review).shapelet:u/jbosch/DM-1224 % git diff --stat master...u/jbosch/DM-1224
include/lsst/shapelet.h | 1 +
include/lsst/shapelet/FunctorKeys.h | 229 ++++++++++++++++++++++++++++++
include/lsst/shapelet/ShapeletFunction.h | 2 +-
include/lsst/shapelet/constants.h | 16 +++
python/lsst/shapelet/shapeletLib.i | 21 +++
src/FunctorKeys.cc | 162 +++++++++++++++++++++
src/ShapeletFunction.cc | 2 +-
tests/testFunctorKeys.py | 102 +++++++++++++
8 files changed, 533 insertions(+), 2 deletions(-)