Skip to content

Commit 60dcce3

Browse files
Merge pull request #1115 from lsst/tickets/DM-47916
DM-47916: Remove deprecated makeWarp and warpAndPsfMatch
2 parents 87d2993 + b99aab7 commit 60dcce3

8 files changed

+52
-910
lines changed

doc/lsst.pipe.tasks/index.rst

-3
Original file line numberDiff line numberDiff line change
@@ -159,9 +159,6 @@ Python API reference
159159
.. automodapi:: lsst.pipe.tasks.makeDiscreteSkyMap
160160
:no-inheritance-diagram:
161161

162-
.. automodapi:: lsst.pipe.tasks.makeWarp
163-
:no-inheritance-diagram:
164-
165162
.. automodapi:: lsst.pipe.tasks.matchBackgrounds
166163
:no-inheritance-diagram:
167164

doc/lsst.pipe.tasks/tasks/lsst.pipe.tasks.makeWarp.MakeWarpTask.rst

-165
This file was deleted.

doc/lsst.pipe.tasks/tasks/lsst.pipe.tasks.warpAndPsfMatch.WarpAndPsfMatchTask.rst

-26
This file was deleted.

python/lsst/pipe/tasks/coaddBase.py

+39
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,45 @@ def reorderAndPadList(inputList, inputKeys, outputKeys, padWith=None):
198198
return outputList
199199

200200

201+
def reorderRefs(inputRefs, outputSortKeyOrder, dataIdKey):
202+
"""Reorder inputRefs per outputSortKeyOrder.
203+
204+
Any inputRefs which are lists will be resorted per specified key e.g.,
205+
'detector.' Only iterables will be reordered, and values can be of type
206+
`lsst.pipe.base.connections.DeferredDatasetRef` or
207+
`lsst.daf.butler.core.datasets.ref.DatasetRef`.
208+
209+
Returned lists of refs have the same length as the outputSortKeyOrder.
210+
If an outputSortKey not in the inputRef, then it will be padded with None.
211+
If an inputRef contains an inputSortKey that is not in the
212+
outputSortKeyOrder it will be removed.
213+
214+
Parameters
215+
----------
216+
inputRefs : `lsst.pipe.base.connections.QuantizedConnection`
217+
Input references to be reordered and padded.
218+
outputSortKeyOrder : `iterable`
219+
Iterable of values to be compared with inputRef's dataId[dataIdKey].
220+
dataIdKey : `str`
221+
The data ID key in the dataRefs to compare with the outputSortKeyOrder.
222+
223+
Returns
224+
-------
225+
inputRefs : `lsst.pipe.base.connections.QuantizedConnection`
226+
Quantized Connection with sorted DatasetRef values sorted if iterable.
227+
"""
228+
for connectionName, refs in inputRefs:
229+
if isinstance(refs, Iterable):
230+
if hasattr(refs[0], "dataId"):
231+
inputSortKeyOrder = [ref.dataId[dataIdKey] for ref in refs]
232+
else:
233+
inputSortKeyOrder = [handle.datasetRef.dataId[dataIdKey] for handle in refs]
234+
if inputSortKeyOrder != outputSortKeyOrder:
235+
setattr(inputRefs, connectionName,
236+
reorderAndPadList(refs, inputSortKeyOrder, outputSortKeyOrder))
237+
return inputRefs
238+
239+
201240
def subBBoxIter(bbox, subregionSize):
202241
"""Iterate over subregions of a bbox.
203242

python/lsst/pipe/tasks/deblendCoaddSourcesPipeline.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
import lsst.afw.image as afwImage
3838
import lsst.afw.table as afwTable
3939

40-
from .makeWarp import reorderRefs
40+
from .coaddBase import reorderRefs
4141

4242

4343
deblendBaseTemplates = {"inputCoaddName": "deep", "outputCoaddName": "deep"}

0 commit comments

Comments
 (0)