Skip to content

Commit

Permalink
Merge branch 'master' into tickets/DM-14534
Browse files Browse the repository at this point in the history
  • Loading branch information
taranu committed Jun 8, 2018
2 parents 65483b2 + 66b7bb6 commit 40816b5
Show file tree
Hide file tree
Showing 89 changed files with 2,489 additions and 3,098 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
_build.*
.cache
.pytest_cache
.coverage
*.dylib
*.o
*.so
Expand Down
3 changes: 2 additions & 1 deletion examples/growthcurve.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@

import numpy as np

import lsst.geom
import lsst.afw.image as afwImage
import lsst.afw.math as afwMath
import lsst.afw.table as afwTable
Expand Down Expand Up @@ -167,7 +168,7 @@ def main():
# get the aperture fluxes for Naive and Sinc methods

axes = afwGeom.ellipses.Axes(radius[iR], radius[iR], math.radians(0))
center = afwGeom.Point2D(0, 0)
center = lsst.geom.Point2D(0, 0)
ellipse = afwGeom.Ellipse(axes, center)
resultSinc = measBase.ApertureFluxAlgorithm.computeSincFlux(mimg.getImage(), ellipse)
resultNaive = measBase.ApertureFluxAlgorithm.computeNaiveFlux(mimg.getImage(), ellipse)
Expand Down
3 changes: 1 addition & 2 deletions include/lsst/meas/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,4 @@
#include "lsst/afw/detection.h"
#include "lsst/afw/math.h"


#endif // !LSST_MEAS_base_h_INCLUDED
#endif // !LSST_MEAS_base_h_INCLUDED
79 changes: 30 additions & 49 deletions include/lsst/meas/base/Algorithm.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
#include "lsst/meas/base/exceptions.h"
#include "lsst/meas/base/FlagHandler.h"

namespace lsst { namespace meas { namespace base {
namespace lsst {
namespace meas {
namespace base {

/**
* Ultimate abstract base class for all C++ measurement algorithms
Expand All @@ -41,7 +43,6 @@ namespace lsst { namespace meas { namespace base {
*/
class BaseAlgorithm {
public:

/**
* Handle an exception thrown by the current algorithm by setting flags in the given
* record.
Expand All @@ -58,16 +59,12 @@ class BaseAlgorithm {
* implemented even when all known failure modes do not throw exceptions, to ensure
* that unexpected exceptions thrown in lower-level code are properly handled.
*/
virtual void fail(
afw::table::SourceRecord & measRecord,
MeasurementError * error=nullptr
) const = 0;
virtual void fail(afw::table::SourceRecord& measRecord, MeasurementError* error = nullptr) const = 0;

virtual ~BaseAlgorithm() {}

std::string getLogName() const {
return _logName;
}
std::string getLogName() const { return _logName; }

protected:
std::string _logName;
};
Expand All @@ -84,7 +81,6 @@ class BaseAlgorithm {
*/
class SingleFrameAlgorithm : public virtual BaseAlgorithm {
public:

/**
* Called to measure a single child source in an image.
*
Expand All @@ -93,10 +89,8 @@ class SingleFrameAlgorithm : public virtual BaseAlgorithm {
* which can also be used to obtain centroid (see SafeCentroidExtractor) and shape
* (see SafeShapeExtractor) information.
*/
virtual void measure(
afw::table::SourceRecord & measRecord,
afw::image::Exposure<float> const & exposure
) const = 0;
virtual void measure(afw::table::SourceRecord& measRecord,
afw::image::Exposure<float> const& exposure) const = 0;

/**
* Called to simultaneously measure all children in a deblend family, in a single image.
Expand All @@ -108,11 +102,8 @@ class SingleFrameAlgorithm : public virtual BaseAlgorithm {
* The default implementation simply throws an exception, indicating that simultaneous
* measurement is not supported.
*/
virtual void measureN(
afw::table::SourceCatalog const & measCat,
afw::image::Exposure<float> const & exposure
) const;

virtual void measureN(afw::table::SourceCatalog const& measCat,
afw::image::Exposure<float> const& exposure) const;
};

/**
Expand All @@ -135,7 +126,6 @@ class SingleFrameAlgorithm : public virtual BaseAlgorithm {
*/
class ForcedAlgorithm : public virtual BaseAlgorithm {
public:

/**
* Called to measure a single child source in an image.
*
Expand All @@ -144,12 +134,10 @@ class ForcedAlgorithm : public virtual BaseAlgorithm {
* which can also be used to obtain centroid (see SafeCentroidExtractor) and shape
* (see SafeShapeExtractor) information.
*/
virtual void measureForced(
afw::table::SourceRecord & measRecord,
afw::image::Exposure<float> const & exposure,
afw::table::SourceRecord const & refRecord,
afw::geom::SkyWcs const & refWcs
) const = 0;
virtual void measureForced(afw::table::SourceRecord& measRecord,
afw::image::Exposure<float> const& exposure,
afw::table::SourceRecord const& refRecord,
afw::geom::SkyWcs const& refWcs) const = 0;

/**
* Called to simultaneously measure all children in a deblend family, in a single image.
Expand All @@ -161,13 +149,10 @@ class ForcedAlgorithm : public virtual BaseAlgorithm {
* The default implementation simply throws an exception, indicating that simultaneous
* measurement is not supported.
*/
virtual void measureNForced(
afw::table::SourceCatalog const & measCat,
afw::image::Exposure<float> const & exposure,
afw::table::SourceCatalog const & refRecord,
afw::geom::SkyWcs const & refWcs
) const;

virtual void measureNForced(afw::table::SourceCatalog const& measCat,
afw::image::Exposure<float> const& exposure,
afw::table::SourceCatalog const& refRecord,
afw::geom::SkyWcs const& refWcs) const;
};

/**
Expand All @@ -184,27 +169,23 @@ class ForcedAlgorithm : public virtual BaseAlgorithm {
*/
class SimpleAlgorithm : public SingleFrameAlgorithm, public ForcedAlgorithm {
public:

virtual void measureForced(
afw::table::SourceRecord & measRecord,
afw::image::Exposure<float> const & exposure,
afw::table::SourceRecord const & refRecord,
afw::geom::SkyWcs const & refWcs
) const {
virtual void measureForced(afw::table::SourceRecord& measRecord,
afw::image::Exposure<float> const& exposure,
afw::table::SourceRecord const& refRecord,
afw::geom::SkyWcs const& refWcs) const {
measure(measRecord, exposure);
}

virtual void measureNForced(
afw::table::SourceCatalog const & measCat,
afw::image::Exposure<float> const & exposure,
afw::table::SourceCatalog const & refRecord,
afw::geom::SkyWcs const & refWcs
) const {
virtual void measureNForced(afw::table::SourceCatalog const& measCat,
afw::image::Exposure<float> const& exposure,
afw::table::SourceCatalog const& refRecord,
afw::geom::SkyWcs const& refWcs) const {
measureN(measCat, exposure);
}

};

}}} // namespace lsst::meas::base
} // namespace base
} // namespace meas
} // namespace lsst

#endif // !LSST_MEAS_BASE_Algorithm_h_INCLUDED
#endif // !LSST_MEAS_BASE_Algorithm_h_INCLUDED

0 comments on commit 40816b5

Please sign in to comment.