Coverage for python/lsst/afw/image/utils.py : 44%
Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
|
# # LSST Data Management System # Copyright 2008-2017 LSST/AURA. # # 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 <http://www.lsstcorp.org/LegalNotices/>. #
"defineFiltersFromPolicy", "CalibNoThrow"]
"""Clip an image to lie between minClip and maxclip (None to ignore)""" if isinstance(im, MaskedImage): mi = im else: mi = makeMaskedImage(im, Mask(im.getDimensions()))
if minClip is not None: ds = afwDetect.FootprintSet( mi, afwDetect.Threshold(-minClip, afwDetect.Threshold.VALUE, False)) afwDetect.setImageFromFootprintList( mi.getImage(), ds.getFootprints(), minClip)
if maxClip is not None: ds = afwDetect.FootprintSet(mi, afwDetect.Threshold(maxClip)) afwDetect.setImageFromFootprintList( mi.getImage(), ds.getFootprints(), maxClip)
"""Reset registry of filters and filter properties"""
"""Define a filter and its properties in the filter registry""" Filter.defineAlias(name, alias) else:
"""Process a Policy and define the filters"""
if reset: Filter.reset() FilterProperty.reset() # # Process the Policy and define the filters # policyFile = pexPolicy.DefaultPolicyFile( "afw", "FilterDictionary.paf", "policy") defPolicy = pexPolicy.Policy.createPolicy( policyFile, policyFile.getRepositoryPath(), True)
filterPolicy.mergeDefaults(defPolicy.getDictionary())
for p in filterPolicy.getArray("Filter"): Filter.define(FilterProperty(p.get("name"), p)) if p.exists("alias"): for a in p.getArray("alias"): Filter.defineAlias(p.get("name"), a)
"""A class intended to be used with python's with statement, to return NaNs for negative fluxes instead of raising exceptions (exceptions may be raised for other purposes).
E.g. with CalibNoThrow(): ax.plot([exposure.getCalib().getMagnitude(a) for a in candAmps], zGood[:,k], 'b+') """
|