Skip to content

DM-47916: Remove deprecated makeWarp and warpAndPsfMatch #1115

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 25, 2025
3 changes: 0 additions & 3 deletions doc/lsst.pipe.tasks/index.rst
Original file line number Diff line number Diff line change
@@ -159,9 +159,6 @@ Python API reference
.. automodapi:: lsst.pipe.tasks.makeDiscreteSkyMap
:no-inheritance-diagram:

.. automodapi:: lsst.pipe.tasks.makeWarp
:no-inheritance-diagram:

.. automodapi:: lsst.pipe.tasks.matchBackgrounds
:no-inheritance-diagram:

165 changes: 0 additions & 165 deletions doc/lsst.pipe.tasks/tasks/lsst.pipe.tasks.makeWarp.MakeWarpTask.rst

This file was deleted.

This file was deleted.

39 changes: 39 additions & 0 deletions python/lsst/pipe/tasks/coaddBase.py
Original file line number Diff line number Diff line change
@@ -198,6 +198,45 @@ def reorderAndPadList(inputList, inputKeys, outputKeys, padWith=None):
return outputList


def reorderRefs(inputRefs, outputSortKeyOrder, dataIdKey):
"""Reorder inputRefs per outputSortKeyOrder.

Any inputRefs which are lists will be resorted per specified key e.g.,
'detector.' Only iterables will be reordered, and values can be of type
`lsst.pipe.base.connections.DeferredDatasetRef` or
`lsst.daf.butler.core.datasets.ref.DatasetRef`.

Returned lists of refs have the same length as the outputSortKeyOrder.
If an outputSortKey not in the inputRef, then it will be padded with None.
If an inputRef contains an inputSortKey that is not in the
outputSortKeyOrder it will be removed.

Parameters
----------
inputRefs : `lsst.pipe.base.connections.QuantizedConnection`
Input references to be reordered and padded.
outputSortKeyOrder : `iterable`
Iterable of values to be compared with inputRef's dataId[dataIdKey].
dataIdKey : `str`
The data ID key in the dataRefs to compare with the outputSortKeyOrder.

Returns
-------
inputRefs : `lsst.pipe.base.connections.QuantizedConnection`
Quantized Connection with sorted DatasetRef values sorted if iterable.
"""
for connectionName, refs in inputRefs:
if isinstance(refs, Iterable):
if hasattr(refs[0], "dataId"):
inputSortKeyOrder = [ref.dataId[dataIdKey] for ref in refs]
else:
inputSortKeyOrder = [handle.datasetRef.dataId[dataIdKey] for handle in refs]
if inputSortKeyOrder != outputSortKeyOrder:
setattr(inputRefs, connectionName,
reorderAndPadList(refs, inputSortKeyOrder, outputSortKeyOrder))
return inputRefs


def subBBoxIter(bbox, subregionSize):
"""Iterate over subregions of a bbox.

2 changes: 1 addition & 1 deletion python/lsst/pipe/tasks/deblendCoaddSourcesPipeline.py
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@
import lsst.afw.image as afwImage
import lsst.afw.table as afwTable

from .makeWarp import reorderRefs
from .coaddBase import reorderRefs


deblendBaseTemplates = {"inputCoaddName": "deep", "outputCoaddName": "deep"}
595 changes: 10 additions & 585 deletions python/lsst/pipe/tasks/makeWarp.py

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions python/lsst/pipe/tasks/postprocess.py
Original file line number Diff line number Diff line change
@@ -58,6 +58,7 @@
from lsst.meas.base import SingleFrameMeasurementTask, DetectorVisitIdGeneratorConfig
from lsst.obs.base.utils import strip_provenance_from_fits_header

from .coaddBase import reorderRefs
from .functors import CompositeFunctor, Column

log = logging.getLogger(__name__)
@@ -1441,8 +1442,7 @@ class ConsolidateSourceTableTask(pipeBase.PipelineTask):
outputDataset = "sourceTable_visit"

def runQuantum(self, butlerQC, inputRefs, outputRefs):
from .makeWarp import reorderRefs

# Docstring inherited.
detectorOrder = [ref.dataId["detector"] for ref in inputRefs.inputCatalogs]
detectorOrder.sort()
inputRefs = reorderRefs(inputRefs, detectorOrder, dataIdKey="detector")
128 changes: 0 additions & 128 deletions python/lsst/pipe/tasks/warpAndPsfMatch.py

This file was deleted.