Skip to content

Commit

Permalink
Remove deprecated interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Wittgen committed Jul 11, 2023
1 parent e482522 commit f1aee65
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 207 deletions.
55 changes: 0 additions & 55 deletions include/lsst/afw/detection/Psf.h
Expand Up @@ -149,12 +149,6 @@ class Psf : public afw::table::io::PersistableFacade<Psf>,
image::Color color = image::Color(),
ImageOwnerEnum owner = COPY) const;

// Using the default position automatically implies use of the default color, owner.
[[deprecated(
"Default position argument overload is deprecated and will be removed "
"in version 24.0. Please use overload with explicit position."
)]]
std::shared_ptr<Image> computeImage() const;

/**
* Return an Image of the PSF, in a form suitable for convolution.
Expand All @@ -181,12 +175,6 @@ class Psf : public afw::table::io::PersistableFacade<Psf>,
std::shared_ptr<Image> computeKernelImage(lsst::geom::Point2D position,
image::Color color = image::Color(),
ImageOwnerEnum owner = COPY) const;
// Using the default position automatically implies use of the default color, owner.
[[deprecated(
"Default position argument overload is deprecated and will be removed "
"in version 24.0. Please use overload with explicit position."
)]]
std::shared_ptr<Image> computeKernelImage() const;

/**
* Return the peak value of the PSF image.
Expand All @@ -202,12 +190,6 @@ class Psf : public afw::table::io::PersistableFacade<Psf>,
double computePeak(lsst::geom::Point2D position,
image::Color color = image::Color()) const;

[[deprecated(
"Default position argument overload is deprecated and will be removed "
"in version 24.0. Please use overload with explicit position."
)]]
double computePeak() const;

/**
* Compute the "flux" of the Psf model within a circular aperture of the given radius.
*
Expand All @@ -222,12 +204,6 @@ class Psf : public afw::table::io::PersistableFacade<Psf>,
double computeApertureFlux(double radius, lsst::geom::Point2D position,
image::Color color = image::Color()) const;

[[deprecated(
"Default position argument overload is deprecated and will be removed "
"in version 24.0. Please use overload with explicit position."
)]]
double computeApertureFlux(double radius) const;

/**
* Compute the ellipse corresponding to the second moments of the Psf.
*
Expand All @@ -241,12 +217,6 @@ class Psf : public afw::table::io::PersistableFacade<Psf>,
geom::ellipses::Quadrupole computeShape(lsst::geom::Point2D position,
image::Color color = image::Color()) const;

[[deprecated(
"Default position argument overload is deprecated and will be removed "
"in version 24.0. Please use overload with explicit position."
)]]
geom::ellipses::Quadrupole computeShape() const;

/**
* Return a FixedKernel corresponding to the Psf image at the given point.
*
Expand All @@ -260,11 +230,6 @@ class Psf : public afw::table::io::PersistableFacade<Psf>,
std::shared_ptr<math::Kernel const> getLocalKernel(lsst::geom::Point2D position,
image::Color color = image::Color()) const;

[[deprecated(
"Default position argument overload is deprecated and will be removed "
"in version 24.0. Please use overload with explicit position."
)]]
std::shared_ptr<math::Kernel const> getLocalKernel() const;

/**
* Return the average Color of the stars used to construct the Psf
Expand All @@ -290,12 +255,6 @@ class Psf : public afw::table::io::PersistableFacade<Psf>,
lsst::geom::Box2I computeBBox(lsst::geom::Point2D position,
image::Color color = image::Color()) const;

[[deprecated(
"Default position argument overload is deprecated and will be removed "
"in version 24.0. Please use overload with explicit position."
)]]
lsst::geom::Box2I computeBBox() const;

/**
* Return the bounding box of the image returned by computeImage()
*
Expand All @@ -306,12 +265,6 @@ class Psf : public afw::table::io::PersistableFacade<Psf>,
lsst::geom::Box2I computeImageBBox(lsst::geom::Point2D position,
image::Color color = image::Color()) const;

[[deprecated(
"Default position argument overload is deprecated and will be removed "
"in version 24.0. Please use overload with explicit position."
)]]
lsst::geom::Box2I computeImageBBox() const;

/**
* Return the bounding box of the image returned by computeImage()
*
Expand All @@ -325,14 +278,6 @@ class Psf : public afw::table::io::PersistableFacade<Psf>,
return computeBBox(position, color);
}

[[deprecated(
"Default position argument overload is deprecated and will be removed "
"in version 24.0. Please use overload with explicit position."
)]]
lsst::geom::Box2I computeKernelBBox() const {
return computeBBox();
}

/**
* Helper function for Psf::doComputeImage(): converts a kernel image (centered at (0,0) when xy0
* is taken into account) to an image centered at position when xy0 is taken into account.
Expand Down
120 changes: 0 additions & 120 deletions python/lsst/afw/detection/_psf.cc
Expand Up @@ -111,126 +111,6 @@ void wrapPsf(utils::python::WrapperCollection& wrappers) {
"position"_a,
"color"_a = image::Color()
);

// Deprecated default position argument overloads.
cls.def("computeImage",
[](const Psf& psf) {
py::gil_scoped_acquire gil;
auto warnings = py::module::import("warnings");
auto FutureWarning = py::handle(PyEval_GetBuiltins())["FutureWarning"];
warnings.attr("warn")(
"Default position argument overload is deprecated and will be "
"removed in version 24.0. Please explicitly specify a position.",
"category"_a=FutureWarning
);
return psf.computeImage();
}
);
cls.def("computeKernelImage",
[](const Psf& psf) {
py::gil_scoped_acquire gil;
auto warnings = py::module::import("warnings");
auto FutureWarning = py::handle(PyEval_GetBuiltins())["FutureWarning"];
warnings.attr("warn")(
"Default position argument overload is deprecated and will be "
"removed in version 24.0. Please explicitly specify a position.",
"category"_a=FutureWarning
);
return psf.computeKernelImage();
}
);
cls.def("computePeak",
[](const Psf& psf) {
py::gil_scoped_acquire gil;
auto warnings = py::module::import("warnings");
auto FutureWarning = py::handle(PyEval_GetBuiltins())["FutureWarning"];
warnings.attr("warn")(
"Default position argument overload is deprecated and will be "
"removed in version 24.0. Please explicitly specify a position.",
"category"_a=FutureWarning
);
return psf.computePeak();
}
);
cls.def("computeApertureFlux",
[](const Psf& psf, double radius) {
py::gil_scoped_acquire gil;
auto warnings = py::module::import("warnings");
auto FutureWarning = py::handle(PyEval_GetBuiltins())["FutureWarning"];
warnings.attr("warn")(
"Default position argument overload is deprecated and will be "
"removed in version 24.0. Please explicitly specify a position.",
"category"_a=FutureWarning
);
return psf.computeApertureFlux(radius);
},
"radius"_a
);
cls.def("computeShape",
[](const Psf& psf) {
py::gil_scoped_acquire gil;
auto warnings = py::module::import("warnings");
auto FutureWarning = py::handle(PyEval_GetBuiltins())["FutureWarning"];
warnings.attr("warn")(
"Default position argument overload is deprecated and will be "
"removed in version 24.0. Please explicitly specify a position.",
"category"_a=FutureWarning
);
return psf.computeShape();
}
);
cls.def("computeBBox",
[](const Psf& psf) {
py::gil_scoped_acquire gil;
auto warnings = py::module::import("warnings");
auto FutureWarning = py::handle(PyEval_GetBuiltins())["FutureWarning"];
warnings.attr("warn")(
"Default position argument overload is deprecated and will be "
"removed in version 24.0. Please explicitly specify a position.",
"category"_a=FutureWarning
);
return psf.computeBBox();
}
);
cls.def("computeImageBBox",
[](const Psf& psf) {
py::gil_scoped_acquire gil;
auto warnings = py::module::import("warnings");
auto FutureWarning = py::handle(PyEval_GetBuiltins())["FutureWarning"];
warnings.attr("warn")(
"Default position argument overload is deprecated and will be "
"removed in version 24.0. Please explicitly specify a position.",
"category"_a=FutureWarning
);
return psf.computeImageBBox();
}
);
cls.def("computeKernelBBox",
[](const Psf& psf) {
py::gil_scoped_acquire gil;
auto warnings = py::module::import("warnings");
auto FutureWarning = py::handle(PyEval_GetBuiltins())["FutureWarning"];
warnings.attr("warn")(
"Default position argument overload is deprecated and will be "
"removed in version 24.0. Please explicitly specify a position.",
"category"_a=FutureWarning
);
return psf.computeKernelBBox();
}
);
cls.def("getLocalKernel",
[](const Psf& psf) {
py::gil_scoped_acquire gil;
auto warnings = py::module::import("warnings");
auto FutureWarning = py::handle(PyEval_GetBuiltins())["FutureWarning"];
warnings.attr("warn")(
"Default position argument overload is deprecated and will be "
"removed in version 24.0. Please explicitly specify a position.",
"category"_a=FutureWarning
);
return psf.getLocalKernel();
}
);
// End deprecated default position argument overloads.

cls.def("getAverageColor", &Psf::getAverageColor);
Expand Down
32 changes: 0 additions & 32 deletions src/detection/Psf.cc
Expand Up @@ -98,10 +98,6 @@ std::shared_ptr<image::Image<double>> Psf::recenterKernelImage(std::shared_ptr<I
return im;
}

std::shared_ptr<Psf::Image> Psf::computeImage() const {
return computeImage(makeNullPoint());
}

std::shared_ptr<Psf::Image> Psf::computeImage(lsst::geom::Point2D position, image::Color color,
ImageOwnerEnum owner) const {
if (isPointNull(position)) position = getAveragePosition();
Expand All @@ -115,10 +111,6 @@ std::shared_ptr<Psf::Image> Psf::computeImage(lsst::geom::Point2D position, imag
return result;
}

std::shared_ptr<Psf::Image> Psf::computeKernelImage() const {
return computeKernelImage(makeNullPoint());
}

std::shared_ptr<Psf::Image> Psf::computeKernelImage(lsst::geom::Point2D position, image::Color color,
ImageOwnerEnum owner) const {
if (_isFixed || isPointNull(position)) position = getAveragePosition();
Expand All @@ -132,10 +124,6 @@ std::shared_ptr<Psf::Image> Psf::computeKernelImage(lsst::geom::Point2D position
return result;
}

lsst::geom::Box2I Psf::computeBBox() const {
return computeBBox(makeNullPoint());
}

lsst::geom::Box2I Psf::computeBBox(lsst::geom::Point2D position, image::Color color) const {
if (isPointNull(position)) position = getAveragePosition();
if (color.isIndeterminate()) color = getAverageColor();
Expand All @@ -147,10 +135,6 @@ lsst::geom::Box2I Psf::computeBBox(lsst::geom::Point2D position, image::Color co
}
}

lsst::geom::Box2I Psf::computeImageBBox() const {
return computeImageBBox(makeNullPoint());
}

lsst::geom::Box2I Psf::computeImageBBox(lsst::geom::Point2D position, image::Color color) const {
if (isPointNull(position)) position = getAveragePosition();
if (color.isIndeterminate()) color = getAverageColor();
Expand All @@ -162,10 +146,6 @@ lsst::geom::Box2I Psf::computeImageBBox(lsst::geom::Point2D position, image::Col
}
}

std::shared_ptr<math::Kernel const> Psf::getLocalKernel() const {
return getLocalKernel(makeNullPoint());
}

std::shared_ptr<math::Kernel const> Psf::getLocalKernel(lsst::geom::Point2D position,
image::Color color) const {
if (isPointNull(position)) position = getAveragePosition();
Expand All @@ -175,31 +155,19 @@ std::shared_ptr<math::Kernel const> Psf::getLocalKernel(lsst::geom::Point2D posi
return std::make_shared<math::FixedKernel>(*image);
}

double Psf::computePeak() const {
return computePeak(makeNullPoint());
}

double Psf::computePeak(lsst::geom::Point2D position, image::Color color) const {
if (isPointNull(position)) position = getAveragePosition();
if (color.isIndeterminate()) color = getAverageColor();
std::shared_ptr<Image> image = computeKernelImage(position, color, INTERNAL);
return (*image)(-image->getX0(), -image->getY0());
}

double Psf::computeApertureFlux(double radius) const {
return computeApertureFlux(radius, makeNullPoint());
}

double Psf::computeApertureFlux(double radius, lsst::geom::Point2D position, image::Color color) const {
if (isPointNull(position)) position = getAveragePosition();
if (color.isIndeterminate()) color = getAverageColor();
return doComputeApertureFlux(radius, position, color);
}

geom::ellipses::Quadrupole Psf::computeShape() const {
return computeShape(makeNullPoint());
}

geom::ellipses::Quadrupole Psf::computeShape(lsst::geom::Point2D position, image::Color color) const {
if (isPointNull(position)) position = getAveragePosition();
if (color.isIndeterminate()) color = getAverageColor();
Expand Down

0 comments on commit f1aee65

Please sign in to comment.