LSST Applications g0d97872fb5+4fd969bb9d,g1653933729+34a971ddd9,g28da252d5a+072f89fe25,g2bbee38e9b+a99b0ab4cd,g2bc492864f+a99b0ab4cd,g2ca4be77d2+c0e3b27cd8,g2cdde0e794+704103fe75,g3156d2b45e+6e87dc994a,g347aa1857d+a99b0ab4cd,g35bb328faa+34a971ddd9,g3a166c0a6a+a99b0ab4cd,g3e281a1b8c+8ec26ec694,g4005a62e65+ba0306790b,g414038480c+9ed5ed841a,g569e0e2b34+cb4faa46ad,g5a97de2502+520531a62c,g717e5f8c0f+29153700a5,g7ede599f99+367733290c,g80478fca09+17051a22cc,g82479be7b0+f2f1ea0a87,g858d7b2824+29153700a5,g8b782ad322+29153700a5,g8cd86fa7b1+05420e7f7d,g9125e01d80+34a971ddd9,ga5288a1d22+e7f674aaf3,gae0086650b+34a971ddd9,gae74b0b5c6+45ef5cdc51,gb58c049af0+ace264a4f2,gc28159a63d+a99b0ab4cd,gcf0d15dbbd+8051a81198,gda6a2b7d83+8051a81198,gdaeeff99f8+7774323b41,gdf4d240d4a+34a971ddd9,ge2409df99d+cb167bac99,ge33fd446bb+29153700a5,ge79ae78c31+a99b0ab4cd,gf0baf85859+890af219f9,gf5289d68f6+9faa5c5784,w.2024.36
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: