LSST Applications g0265f82a02+c6dfa2ddaf,g1162b98a3f+b2075782a9,g2079a07aa2+1b2e822518,g2bbee38e9b+c6dfa2ddaf,g337abbeb29+c6dfa2ddaf,g3ddfee87b4+a60788ef87,g50ff169b8f+2eb0e556e8,g52b1c1532d+90ebb246c7,g555ede804d+a60788ef87,g591dd9f2cf+ba8caea58f,g5ec818987f+864ee9cddb,g858d7b2824+9ee1ab4172,g876c692160+a40945ebb7,g8a8a8dda67+90ebb246c7,g8cdfe0ae6a+4fd9e222a8,g99cad8db69+5e309b7bc6,g9ddcbc5298+a1346535a5,ga1e77700b3+df8f93165b,ga8c6da7877+aa12a14d27,gae46bcf261+c6dfa2ddaf,gb0e22166c9+8634eb87fb,gb3f2274832+d0da15e3be,gba4ed39666+1ac82b564f,gbb8dafda3b+5dfd9c994b,gbeb006f7da+97157f9740,gc28159a63d+c6dfa2ddaf,gc86a011abf+9ee1ab4172,gcf0d15dbbd+a60788ef87,gdaeeff99f8+1cafcb7cd4,gdc0c513512+9ee1ab4172,ge79ae78c31+c6dfa2ddaf,geb67518f79+ba1859f325,geb961e4c1e+f9439d1e6f,gee10cc3b42+90ebb246c7,gf1cff7945b+9ee1ab4172,w.2024.12
LSST Data Management Base Package
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
lsst.skymap.tractBuilder.LegacyTractBuilder Class Reference
Inheritance diagram for lsst.skymap.tractBuilder.LegacyTractBuilder:
lsst.skymap.tractBuilder.BaseTractBuilder

Public Member Functions

 __init__ (self, config)
 
 getPatchInfo (self, index, tractWcs)
 
 getPackedConfig (self, config)
 

Static Public Attributes

 ConfigClass = LegacyTractBuilderConfig
 

Protected Attributes

 _patchInnerDimensions
 
 _patchBorder
 
 _initialized
 
 _tractBBox
 

Detailed Description

Definition at line 212 of file tractBuilder.py.

Constructor & Destructor Documentation

◆ __init__()

lsst.skymap.tractBuilder.LegacyTractBuilder.__init__ ( self,
config )

Reimplemented from lsst.skymap.tractBuilder.BaseTractBuilder.

Definition at line 215 of file tractBuilder.py.

215 def __init__(self, config):
216 super().__init__(config)
217
218 self._patchInnerDimensions = geom.Extent2I(*(val
219 for val in config.patchInnerDimensions))
220 self._patchBorder = config.patchBorder
221 self._initialized = False
222

Member Function Documentation

◆ getPackedConfig()

lsst.skymap.tractBuilder.LegacyTractBuilder.getPackedConfig ( self,
config )
Get a packed config suitable for using in a sha1.

Parameters
----------
config : `lsst.skymap.BaseTractBuilderConfig`

Returns
-------
configPacked : `bytes`

Reimplemented from lsst.skymap.tractBuilder.BaseTractBuilder.

Definition at line 255 of file tractBuilder.py.

255 def getPackedConfig(self, config):
256 subConfig = config.tractBuilder[config.tractBuilder.name]
257 configPacked = struct.pack(
258 "<iiidd3sd",
259 subConfig.patchInnerDimensions[0],
260 subConfig.patchInnerDimensions[1],
261 subConfig.patchBorder,
262 config.tractOverlap,
263 config.pixelScale,
264 config.projection.encode('ascii'),
265 config.rotation
266 )
267
268 return configPacked
269
270

◆ getPatchInfo()

lsst.skymap.tractBuilder.LegacyTractBuilder.getPatchInfo ( self,
index,
tractWcs )
Return information for the specified patch.

Parameters
----------
index : `lsst.skymap.Index2D` or `~collections.abc.Iterable` of 2 `int`
    Index of patch, as Index2D or pair of ints;
    or a sequential index as returned by getSequentialPatchIndex;
    negative values are not supported.
tractWcs : `lsst.afw.geom.SkyWcs`
    WCS associated with the tract.

Returns
-------
result : `lsst.skymap.PatchInfo`
    The patch info for that index.

Raises
------
IndexError
    Raised if index is out of range.

Reimplemented from lsst.skymap.tractBuilder.BaseTractBuilder.

Definition at line 223 of file tractBuilder.py.

223 def getPatchInfo(self, index, tractWcs):
224 # This should always be initialized
225 if not self._initialized:
226 raise RuntimeError("Programmer error; this should always be initialized.")
227 if isinstance(index, Index2D):
228 _index = index
229 else:
230 if isinstance(index, numbers.Number):
231 _index = self.getPatchIndexPair(index)
232 else:
233 _index = Index2D(*index)
234 if (not 0 <= _index.x < self._numPatches.x) \
235 or (not 0 <= _index.y < self._numPatches.y):
236 raise IndexError("Patch index %s is not in range [0-%d, 0-%d]" %
237 (_index, self._numPatches.x - 1, self._numPatches.y - 1))
238 innerMin = geom.Point2I(*[_index[i] * self._patchInnerDimensions[i] for i in range(2)])
239 innerBBox = geom.Box2I(innerMin, self._patchInnerDimensions)
240 if not self._tractBBox.contains(innerBBox):
241 raise RuntimeError(
242 "Bug: patch index %s valid but inner bbox=%s not contained in tract bbox=%s" %
243 (_index, innerBBox, self._tractBBox))
244 outerBBox = geom.Box2I(innerBBox)
245 outerBBox.grow(self.getPatchBorder())
246 outerBBox.clip(self._tractBBox)
247 return PatchInfo(
248 index=_index,
249 innerBBox=innerBBox,
250 outerBBox=outerBBox,
251 sequentialIndex=self.getSequentialPatchIndexFromPair(_index),
252 tractWcs=tractWcs
253 )
254
An integer coordinate rectangle.
Definition Box.h:55

Member Data Documentation

◆ _initialized

lsst.skymap.tractBuilder.LegacyTractBuilder._initialized
protected

Definition at line 221 of file tractBuilder.py.

◆ _patchBorder

lsst.skymap.tractBuilder.LegacyTractBuilder._patchBorder
protected

Definition at line 220 of file tractBuilder.py.

◆ _patchInnerDimensions

lsst.skymap.tractBuilder.LegacyTractBuilder._patchInnerDimensions
protected

Definition at line 218 of file tractBuilder.py.

◆ _tractBBox

lsst.skymap.tractBuilder.LegacyTractBuilder._tractBBox
protected

Definition at line 243 of file tractBuilder.py.

◆ ConfigClass

lsst.skymap.tractBuilder.LegacyTractBuilder.ConfigClass = LegacyTractBuilderConfig
static

Definition at line 213 of file tractBuilder.py.


The documentation for this class was generated from the following file: