LSST Applications
21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
|
Public Member Functions | |
def | __init__ (self, *args, **kwargs) |
def | makeSupplementaryDataGen3 (self, butlerQC, inputRefs, outputRefs) |
def | makeSupplementaryData (self, dataRef, selectDataList=None, warpRefList=None) |
def | run (self, skyInfo, tempExpRefList, imageScalerList, weightList, supplementaryData, *args, **kwargs) |
def | applyAltEdgeMask (self, mask, altMaskList) |
def | findArtifacts (self, templateCoadd, tempExpRefList, imageScalerList) |
def | prefilterArtifacts (self, spanSetList, exp) |
def | filterArtifacts (self, spanSetList, epochCountImage, nImage, footprintsToExclude=None) |
Static Public Attributes | |
ConfigClass | |
Assemble a compareWarp coadded image from a set of warps by masking artifacts detected by comparing PSF-matched warps. In ``AssembleCoaddTask``, we compute the coadd as an clipped mean (i.e., we clip outliers). The problem with doing this is that when computing the coadd PSF at a given location, individual visit PSFs from visits with outlier pixels contribute to the coadd PSF and cannot be treated correctly. In this task, we correct for this behavior by creating a new badMaskPlane 'CLIPPED' which marks pixels in the individual warps suspected to contain an artifact. We populate this plane on the input warps by comparing PSF-matched warps with a PSF-matched median coadd which serves as a model of the static sky. Any group of pixels that deviates from the PSF-matched template coadd by more than config.detect.threshold sigma, is an artifact candidate. The candidates are then filtered to remove variable sources and sources that are difficult to subtract such as bright stars. This filter is configured using the config parameters ``temporalThreshold`` and ``spatialThreshold``. The temporalThreshold is the maximum fraction of epochs that the deviation can appear in and still be considered an artifact. The spatialThreshold is the maximum fraction of pixels in the footprint of the deviation that appear in other epochs (where other epochs is defined by the temporalThreshold). If the deviant region meets this criteria of having a significant percentage of pixels that deviate in only a few epochs, these pixels have the 'CLIPPED' bit set in the mask. These regions will not contribute to the final coadd. Furthermore, any routine to determine the coadd PSF can now be cognizant of clipped regions. Note that the algorithm implemented by this task is preliminary and works correctly for HSC data. Parameter modifications and or considerable redesigning of the algorithm is likley required for other surveys. ``CompareWarpAssembleCoaddTask`` sub-classes ``AssembleCoaddTask`` and instantiates ``AssembleCoaddTask`` as a subtask to generate the TemplateCoadd (the model of the static sky). Notes ----- The `lsst.pipe.base.cmdLineTask.CmdLineTask` interface supports a flag ``-d`` to import ``debug.py`` from your ``PYTHONPATH``; see ``baseDebug`` for more about ``debug.py`` files. This task supports the following debug variables: - ``saveCountIm`` If True then save the Epoch Count Image as a fits file in the `figPath` - ``figPath`` Path to save the debug fits images and figures For example, put something like: .. code-block:: python import lsstDebug def DebugInfo(name): di = lsstDebug.getInfo(name) if name == "lsst.pipe.tasks.assembleCoadd": di.saveCountIm = True di.figPath = "/desired/path/to/debugging/output/images" return di lsstDebug.Info = DebugInfo into your ``debug.py`` file and run ``assemebleCoadd.py`` with the ``--debug`` flag. Some subtasks may have their own debug variables; see individual Task documentation. Examples -------- ``CompareWarpAssembleCoaddTask`` assembles a set of warped images into a coadded image. The ``CompareWarpAssembleCoaddTask`` is invoked by running ``assembleCoadd.py`` with the flag ``--compareWarpCoadd``. Usage of ``assembleCoadd.py`` expects a data reference to the tract patch and filter to be coadded (specified using '--id = [KEY=VALUE1[^VALUE2[^VALUE3...] [KEY=VALUE1[^VALUE2[^VALUE3...] ...]]') along with a list of coaddTempExps to attempt to coadd (specified using '--selectId [KEY=VALUE1[^VALUE2[^VALUE3...] [KEY=VALUE1[^VALUE2[^VALUE3...] ...]]'). Only the warps that cover the specified tract and patch will be coadded. A list of the available optional arguments can be obtained by calling ``assembleCoadd.py`` with the ``--help`` command line argument: .. code-block:: none assembleCoadd.py --help To demonstrate usage of the ``CompareWarpAssembleCoaddTask`` in the larger context of multi-band processing, we will generate the HSC-I & -R band oadds from HSC engineering test data provided in the ``ci_hsc`` package. To begin, assuming that the lsst stack has been already set up, we must set up the ``obs_subaru`` and ``ci_hsc`` packages. This defines the environment variable ``$CI_HSC_DIR`` and points at the location of the package. The raw HSC data live in the ``$CI_HSC_DIR/raw`` directory. To begin assembling the coadds, we must first - processCcd process the individual ccds in $CI_HSC_RAW to produce calibrated exposures - makeSkyMap create a skymap that covers the area of the sky present in the raw exposures - makeCoaddTempExp warp the individual calibrated exposures to the tangent plane of the coadd We can perform all of these steps by running .. code-block:: none $CI_HSC_DIR scons warp-903986 warp-904014 warp-903990 warp-904010 warp-903988 This will produce warped ``coaddTempExps`` for each visit. To coadd the warped data, we call ``assembleCoadd.py`` as follows: .. code-block:: none assembleCoadd.py --compareWarpCoadd $CI_HSC_DIR/DATA --id patch=5,4 tract=0 filter=HSC-I \ --selectId visit=903986 ccd=16 --selectId visit=903986 ccd=22 --selectId visit=903986 ccd=23 \ --selectId visit=903986 ccd=100 --selectId visit=904014 ccd=1 --selectId visit=904014 ccd=6 \ --selectId visit=904014 ccd=12 --selectId visit=903990 ccd=18 --selectId visit=903990 ccd=25 \ --selectId visit=904010 ccd=4 --selectId visit=904010 ccd=10 --selectId visit=904010 ccd=100 \ --selectId visit=903988 ccd=16 --selectId visit=903988 ccd=17 --selectId visit=903988 ccd=23 \ --selectId visit=903988 ccd=24 This will process the HSC-I band data. The results are written in ``$CI_HSC_DIR/DATA/deepCoadd-results/HSC-I``.
Definition at line 2059 of file assembleCoadd.py.
def lsst.pipe.tasks.assembleCoadd.CompareWarpAssembleCoaddTask.__init__ | ( | self, | |
* | args, | ||
** | kwargs | ||
) |
Definition at line 2183 of file assembleCoadd.py.
def lsst.pipe.tasks.assembleCoadd.CompareWarpAssembleCoaddTask.applyAltEdgeMask | ( | self, | |
mask, | |||
altMaskList | |||
) |
Propagate alt EDGE mask to SENSOR_EDGE AND INEXACT_PSF planes. Parameters ---------- mask : `lsst.afw.image.Mask` Original mask. altMaskList : `list` List of Dicts containing ``spanSet`` lists. Each element contains the new mask plane name (e.g. "CLIPPED and/or "NO_DATA") as the key, and list of ``SpanSets`` to apply to the mask.
Definition at line 2323 of file assembleCoadd.py.
def lsst.pipe.tasks.assembleCoadd.CompareWarpAssembleCoaddTask.filterArtifacts | ( | self, | |
spanSetList, | |||
epochCountImage, | |||
nImage, | |||
footprintsToExclude = None |
|||
) |
Filter artifact candidates. Parameters ---------- spanSetList : `list` List of SpanSets representing artifact candidates. epochCountImage : `lsst.afw.image.Image` Image of accumulated number of warpDiff detections. nImage : `lsst.afw.image.Image` Image of the accumulated number of total epochs contributing. Returns ------- maskSpanSetList : `list` List of SpanSets with artifacts.
Definition at line 2494 of file assembleCoadd.py.
def lsst.pipe.tasks.assembleCoadd.CompareWarpAssembleCoaddTask.findArtifacts | ( | self, | |
templateCoadd, | |||
tempExpRefList, | |||
imageScalerList | |||
) |
Find artifacts. Loop through warps twice. The first loop builds a map with the count of how many epochs each pixel deviates from the templateCoadd by more than ``config.chiThreshold`` sigma. The second loop takes each difference image and filters the artifacts detected in each using count map to filter out variable sources and sources that are difficult to subtract cleanly. Parameters ---------- templateCoadd : `lsst.afw.image.Exposure` Exposure to serve as model of static sky. tempExpRefList : `list` List of data references to warps. imageScalerList : `list` List of image scalers. Returns ------- altMasks : `list` List of dicts containing information about CLIPPED (i.e., artifacts), NO_DATA, and EDGE pixels.
Definition at line 2342 of file assembleCoadd.py.
def lsst.pipe.tasks.assembleCoadd.CompareWarpAssembleCoaddTask.makeSupplementaryData | ( | self, | |
dataRef, | |||
selectDataList = None , |
|||
warpRefList = None |
|||
) |
Generate a templateCoadd to use as a naive model of static sky to subtract from PSF-Matched warps. Returns ------- result : `lsst.pipe.base.Struct` Result struct with components: - ``templateCoadd``: coadded exposure (``lsst.afw.image.Exposure``) - ``nImage``: N Image (``lsst.afw.image.Image``)
Definition at line 2239 of file assembleCoadd.py.
def lsst.pipe.tasks.assembleCoadd.CompareWarpAssembleCoaddTask.makeSupplementaryDataGen3 | ( | self, | |
butlerQC, | |||
inputRefs, | |||
outputRefs | |||
) |
Generate a templateCoadd to use as a naive model of static sky to subtract from PSF-Matched warps. Returns ------- result : `lsst.pipe.base.Struct` Result struct with components: - ``templateCoadd`` : coadded exposure (``lsst.afw.image.Exposure``) - ``nImage`` : N Image (``lsst.afw.image.Image``)
Definition at line 2196 of file assembleCoadd.py.
def lsst.pipe.tasks.assembleCoadd.CompareWarpAssembleCoaddTask.prefilterArtifacts | ( | self, | |
spanSetList, | |||
exp | |||
) |
Remove artifact candidates covered by bad mask plane. Any future editing of the candidate list that does not depend on temporal information should go in this method. Parameters ---------- spanSetList : `list` List of SpanSets representing artifact candidates. exp : `lsst.afw.image.Exposure` Exposure containing mask planes used to prefilter. Returns ------- returnSpanSetList : `list` List of SpanSets with artifacts.
Definition at line 2462 of file assembleCoadd.py.
def lsst.pipe.tasks.assembleCoadd.CompareWarpAssembleCoaddTask.run | ( | self, | |
skyInfo, | |||
tempExpRefList, | |||
imageScalerList, | |||
weightList, | |||
supplementaryData, | |||
* | args, | ||
** | kwargs | ||
) |
Assemble the coadd. Find artifacts and apply them to the warps' masks creating a list of alternative masks with a new "CLIPPED" plane and updated "NO_DATA" plane. Then pass these alternative masks to the base class's `run` method. The input parameters ``supplementaryData`` is a `lsst.pipe.base.Struct` that must contain a ``templateCoadd`` that serves as the model of the static sky.
Definition at line 2279 of file assembleCoadd.py.
|
static |
Definition at line 2180 of file assembleCoadd.py.