LSST Applications g034a557a3c+dd8dd8f11d,g0afe43252f+b86e4b8053,g11f7dcd041+017865fdd3,g1cd03abf6b+8446defddb,g1ce3e0751c+f991eae79d,g28da252d5a+ca8a1a9fb3,g2bbee38e9b+b6588ad223,g2bc492864f+b6588ad223,g2cdde0e794+8523d0dbb4,g347aa1857d+b6588ad223,g35bb328faa+b86e4b8053,g3a166c0a6a+b6588ad223,g461a3dce89+b86e4b8053,g52b1c1532d+b86e4b8053,g7f3b0d46df+ad13c1b82d,g80478fca09+f29c5d6c70,g858d7b2824+293f439f82,g8cd86fa7b1+af721d2595,g965a9036f2+293f439f82,g979bb04a14+51ed57f74c,g9ddcbc5298+f24b38b85a,gae0086650b+b86e4b8053,gbb886bcc26+b97e247655,gc28159a63d+b6588ad223,gc30aee3386+a2f0f6cab9,gcaf7e4fdec+293f439f82,gcd45df26be+293f439f82,gcdd4ae20e8+70b5def7e6,gce08ada175+da9c58a417,gcf0d15dbbd+70b5def7e6,gdaeeff99f8+006e14e809,gdbce86181e+6a170ce272,ge3d4d395c2+224150c836,ge5f7162a3a+bb2241c923,ge6cb8fbbf7+d119aed356,ge79ae78c31+b6588ad223,gf048a9a2f4+40ffced2b8,gf0baf85859+b4cca3d10f,w.2024.30
LSST Data Management Base Package
Loading...
Searching...
No Matches
Classes | Functions
lsst.pipe.tasks.skyCorrection Namespace Reference

Classes

class  SkyCorrectionConfig
 
class  SkyCorrectionConnections
 
class  SkyCorrectionTask
 

Functions

 _skyFrameLookup (datasetType, registry, quantumDataId, collections)
 
 _reorderAndPadList (inputList, inputKeys, outputKeys, padWith=None)
 

Function Documentation

◆ _reorderAndPadList()

lsst.pipe.tasks.skyCorrection._reorderAndPadList ( inputList,
inputKeys,
outputKeys,
padWith = None )
protected
Match the order of one list to another, padding if necessary.

Parameters
----------
inputList : `list`
    List to be reordered and padded. Elements can be any type.
inputKeys :  iterable
    Iterable of values to be compared with outputKeys.
    Length must match `inputList`.
outputKeys : iterable
    Iterable of values to be compared with inputKeys.
padWith :
    Any value to be inserted where one of inputKeys is not in outputKeys.

Returns
-------
outputList : `list`
    Copy of inputList reordered per outputKeys and padded with `padWith`
    so that the length matches length of outputKeys.

Definition at line 71 of file skyCorrection.py.

71def _reorderAndPadList(inputList, inputKeys, outputKeys, padWith=None):
72 """Match the order of one list to another, padding if necessary.
73
74 Parameters
75 ----------
76 inputList : `list`
77 List to be reordered and padded. Elements can be any type.
78 inputKeys : iterable
79 Iterable of values to be compared with outputKeys.
80 Length must match `inputList`.
81 outputKeys : iterable
82 Iterable of values to be compared with inputKeys.
83 padWith :
84 Any value to be inserted where one of inputKeys is not in outputKeys.
85
86 Returns
87 -------
88 outputList : `list`
89 Copy of inputList reordered per outputKeys and padded with `padWith`
90 so that the length matches length of outputKeys.
91 """
92 outputList = []
93 for outputKey in outputKeys:
94 if outputKey in inputKeys:
95 outputList.append(inputList[inputKeys.index(outputKey)])
96 else:
97 outputList.append(padWith)
98 return outputList
99
100

◆ _skyFrameLookup()

lsst.pipe.tasks.skyCorrection._skyFrameLookup ( datasetType,
registry,
quantumDataId,
collections )
protected
Lookup function to identify sky frames.

Parameters
----------
datasetType : `lsst.daf.butler.DatasetType`
    Dataset to lookup.
registry : `lsst.daf.butler.Registry`
    Butler registry to query.
quantumDataId : `lsst.daf.butler.DataCoordinate`
    Data id to transform to find sky frames.
    The ``detector`` entry will be stripped.
collections : `lsst.daf.butler.CollectionSearch`
    Collections to search through.

Returns
-------
results : `list` [`lsst.daf.butler.DatasetRef`]
    List of datasets that will be used as sky calibration frames.

Definition at line 41 of file skyCorrection.py.

41def _skyFrameLookup(datasetType, registry, quantumDataId, collections):
42 """Lookup function to identify sky frames.
43
44 Parameters
45 ----------
46 datasetType : `lsst.daf.butler.DatasetType`
47 Dataset to lookup.
48 registry : `lsst.daf.butler.Registry`
49 Butler registry to query.
50 quantumDataId : `lsst.daf.butler.DataCoordinate`
51 Data id to transform to find sky frames.
52 The ``detector`` entry will be stripped.
53 collections : `lsst.daf.butler.CollectionSearch`
54 Collections to search through.
55
56 Returns
57 -------
58 results : `list` [`lsst.daf.butler.DatasetRef`]
59 List of datasets that will be used as sky calibration frames.
60 """
61 newDataId = quantumDataId.subset(registry.dimensions.conform(["instrument", "visit"]))
62 skyFrames = []
63 for dataId in registry.queryDataIds(["visit", "detector"], dataId=newDataId).expanded():
64 skyFrame = registry.findDataset(
65 datasetType, dataId, collections=collections, timespan=dataId.timespan
66 )
67 skyFrames.append(skyFrame)
68 return skyFrames
69
70