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-22409: Include meas_extensions_scarlet in pipelines.lsst.io #14

Merged
merged 3 commits into from
Dec 2, 2019
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
23 changes: 23 additions & 0 deletions python/lsst/meas/extensions/scarlet/blend.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,28 @@
# This file is part of meas_extensions_scarlet.
#
# Developed for the LSST Data Management System.
# This product includes software developed by the LSST Project
# (https://www.lsst.org).
# See the COPYRIGHT file at the top-level directory of this distribution
# for details of code ownership.
#
# 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 GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

from scarlet.blend import Blend

__all__ = ["LsstBlend"]


class LsstBlend(Blend):
"""LSST Blend of sources
Expand Down
21 changes: 21 additions & 0 deletions python/lsst/meas/extensions/scarlet/deblend.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
# This file is part of meas_extensions_scarlet.
#
# Developed for the LSST Data Management System.
# This product includes software developed by the LSST Project
# (https://www.lsst.org).
# See the COPYRIGHT file at the top-level directory of this distribution
# for details of code ownership.
#
# 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 GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

import numpy as np
from scarlet.psf import gaussian
Expand All @@ -18,6 +38,7 @@
from .blend import LsstBlend
from .observation import LsstFrame, LsstObservation

__all__ = ["deblend", "ScarletDeblendConfig", "ScarletDeblendTask"]

logger = lsst.log.Log.getLogger("meas.deblender.deblend")

Expand Down
22 changes: 22 additions & 0 deletions python/lsst/meas/extensions/scarlet/observation.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,28 @@
# This file is part of meas_extensions_scarlet.
#
# Developed for the LSST Data Management System.
# This product includes software developed by the LSST Project
# (https://www.lsst.org).
# See the COPYRIGHT file at the top-level directory of this distribution
# for details of code ownership.
#
# 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 GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

from scarlet.observation import Frame, Observation

__all__ = ["LsstFrame", "LsstObservation"]


class LsstFrame(Frame):
pass
Expand Down
23 changes: 23 additions & 0 deletions python/lsst/meas/extensions/scarlet/source.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,24 @@
# This file is part of meas_extensions_scarlet.
#
# Developed for the LSST Data Management System.
# This product includes software developed by the LSST Project
# (https://www.lsst.org).
# See the COPYRIGHT file at the top-level directory of this distribution
# for details of code ownership.
#
# 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 GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.

import numpy as np
from scarlet.source import PointSource, ExtendedSource, SourceInitError
from scarlet.component import BlendFlag
Expand All @@ -7,6 +28,8 @@
from lsst.geom import Point2I
import lsst.afw.detection as afwDet

__all__ = ["LsstSource", "LsstHistory"]


class LsstSource(ExtendedSource):
"""LSST Base Source
Expand Down
2 changes: 1 addition & 1 deletion tests/test_scarlet.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def test_fit_pointSource(self):
for coord in coords:
foot, peak, bbox = numpyToStack(images, coord, (15, 3))
sources.append(lmeScarlet.LsstSource(frame, peak, observation, bgRms, bbox, pointSource=True))
blend = lmeScarlet.Blend(sources, observation)
blend = scarlet.Blend(sources, observation)
# Try to run for 10 iterations
# Since the model is already near exact, it should converge
# on the 2nd iteration (since it doesn't calculate the initial loss)
Expand Down