diff --git a/include/lsst/afw/detection/Psf.h b/include/lsst/afw/detection/Psf.h index a44f94fa3f..e5b5a61797 100644 --- a/include/lsst/afw/detection/Psf.h +++ b/include/lsst/afw/detection/Psf.h @@ -149,12 +149,6 @@ class Psf : public afw::table::io::PersistableFacade, 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 computeImage() const; /** * Return an Image of the PSF, in a form suitable for convolution. @@ -181,12 +175,6 @@ class Psf : public afw::table::io::PersistableFacade, std::shared_ptr 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 computeKernelImage() const; /** * Return the peak value of the PSF image. @@ -202,12 +190,6 @@ class Psf : public afw::table::io::PersistableFacade, 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. * @@ -222,12 +204,6 @@ class Psf : public afw::table::io::PersistableFacade, 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. * @@ -241,12 +217,6 @@ class Psf : public afw::table::io::PersistableFacade, 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. * @@ -260,11 +230,6 @@ class Psf : public afw::table::io::PersistableFacade, std::shared_ptr 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 getLocalKernel() const; /** * Return the average Color of the stars used to construct the Psf @@ -290,12 +255,6 @@ class Psf : public afw::table::io::PersistableFacade, 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() * @@ -306,12 +265,6 @@ class Psf : public afw::table::io::PersistableFacade, 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() * @@ -325,14 +278,6 @@ class Psf : public afw::table::io::PersistableFacade, 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. diff --git a/python/lsst/afw/detection/_psf.cc b/python/lsst/afw/detection/_psf.cc index fed454657f..5ddb43eb63 100644 --- a/python/lsst/afw/detection/_psf.cc +++ b/python/lsst/afw/detection/_psf.cc @@ -61,178 +61,55 @@ void wrapPsf(utils::python::WrapperCollection& wrappers) { cls.def("clone", &Psf::clone); cls.def("resized", &Psf::resized, "width"_a, "height"_a); - // Position-required overloads. Can (likely) remove overload_cast<> once deprecation period for - // default position argument ends. cls.def("computeImage", - py::overload_cast(&Psf::computeImage, py::const_), + &Psf::computeImage, "position"_a, "color"_a = image::Color(), "owner"_a = Psf::ImageOwnerEnum::COPY ); cls.def("computeKernelImage", - py::overload_cast(&Psf::computeKernelImage, py::const_), + &Psf::computeKernelImage, "position"_a, "color"_a = image::Color(), "owner"_a = Psf::ImageOwnerEnum::COPY ); cls.def("computePeak", - py::overload_cast(&Psf::computePeak, py::const_), + &Psf::computePeak, "position"_a, "color"_a = image::Color() ); cls.def("computeApertureFlux", - py::overload_cast(&Psf::computeApertureFlux, py::const_), + &Psf::computeApertureFlux, "radius"_a, "position"_a, "color"_a = image::Color() ); cls.def("computeShape", - py::overload_cast(&Psf::computeShape, py::const_), + &Psf::computeShape, "position"_a, "color"_a = image::Color() ); cls.def("computeBBox", - py::overload_cast(&Psf::computeBBox, py::const_), + &Psf::computeBBox, "position"_a, "color"_a = image::Color() ); cls.def("computeImageBBox", - py::overload_cast(&Psf::computeImageBBox, py::const_), + &Psf::computeImageBBox, "position"_a, "color"_a = image::Color() ); cls.def("computeKernelBBox", - py::overload_cast(&Psf::computeKernelBBox, py::const_), + &Psf::computeKernelBBox, "position"_a, "color"_a = image::Color() ); cls.def("getLocalKernel", - py::overload_cast(&Psf::getLocalKernel, py::const_), + &Psf::getLocalKernel, "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); cls.def("getAveragePosition", &Psf::getAveragePosition); cls.def_static("recenterKernelImage", &Psf::recenterKernelImage, "im"_a, "position"_a, diff --git a/src/detection/Psf.cc b/src/detection/Psf.cc index bd239140aa..5f5f5f1a47 100644 --- a/src/detection/Psf.cc +++ b/src/detection/Psf.cc @@ -98,10 +98,6 @@ std::shared_ptr> Psf::recenterKernelImage(std::shared_ptr Psf::computeImage() const { - return computeImage(makeNullPoint()); -} - std::shared_ptr Psf::computeImage(lsst::geom::Point2D position, image::Color color, ImageOwnerEnum owner) const { if (isPointNull(position)) position = getAveragePosition(); @@ -115,10 +111,6 @@ std::shared_ptr Psf::computeImage(lsst::geom::Point2D position, imag return result; } -std::shared_ptr Psf::computeKernelImage() const { - return computeKernelImage(makeNullPoint()); -} - std::shared_ptr Psf::computeKernelImage(lsst::geom::Point2D position, image::Color color, ImageOwnerEnum owner) const { if (_isFixed || isPointNull(position)) position = getAveragePosition(); @@ -132,10 +124,6 @@ std::shared_ptr 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(); @@ -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(); @@ -162,10 +146,6 @@ lsst::geom::Box2I Psf::computeImageBBox(lsst::geom::Point2D position, image::Col } } -std::shared_ptr Psf::getLocalKernel() const { - return getLocalKernel(makeNullPoint()); -} - std::shared_ptr Psf::getLocalKernel(lsst::geom::Point2D position, image::Color color) const { if (isPointNull(position)) position = getAveragePosition(); @@ -175,10 +155,6 @@ std::shared_ptr Psf::getLocalKernel(lsst::geom::Point2D posi return std::make_shared(*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(); @@ -186,20 +162,12 @@ double Psf::computePeak(lsst::geom::Point2D position, image::Color color) const 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();