Skip to content

Commit

Permalink
Silence warnings in source initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
fred3m committed Feb 5, 2021
1 parent 71e9a84 commit 68892c8
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions python/lsst/meas/extensions/scarlet/scarletDeblendTask.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
# 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 logging
import numpy as np
import scarlet
from scarlet.psf import ImagePSF, GaussianPSF
Expand All @@ -39,6 +40,20 @@

from .source import modelToHeavy

# scarlet initialization allows the user to specify the maximum number
# of components for a source but will fall back to fewer components or
# an initial PSF morphology depending on the S/N. If either of those happen
# then scarlet currently warnings that the type of source created by the
# user was modified. This is not ideal behavior, as it creates a lot of
# unnecessary warnings for expected behavior and the information is
# already persisted due to the change in source type.
# So we silence all of the initialization warnings here to prevent
# polluting the log files.
scarletInitLogger = logging.getLogger("scarlet.initialisation")
scarletSourceLogger = logging.getLogger("scarlet.source")
scarletInitLogger.setLevel(logging.ERROR)
scarletSourceLogger.setLevel(logging.ERROR)

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

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

0 comments on commit 68892c8

Please sign in to comment.