Coverage for python/lsst/pipe/tasks/makeDiscreteSkyMap.py : 74%

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-2015 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/>. #
"""Config for MakeDiscreteSkyMapTask """ doc="coadd name, e.g. deep, goodSeeing, chiSquared", dtype=str, default="deep", ) dtype=BaseSkyMap.ConfigClass, doc="SkyMap configuration parameters, excluding position and radius" ) doc="additional border added to the bounding box of the calexps, in degrees", dtype=float, default=0.0 ) doc="append another tract to an existing DiscreteSkyMap on disk, if present?", dtype=bool, default=False ) doc="persist the skyMap?", dtype=bool, default=True, )
"""Run a task with all dataRefs at once, rather than one dataRef at a time.
Call the run method of the task using two positional arguments: - butler: data butler - dataRefList: list of all dataRefs, """ def getTargetList(parsedCmd):
""" @param args Arguments for Task.run()
@return: - None if self.doReturnResults false - A pipe_base Struct containing these fields if self.doReturnResults true: - dataRef: the provided data reference - metadata: task metadata after execution of run - result: result returned by task run, or None if the task fails """ result = task.runDataRef(butler, dataRefList) else: except Exception as e: task.log.fatal("Failed: %s" % e) exitStatus = 1 if not isinstance(e, pipeBase.TaskError): traceback.print_exc(file=sys.stderr)
dataRefList=dataRefList, metadata=task.metadata, result=result, exitStatus=exitStatus, ) else: return pipeBase.Struct( exitStatus=exitStatus, )
"""!Make a DiscreteSkyMap in a repository, using the bounding box of a set of calexps.
The command-line and run signatures and config are sufficiently different from MakeSkyMapTask that we don't inherit from it, but it is a replacement, so we use the same config/metadata names. """
def runDataRef(self, butler, dataRefList): """!Make a skymap from the bounds of the given set of calexps.
@param[in] butler data butler used to save the SkyMap @param[in] dataRefList dataRefs of calexps used to determine the size and pointing of the SkyMap @return a pipeBase Struct containing: - skyMap: the constructed SkyMap """ self.log.warn("CalExp for %s does not exist: ignoring" % (dataRef.dataId,)) continue # nb: don't need to worry about xy0 because Exposure saves Wcs with CRPIX shifted by (-x0, -y0). raise RuntimeError("No data found from which to compute convex hull") raise RuntimeError( "Failed to compute convex hull of the vertices of all calexp bounding boxes; " "they may not be hemispherical." )
oldSkyMap = butler.get(datasetName, immediate=True) if not isinstance(oldSkyMap.config, DiscreteSkyMap.ConfigClass): raise TypeError("Cannot append to existing non-discrete skymap") compareLog = [] if not self.config.skyMap.compare(oldSkyMap.config, output=compareLog.append): raise ValueError("Cannot append to existing skymap - configurations differ:", *compareLog) skyMapConfig.raList.extend(oldSkyMap.config.raList) skyMapConfig.decList.extend(oldSkyMap.config.decList) skyMapConfig.radiusList.extend(oldSkyMap.config.radiusList)
posBox.getMin(), afwGeom.Point2D(posBox.getMaxX(), posBox.getMinY()), posBox.getMax(), afwGeom.Point2D(posBox.getMinX(), posBox.getMaxY()), ) (tractInfo.getId(), ", ".join(posStrList), tractInfo.getNumPatches()[0], tractInfo.getNumPatches()[1])) butler.put(skyMap, datasetName) skyMap=skyMap )
"""Return None to disable saving config
There's only one SkyMap per repository, so the config is redundant, and checking it means we can't easily overwrite or append to an existing repository. """
"""Return None to disable saving metadata
The metadata is not interesting, and by not saving it we can eliminate a dataset type. """
def _makeArgumentParser(cls): |