Skip to content

Commit

Permalink
Update formatting and RST links
Browse files Browse the repository at this point in the history
  • Loading branch information
bsmartradio committed Apr 21, 2023
1 parent 78baebc commit 8a0cdd9
Show file tree
Hide file tree
Showing 7 changed files with 60 additions and 58 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. lsst-task-topic:: lsst.ip.diffim.DecorrelateALKernelSpatialTask

##########################
##############################
DecorrelateALKernelSpatialTask
##########################
##############################

Pipe-task that removes the neighboring-pixel covariance in an
image difference that are added when the template image is
Expand All @@ -11,21 +11,21 @@ convolved with the Alard-Lupton PSF matching kernel.
.. _lsst.ip.diffim.DecorrelateALKernelSpatialTask-description:

Description
==================

This task is a simple wrapper around @ref DecorrelateALKernelTask,
which takes a `spatiallyVarying` parameter in its `run` method. If
it is `False`, then it simply calls the `run` method of @ref
DecorrelateALKernelTask. If it is True, then it uses the @ref
ImageMapReduceTask framework to break the exposures into
subExposures on a grid, and performs the `run` method of @ref
DecorrelateALKernelTask on each subExposure. This enables it to
===========

This task is a simple wrapper around `~lsst.ip.diffim.imageDecorrelation.DecorrelateALKernelTask`,
which takes a ``spatiallyVarying`` parameter in its ``run`` method. If
it is ``False``, then it simply calls the ``run`` method of
`~lsst.ip.diffim.imageDecorrelation.DecorrelateALKernelTask`. If it is True, then it uses the
`~lsst.ip.diffim.imageDecorrelation.ImageMapReduceTask` framework to break the exposures into
subExposures on a grid, and performs the ``run`` method of
`~lsst.ip.diffim.imageDecorrelation.DecorrelateALKernelTask` on each subExposure. This enables it to
account for spatially-varying PSFs and noise in the exposures when
performing the decorrelation.

This task has no standalone example, however it is applied as a
subtask of pipe.tasks.imageDifference.ImageDifferenceTask.
There is also an example of its use in `tests/testImageDecorrelation.py`.
subtask of `~pipe.tasks.imageDifference.ImageDifferenceTask`.
There is also an example of its use in ``tests/testImageDecorrelation.py``.

.. _lsst.ip.diffim.DecorrelateALKernelSpatialTask-api:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. lsst-task-topic:: lsst.ip.diffim.DecorrelateALKernelTask

##########################
#######################
DecorrelateALKernelTask
##########################
#######################

Pipe-task that removes the neighboring-pixel covariance in an
image difference that are added when the template image is
Expand All @@ -11,11 +11,10 @@ convolved with the Alard-Lupton PSF matching kernel.
.. _lsst.ip.diffim.DecorrelateALKernelTask-description:

Description
==================
===========

