Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-1130 refactor C++ Algorithm classes
  3. DM-1466

Convert simple C++ algorithms to new API

    XMLWordPrintable

    Details

    • Sprint:
      Science Pipelines DM-W15-2
    • Team:
      Data Release Production

      Description

      Convert all C++ algorithms that use the old C++ Algorithm concept.

      This does not include PsfFlux or SdssShape (which will have been done already on DM-829/DM-1465), or ApertureFlux and CircularApertureFlux (which do not use the old algorithm concept).

      This should be done in much the same way as PsfFlux - there's no need for a public Result or ResultKey object for any of these algorithms. If any of them return outputs that aren't accounted for in any of the existing Result classes, the Algorithm itself should just hold a Key for them and use it to set the field in the record directly.

        Attachments

          Activity

          Hide
          swinbank John Swinbank added a comment -

          Hi Perry, just to be clear – you'd like Lauren to review that, if you could track down her contact details in JIRA. Is that correct?

          Show
          swinbank John Swinbank added a comment - Hi Perry, just to be clear – you'd like Lauren to review that, if you could track down her contact details in JIRA. Is that correct?
          Hide
          jbosch Jim Bosch added a comment -

          I went ahead and changed the reviewer to Lauren MacArthur. Lauren, when you get this, come by my office, and I'll walk you through the code review procedure.

          Show
          jbosch Jim Bosch added a comment - I went ahead and changed the reviewer to Lauren MacArthur . Lauren, when you get this, come by my office, and I'll walk you through the code review procedure.
          Hide
          pgee Perry Gee added a comment -

          Before checking in this issue, we need to test to see what has changed in the measurement algorithms. Since buildBot depends on the sdss demo, we need in reality to do this every time we make a change to meas_base.

          There were a few changes in the algorithms during this work which created differences in the LsstSim test of a single image with 4500 sources:

          1. The differences in several of the algorithms vs the current master were created by the change where the SdssShape flag is checked by GaussianFlux, and the measurement does not proceed if the flag is set. So all of these values end up with NaN values for the Gaussian flux, and that also percolates into differences in classification_extendedness, which uses the model flux slot.

          2. The PixelFlags also differ for edges since we removed the edge check.

          Show
          pgee Perry Gee added a comment - Before checking in this issue, we need to test to see what has changed in the measurement algorithms. Since buildBot depends on the sdss demo, we need in reality to do this every time we make a change to meas_base. There were a few changes in the algorithms during this work which created differences in the LsstSim test of a single image with 4500 sources: 1. The differences in several of the algorithms vs the current master were created by the change where the SdssShape flag is checked by GaussianFlux, and the measurement does not proceed if the flag is set. So all of these values end up with NaN values for the Gaussian flux, and that also percolates into differences in classification_extendedness, which uses the model flux slot. 2. The PixelFlags also differ for edges since we removed the edge check.
          Hide
          lauren Lauren MacArthur added a comment -

          This all looks fine to me. I list some comments below, but they are
          largely just minor suggestions for consistency.

          Comments by file name:

          GaussianFlux.h:

          • remove commented //#include "lsst/meas/base/ShapeUtilities.h"
            (or state why it's still there)?
          • does enum need to be named? Probably does not matter, but to be
            consistent with others, e.g. PsfFlux.h, SdssShape.h (NOTE: this
            also occurs in the other .h files here).

          Editorial (changes marked btw asterisks):

          • line 60 "The size and ellipticity of the weight function are determined..."
          • line 79 "These are private so they don't shadow..."
          • line 80 "we can still call them via..."

          NOTE: the latter two above are in all .h files here.

          GaussianFlux.cc:

          • do you also need #include "boost/array.hpp" (as in PsfFlux.cc)?
          • line 66: get rid of - mimage.getX0(); in comment?
          • line 67: get rid of - mimage.getY0(); in comment?
          • Could get rid of lines 64-67 if line 72 read:
            = detail::getFixedMomentsFlux(exposure.getMaskedImage(), _ctrl.background, centroid.getX(), centroid.getY(), sdss);
          • There are 4 instances of whitespace

          NaiveFluc.h:

          • all ok

          NaiveFluc.cc:

          • line 165: name consistency: what was called "centroid" in GaussianFlux.cc
            is here called "center"
          • There are many instances of whitespace

          PeakLikelihoodFlux.h:

          • all ok

          PeakLikelihoodFlux.cc:

          • line 196: name consistency: what was called "centroid" in GaussianFlux.cc
            is here called "center"
          • There are a few instances of whitespace

          SincFlux.h:

          • all ok

          SincFlux.cc:

          • lines 39-41: collapse to single line as in other .cc files here,
            i.e. to:
            namespace lsst { namespace meas { namespace base {
            ,
          • line 193: name consistency: what was called "centroid" in GaussianFlux.cc
            is here called "center"
          • There are a few instances of whitespace

          testGaussianFluxBasic.py:

          • I'm not sure why self.assertTrue(record.get("base_GaussianFlux_flag"))
            was commented out on line 75. If it's not needed, why not just remove
            the line?

          plugins.py:

          • all ok

          pluginsLib.i:

          • could still comment with
            // Flux algorithms
            ...
            // Centroid algorithms
            ...
            // Miscellaneous algorithms

          PixelFlags.cc:

          • There are a few instances of whitespace
          Show
          lauren Lauren MacArthur added a comment - This all looks fine to me. I list some comments below, but they are largely just minor suggestions for consistency. Comments by file name: GaussianFlux.h: remove commented //#include "lsst/meas/base/ShapeUtilities.h" (or state why it's still there)? does enum need to be named? Probably does not matter, but to be consistent with others, e.g. PsfFlux.h, SdssShape.h (NOTE: this also occurs in the other .h files here). Editorial (changes marked btw asterisks): line 60 "The size and ellipticity of the weight function are determined..." line 79 "These are private so they don't shadow..." line 80 "we can still call them via..." NOTE: the latter two above are in all .h files here. GaussianFlux.cc: do you also need #include "boost/array.hpp" (as in PsfFlux.cc)? line 66: get rid of - mimage.getX0(); in comment? line 67: get rid of - mimage.getY0(); in comment? Could get rid of lines 64-67 if line 72 read: = detail::getFixedMomentsFlux(exposure.getMaskedImage(), _ctrl.background, centroid.getX(), centroid.getY(), sdss); There are 4 instances of whitespace NaiveFluc.h: all ok NaiveFluc.cc: line 165: name consistency: what was called "centroid" in GaussianFlux.cc is here called "center" There are many instances of whitespace PeakLikelihoodFlux.h: all ok PeakLikelihoodFlux.cc: line 196: name consistency: what was called "centroid" in GaussianFlux.cc is here called "center" There are a few instances of whitespace SincFlux.h: all ok SincFlux.cc: lines 39-41: collapse to single line as in other .cc files here, i.e. to: namespace lsst { namespace meas { namespace base { , line 193: name consistency: what was called "centroid" in GaussianFlux.cc is here called "center" There are a few instances of whitespace testGaussianFluxBasic.py: I'm not sure why self.assertTrue(record.get("base_GaussianFlux_flag")) was commented out on line 75. If it's not needed, why not just remove the line? plugins.py: all ok pluginsLib.i: could still comment with // Flux algorithms ... // Centroid algorithms ... // Miscellaneous algorithms PixelFlags.cc: There are a few instances of whitespace
          Hide
          jbosch Jim Bosch added a comment -

          Converted this from Won't Fix to Done, as I think setting it to the former was a mistake: note that when you drag the issue around one the agile "Work" page, there are now two boxes in the rightmost column, so it's easy to accidentally drag it to Won't Fix if you're not careful.

          Show
          jbosch Jim Bosch added a comment - Converted this from Won't Fix to Done, as I think setting it to the former was a mistake: note that when you drag the issue around one the agile "Work" page, there are now two boxes in the rightmost column, so it's easy to accidentally drag it to Won't Fix if you're not careful.

            People

            Assignee:
            pgee Perry Gee
            Reporter:
            jbosch Jim Bosch
            Reviewers:
            Lauren MacArthur
            Watchers:
            Jim Bosch, John Swinbank, Lauren MacArthur, Perry Gee, Russell Owen
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Jenkins

                No builds found.