Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DM-8467: Wrap lsst_distrib with pybind11 #68

Merged
merged 2 commits into from
Mar 7, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ examples/growthcurve
examples/localPsf
examples/psf
policy/tempfile*.tmp
python/lsst/meas/algorithms/algorithmsLib.py
python/lsst/meas/algorithms/algorithmsLib_wrap.cc
python/lsst/meas/algorithms/version.py
tests/.tests
tests/data/psf*.*
Expand All @@ -28,7 +26,5 @@ tests/testSizeMagnitudeStarSelector
tests/testPsfCaching
tests/testImagePsf
tests/testWarpedPsf
tests/testLib.py
tests/testLib_wrap.cc
ups/*.cfgc
python/lsst/meas/algorithms/version.py
21 changes: 0 additions & 21 deletions python/lsst/meas/algorithms/CoaddBoundedField.i

This file was deleted.

16 changes: 15 additions & 1 deletion python/lsst/meas/algorithms/SConscript
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
# -*- python -*-
from lsst.sconsUtils import scripts
scripts.BasicSConscript.python(['algorithmsLib'])
scripts.BasicSConscript.pybind11(["binnedWcs",
"cr",
"coaddBoundedField",
"coaddPsf",
"doubleGaussianPsf",
"imagePsf",
"interp",
"kernelPsf",
"psf",
"pcaPsf",
"psfCandidate/psfCandidate",
"singleGaussianPsf",
"spatialModelPsf",
"warpedPsf"], addUnderscore=False)

37 changes: 29 additions & 8 deletions python/lsst/meas/algorithms/__init__.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,47 @@
#
#
# LSST Data Management System
# Copyright 2008, 2009, 2010 LSST Corporation.
#
# Copyright 2008-2017 AURA/LSST.
#
# This product includes software developed by the
# LSST Project (http://www.lsst.org/).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the LSST License Statement and
# the GNU General Public License along with this program. If not,
# see <https://www.lsstcorp.org/LegalNotices/>.
#
# You should have received a copy of the LSST License Statement and
# the GNU General Public License along with this program. If not,
# see <http://www.lsstcorp.org/LegalNotices/>.
#
"""lsst.meas.algorithms
"""
from __future__ import absolute_import

import lsst.afw.image
import lsst.afw.math

from .binnedWcs import *
from .cr import *
from .coaddBoundedField import *
from .imagePsf import *
from .interp import *
from .kernelPsf import *
from .psf import *
from .pcaPsf import *
from .psfCandidate import * #python
from .singleGaussianPsf import *
from .spatialModelPsf import *
from .warpedPsf import *
from .coaddPsf import *
from .doubleGaussianPsf import *

from .algorithmsLib import *
from .defects import *
from .psfDeterminer import *
from .pcaPsfDeterminer import *
Expand Down
140 changes: 0 additions & 140 deletions python/lsst/meas/algorithms/algorithmsLib.i

This file was deleted.

13 changes: 7 additions & 6 deletions python/lsst/meas/algorithms/astrometrySourceSelector.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
#
#
# LSST Data Management System
# Copyright 2008-2015 AURA/LSST.
#
# Copyright 2008-2017 AURA/LSST.
#
# This product includes software developed by the
# LSST Project (http://www.lsst.org/).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the LSST License Statement and
# the GNU General Public License along with this program. If not,
#
# You should have received a copy of the LSST License Statement and
# the GNU General Public License along with this program. If not,
# see <https://www.lsstcorp.org/LegalNotices/>.
#
from __future__ import absolute_import, division, print_function
Expand Down
63 changes: 63 additions & 0 deletions python/lsst/meas/algorithms/binnedWcs.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
/*
* LSST Data Management System
*
* This product includes software developed by the
* LSST Project (http://www.lsst.org/).
* See the COPYRIGHT file
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the LSST License Statement and
* the GNU General Public License along with this program. If not,
* see <https://www.lsstcorp.org/LegalNotices/>.
*/
#include "pybind11/pybind11.h"

#include "lsst/meas/algorithms/BinnedWcs.h"

namespace py = pybind11;
using namespace pybind11::literals;

namespace lsst {
namespace meas {
namespace algorithms {

PYBIND11_PLUGIN(binnedWcs) {
py::module mod("binnedWcs");

py::class_<BinnedWcs, std::shared_ptr<BinnedWcs>, afw::image::Wcs> clsBinnedWcs(mod, "BinnedWcs");

/* Constructors */
clsBinnedWcs.def(
py::init<std::shared_ptr<afw::image::Wcs>, unsigned int, unsigned int, afw::geom::Point2I>(),
"parent"_a, "xBin"_a, "yBin"_a, "xy0"_a);

/* Members */
clsBinnedWcs.def("clone", &BinnedWcs::clone);
clsBinnedWcs.def("upcast", &BinnedWcs::upcast);
clsBinnedWcs.def("getParent", &BinnedWcs::getParent);
clsBinnedWcs.def("getXBin", &BinnedWcs::getXBin);
clsBinnedWcs.def("getYBin", &BinnedWcs::getYBin);
clsBinnedWcs.def("getXY0", &BinnedWcs::getXY0);
clsBinnedWcs.def("hasDistortion", &BinnedWcs::hasDistortion);
clsBinnedWcs.def("isPersistable", &BinnedWcs::isPersistable);
clsBinnedWcs.def("flipImage", &BinnedWcs::flipImage);
clsBinnedWcs.def("rotateImageBy90", &BinnedWcs::rotateImageBy90);
clsBinnedWcs.def("getFitsMetadata", &BinnedWcs::getFitsMetadata);
clsBinnedWcs.def("getBinnedToOriginal", &BinnedWcs::getBinnedToOriginal);
clsBinnedWcs.def("getOriginalToBinned", &BinnedWcs::getOriginalToBinned);

return mod.ptr();
}

} // algorithms
} // meas
} // lsst