The image differencing pipeline task @link
ip.diffim.psfMatch.PsfMatchTask PSFMatchTask@endlink and @link
ip.diffim.psfMatch.PsfMatchConfigAL PSFMatchConfigAL@endlink uses
The image differencing pipeline task `~ip.diffim.psfMatch.PsfMatchTask` and
`~ip.diffim.psfMatch.PsfMatchConfigAL` uses
the Alard and Lupton (1998) method for matching the PSFs of the
template and science exposures prior to subtraction. The
Alard-Lupton method identifies a matching kernel, which is then
Expand All @@ -32,7 +31,7 @@ convolving the image difference with it. This process is described
in detail in [DMTN-021](http://dmtn-021.lsst.io).

This task has no standalone example, however it is applied as a
subtask of pipe.tasks.imageDifference.ImageDifferenceTask.
subtask of `~pipe.tasks.imageDifference.ImageDifferenceTask`.

.. _lsst.ip.diffim.DecorrelateALKernelTask-api:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
.. lsst-task-topic:: lsst.ip.diffim.DiaCatalogSourceSelectorTask

##########################
############################
DiaCatalogSourceSelectorTask
##########################
############################

A task that selects sources for Kernel candidates.

.. _lsst.ip.diffim.DiaCatalogSourceSelectorTask-description:

Description
==================
===========

A naive star selector based on second moments. Use with caution.

Expand Down Expand Up @@ -39,7 +39,10 @@ Configuration fields
Debugging
=========

DiaCatalogSourceSelectorTask has a debug dictionary with the following keys:
The ``pipetask`` command line interface supports a ``--debug`` flag to import
``debug.py`` from your PYTHONPATH; see :ref:`lsstDebug` for more about ``debug.py``
files.
The available variables in DiaCatalogSourceSelectorTask include:

display : `bool`
if True display debug information
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
.. lsst-task-topic:: lsst.ip.diffim.DipoleMeasurementTask

##########################
#####################
DipoleMeasurementTask
##########################
#####################

DipoleMeasurementTask measures sources on images to identify likely dipoles.
This task is purely a configuration wrapper around `~lsst.meas.base.SingleFrameMeasurementTask`, with helpers to performe dipole-specific measurements.

.. _lsst.ip.diffim.DipoleMeasurementTask-description:

Description
==================
===========

These plugins enabled by default allow the user to test the hypothesis that the
The plugins used by this task by default allow the user to test the hypothesis that the
Source is a dipole. This includes a set of measurements derived from
intermediate base classes DipoleCentroidAlgorithm and DipoleFluxAlgorithm.
Their respective algorithm control classes are defined in
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. lsst-task-topic:: lsst.ip.diffim.GetCoaddAsTemplateTask

##########################
######################
GetCoaddAsTemplateTask
##########################
######################

From the given skymap, the closest tract is selected; multiple tracts are
not supported. The assembled template inherits the WCS of the selected
Expand Down
42 changes: 21 additions & 21 deletions doc/lsst.ip.diffim/tasks/lsst.ip.diffim.ImagePsfMatchTask.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
.. lsst-task-topic:: lsst.ip.diffim.ImagePsfMatchTask

##########################
#################
ImagePsfMatchTask
##########################
#################

ImagePsfMatchTask creates a PSF-matching kernel for two images.

.. _lsst.ip.diffim.ImagePsfMatchTask-description:

Description
==================
===========

Build a Psf-matching kernel using two input images, either as MaskedImages
(in which case they need to be astrometrically aligned) or Exposures (in which
Expand All @@ -19,16 +19,16 @@ not, the Task will perform a coarse source detection and selection for this
purpose. Sources are vetted for signal-to-noise and masked pixels (in both the
template and science image), and substamps around each acceptable source are
extracted and used to create an instance of KernelCandidate. Each
KernelCandidate is then placed within a lsst.afw.math.SpatialCellSet, which is
used by an ensemble of lsst.afw.math.CandidateVisitor instances to build the
KernelCandidate is then placed within a `~lsst.afw.math.SpatialCellSet`, which is
used by an ensemble of `~lsst.afw.math.CandidateVisitor` instances to build the
Psf-matching kernel. These visitors include, in the order that they are
called: BuildSingleKernelVisitor, KernelSumVisitor, BuildSpatialKernelVisitor,
and AssessSpatialKernelVisitor.
called: ``BuildSingleKernelVisitor``, ``KernelSumVisitor``, ``BuildSpatialKernelVisitor``,
and ``AssessSpatialKernelVisitor``.

Upon initialization, the kernel configuration is defined by
self.config.kernel.active. The task creates an lsst.afw.math.Warper from the
subConfig self.config.kernel.active.warpingConfig. A schema for the selection
and measurement of candidate lsst.ip.diffim.KernelCandidates is defined, and
``self.config.kernel.active``. The task creates an `~lsst.afw.math.Warper` from the
subConfig ``self.config.kernel.active.warpingConfig``. A schema for the selection
and measurement of candidate `~lsst.ip.diffim.KernelCandidates` is defined, and
used to initize subTasks selectDetection (for candidate detection) and
selectMeasurement(for candidate measurement).

Expand All @@ -39,20 +39,20 @@ Sigma clipping of KernelCandidates is performed as follows:
* AssessSpatialKernelVisitor, using the substamp diffim ressiduals from the spatial kernel fit, if PsfMatchConfig.spatialKernelClipping is True

The actual solving for the kernel (and differential background model) happens
in lsst.ip.diffim.PsfMatchTask._solve. This involves a loop over the
in ``lsst.ip.diffim.PsfMatchTask._solve``. This involves a loop over the
SpatialCellSet that first builds the per-candidate matching kernel for the
requested number of KernelCandidates per cell
(PsfMatchConfig.nStarPerCell). The quality of this initial per-candidate
(``PsfMatchConfig.nStarPerCell``). The quality of this initial per-candidate
difference image is examined, using moments of the pixel residuals in the
difference image normalized by the square root of the variance(i.e. sigma);
ideally this should follow a normal (0, 1) distribution, but the rejection
thresholds are set by the config (PsfMatchConfig.candidateResidualMeanMax and
PsfMatchConfig.candidateResidualStdMax). All candidates that pass this initial
thresholds are set by the config (``PsfMatchConfig.candidateResidualMeanMax`` and
``PsfMatchConfig.candidateResidualStdMax``). All candidates that pass this initial
build are then examined en masse to find the mean/stdev of the kernel sums
across all candidates. Objects that are significantly above or below the mean,
typically due to variability or sources that are saturated in one image but
not the other, are also rejected.This threshold is defined by
PsfMatchConfig.maxKsumSigma. Finally, a spatial model is built using all
``PsfMatchConfig.maxKsumSigma``. Finally, a spatial model is built using all
currently-acceptable candidates, and the spatial model used to derive a second
set of (spatial) residuals which are again used to reject bad candidates,
using the same thresholds as above.
Expand All @@ -69,11 +69,11 @@ may be used to invoke the Psf-matching. These are
`~lsst.ip.diffim.imagePsfMatch.ImagePsfMatchTask.matchExposures`, and
`~lsst.ip.diffim.imagePsfMatch.ImagePsfMatchTask.subtractExposures`.

The methods that operate on lsst.afw.image.MaskedImage require that the images
The methods that operate on `~lsst.afw.image.MaskedImage` require that the images
already be astrometrically aligned, and are the same shape. The methods that
operate on lsst.afw.image.Exposure allow for the input images to be
operate on `~lsst.afw.image.Exposure` allow for the input images to be
misregistered and potentially be different sizes; by default a
lsst.afw.math.LanczosWarpingKernel is used to perform the astrometric
`~lsst.afw.math.LanczosWarpingKernel` is used to perform the astrometric
alignment. The methods that "match" images return a Psf-matched image, while
the methods that "subtract" images return a Psf-matched and template
subtracted image.
Expand Down Expand Up @@ -106,9 +106,9 @@ Configuration fields
Debugging
=========

The ``pipetask`` command line interface supports a flag ``--debug`` to import
ref: supports a flag `--debug`` to import debug.py from your PYTHONPATH;
see :ref:`lsstDebug` for more about debug.py files.
The ``pipetask`` command line interface supports a ``--debug`` flag to import
``debug.py`` from your PYTHONPATH; see :ref:`lsstDebug` for more about ``debug.py``
files.
The available variables in ImagePsfMatchTask include:

display : `bool`
Expand Down
14 changes: 7 additions & 7 deletions doc/lsst.ip.diffim/tasks/lsst.ip.diffim.ModelPsfMatchTask.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
.. lsst-task-topic:: lsst.ip.diffim.ModelPsfMatchTask

##########################
#################
ModelPsfMatchTask
##########################
#################

ImagePsfMatchTask creates a PSF-matching kernel for two models.

Expand All @@ -22,7 +22,7 @@ a 21x21 matrix). When the Psf-matching kernel is being solved for, the
Psf "image" is convolved with each kernel basis function, leading to a loss of
information around the borders. This pixel loss will be problematic for the
numerical stability of the kernel solution if the size of the convolution
kernel(set by ModelPsfMatchConfig.kernelSize) is much bigger than: psfSize//2.
kernel(set by ``ModelPsfMatchConfig.kernelSize``) is much bigger than: psfSize//2.
Thus the sizes of Psf-model matching kernels are typically smaller than their
image-matching counterparts. If the size of the kernel is too small, the
convolved stars will look "boxy"; if the kernel is too large, the kernel
Expand All @@ -33,7 +33,7 @@ The primary use case for this Task is in matching an Exposure to a
constant-across-the-sky Psf model for the purposes of image coaddition. It is
important to note that in the code, the "template" Psf is the Psf that the
science image gets matched to. In this sense the order of template and
science image are reversed, compared to ImagePsfMatchTask, which operates on
science image are reversed, compared to ``ImagePsfMatchTask``, which operates on
the template image.

.. _lsst.ip.diffim.ModelPsfMatchTask-api:
Expand Down Expand Up @@ -62,9 +62,9 @@ Configuration fields
Debugging
=========

The ``pipetask`` command line interface supports a flag ``--debug`` to import
ref: supports a flag ``--debug`` to import debug.py from your PYTHONPATH;
see :ref:`lsstDebug` for more about debug.py files.
The ``pipetask`` command line interface supports a ``--debug`` flag to import
``debug.py`` from your PYTHONPATH; see :ref:`lsstDebug` for more about ``debug.py``
files.
The available variables in ModelsPsfMatchTask include:

display : `bool`
Expand Down

0 comments on commit 8a0cdd9

Please sign in to comment.