LSSTApplications  10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
Public Member Functions | Public Attributes | Private Member Functions | List of all members
lsst.geom.geometry.SphericalBoxPartitionMap Class Reference
Inheritance diagram for lsst.geom.geometry.SphericalBoxPartitionMap:
lsst.geom.geometry.PartitionMap

Public Member Functions

def __init__
 
def getSubStripe
 
def getStripe
 
def getSubChunk
 
def getChunk
 
def getChunkBoundingBox
 
def getSubChunkBoundingBox
 
def getChunkId
 
def getSubChunkId
 
def intersect
 
def __iter__
 
def __eq__
 
def __repr__
 

Public Attributes

 numStripes
 
 numSSPerStripe
 
 numSubStripes
 
 stripeHeight
 
 subStripeHeight
 
 numChunks
 
 numSCPerChunk
 
 subChunkWidth
 
 maxSCPerChunk
 

Private Member Functions

def _getChunkBoundingBox
 
def _getSubChunkBoundingBox
 
def _allSubChunks
 
def _processChunk
 
def _processStripe
 
def _processSubChunk
 
def _processSubStripe
 
def _subIntersect
 

Detailed Description

A simple partitioning scheme that breaks the unit sphere into fixed
height latitude angle stripes. These are in turn broken up into fixed
width longitude angle chunks (each stripe has a variable number of chunks
to account for distortion at the poles). Chunks are in turn broken up
into fixed height sub-stripes, and each sub-stripe is then divided into
fixed width sub-chunks. Again, the number of sub-chunks per sub-stripe is
variable to account for polar distortion.

Definition at line 1988 of file geometry.py.

Constructor & Destructor Documentation

def lsst.geom.geometry.SphericalBoxPartitionMap.__init__ (   self,
  numStripes,
  numSubStripesPerStripe 
)

Definition at line 1997 of file geometry.py.

1998  def __init__(self, numStripes, numSubStripesPerStripe):
1999  if (not isinstance(numStripes, (int, long)) or
2000  not isinstance(numSubStripesPerStripe, (int, long))):
2001  raise TypeError('Number of stripes and sub-stripes per stripe ' +
2002  'must be integers')
2003  if numStripes < 1 or numSubStripesPerStripe < 1:
2004  raise RuntimeError('Number of stripes and sub-stripes per ' +
2005  'stripe must be positive')
2006  self.numStripes = numStripes
2007  self.numSSPerStripe = numSubStripesPerStripe
2008  self.numSubStripes = numStripes * numSubStripesPerStripe
2009  h = 180.0 / numStripes
2010  hs = 180.0 / self.numSubStripes
2011  self.stripeHeight = h
2013  self.numChunks = [segments(i * h - 90.0, (i + 1) * h - 90.0, h)
2014  for i in xrange(numStripes)]
2015  self.numSCPerChunk = []
2016  self.subChunkWidth = []
2017  for i in xrange(self.numSubStripes):
2018  nc = self.numChunks[i / numSubStripesPerStripe]
2019  n = segments(i * hs - 90.0, (i + 1) * hs - 90.0, hs) / nc
2020  self.numSCPerChunk.append(n)
2021  w = 360.0 / (n * nc)
2022  self.subChunkWidth.append(w)
2023  self.maxSCPerChunk = max(self.numSCPerChunk)

Member Function Documentation

def lsst.geom.geometry.SphericalBoxPartitionMap.__eq__ (   self,
  other 
)

Definition at line 2374 of file geometry.py.

2375  def __eq__(self, other):
2376  if isinstance(other, SphericalBoxPartitionMap):
2377  return (self.numStripes == other.numStripes and
2378  self.numSSPerStripe == other.numSSPerStripe)
2379  return False
def lsst.geom.geometry.SphericalBoxPartitionMap.__iter__ (   self)
Returns an iterator over (chunkId, SubIterator) tuples - one for
each chunk in the partition map. Each SubIterator is an iterator over
subChunkIds for the corresponding chunk.

Definition at line 2365 of file geometry.py.

2366  def __iter__(self):
2367  """Returns an iterator over (chunkId, SubIterator) tuples - one for
2368  each chunk in the partition map. Each SubIterator is an iterator over
2369  subChunkIds for the corresponding chunk.
2370  """
2371  for s in xrange(self.numStripes):
2372  for c in xrange(self.numChunks[s]):
2373  yield (self.getChunkId(s, c), self._allSubChunks(s, False))
def lsst.geom.geometry.SphericalBoxPartitionMap.__repr__ (   self)

Definition at line 2380 of file geometry.py.

2381  def __repr__(self):
2382  return ''.join([self.__class__.__name__ , '(', repr(self.numStripes),
2383  ', ', repr(self.numSSPerStripe), ')'])
2384 
def lsst.geom.geometry.SphericalBoxPartitionMap._allSubChunks (   self,
  stripe,
  withEmptySet 
)
private

Definition at line 2156 of file geometry.py.

2157  def _allSubChunks(self, stripe, withEmptySet):
2158  assert stripe >= 0 and stripe < self.numStripes
2159  emptySet = set()
2160  for i in xrange(self.numSSPerStripe):
2161  nsc = self.numSCPerChunk[stripe * self.numSSPerStripe + i]
2162  scId = i * self.maxSCPerChunk
2163  if withEmptySet:
2164  for j in xrange(nsc): yield (scId + j, emptySet)
2165  else:
2166  for j in xrange(nsc): yield scId + j
def lsst.geom.geometry.SphericalBoxPartitionMap._getChunkBoundingBox (   self,
  stripe,
  chunk 
)
private

Definition at line 2062 of file geometry.py.

2063  def _getChunkBoundingBox(self, stripe, chunk):
2064  assert stripe >= 0 and stripe < self.numStripes
2065  assert chunk >= 0 and chunk < self.numChunks[stripe]
2066  ss = stripe * self.numSSPerStripe
2067  minPhi = ss * self.subStripeHeight - 90.0
2068  maxPhi = (ss + self.numSSPerStripe) * self.subStripeHeight - 90.0
2069  # Why all the epsilons? Because chunk bounding boxes are defined
2070  # as the union of all sub-chunk bounding boxes: minTheta and maxTheta
2071  # are not guaranteed to be identical across all the sub-stripes in
2072  # the chunk. Furthermore, the computation of the boundaries
2073  # themselves is inexact - points very slightly outside of them
2074  # could still be assigned to the corresponding chunk.
2075  if maxPhi >= 90.0 - ANGLE_EPSILON:
2076  maxPhi = 90.0
2077  else:
2078  maxPhi += ANGLE_EPSILON
2079  if minPhi > -90.0 + ANGLE_EPSILON:
2080  minPhi -= ANGLE_EPSILON
2081  nscpc = self.numSCPerChunk[ss]
2082  sc = chunk * nscpc
2083  scw = self.subChunkWidth[ss]
2084  minTheta = max(0.0, sc * scw - ANGLE_EPSILON)
2085  maxTheta = min((sc + nscpc) * scw + ANGLE_EPSILON, 360.0)
2086  # avoid range reduction in SphericalBox constructor
2087  box = SphericalBox()
2088  box.min = (minTheta, minPhi)
2089  box.max = (maxTheta, maxPhi)
2090  return box
def lsst.geom.geometry.SphericalBoxPartitionMap._getSubChunkBoundingBox (   self,
  subStripe,
  subChunk 
)
private

Definition at line 2102 of file geometry.py.

2103  def _getSubChunkBoundingBox(self, subStripe, subChunk):
2104  assert subStripe >= 0
2105  nsc = (self.numSCPerChunk[subStripe] *
2106  self.numChunks[subStripe / self.numSSPerStripe])
2107  assert subChunk >= 0 and subChunk < nsc
2108  scw = self.subChunkWidth[subStripe]
2109  minPhi = subStripe * self.subStripeHeight - 90.0
2110  maxPhi = (subStripe + 1) * self.subStripeHeight - 90.0
2111  # Why all the epsilons? Because the computation of the boundaries
2112  # themselves is inexact - points very slightly outside of them
2113  # could still be assigned to the corresponding chunk.
2114  if maxPhi >= 90.0 - ANGLE_EPSILON:
2115  maxPhi = 90.0
2116  else:
2117  maxPhi += ANGLE_EPSILON
2118  if minPhi > -90.0 + ANGLE_EPSILON:
2119  minPhi -= ANGLE_EPSILON
2120  minTheta = max(0.0, subChunk * scw - ANGLE_EPSILON)
2121  maxTheta = min((subChunk + 1) * scw + ANGLE_EPSILON, 360.0)
2122  # avoid range reduction in SphericalBox constructor
2123  box = SphericalBox()
2124  box.min = (minTheta, minPhi)
2125  box.max = (maxTheta, maxPhi)
2126  return box
def lsst.geom.geometry.SphericalBoxPartitionMap._processChunk (   self,
  minS,
  minC,
  c,
  cOverlap 
)
private

Definition at line 2167 of file geometry.py.

2168  def _processChunk(self, minS, minC, c, cOverlap):
2169  ss = minS * self.numSSPerStripe
2170  while minC < c and len(cOverlap) > 0:
2171  bbox = self._getChunkBoundingBox(minS, minC)
2172  if any(br[1].contains(bbox) for br in cOverlap):
2173  # if a constraint contains the whole chunk,
2174  # yield a fast sub-chunk iterator
2175  yield (self.getChunkId(minS, minC),
2176  self._allSubChunks(minS, True))
2177  else:
2178  yield (self.getChunkId(minS, minC),
2179  self._subIntersect(minS, minC, list(cOverlap)))
2180  # Finished processing minC - advance and remove any regions
2181  # no longer intersecting the current chunk
2182  minC += 1
2183  theta = (minC * self.numSCPerChunk[ss]) * self.subChunkWidth[ss]
2184  if theta >= 360.0 - ANGLE_EPSILON:
2185  theta = 360.0 + ANGLE_EPSILON
2186  else:
2187  theta -= ANGLE_EPSILON
2188  cOverlap.filter(lambda br: br[0].getMax()[0] < theta)
bool any(CoordinateExpr< N > const &expr)
Return true if any elements are true.
def lsst.geom.geometry.SphericalBoxPartitionMap._processStripe (   self,
  minS,
  s,
  sOverlap 
)
private

Definition at line 2189 of file geometry.py.

2190  def _processStripe(self, minS, s, sOverlap):
2191  while minS < s and len(sOverlap) > 0:
2192  # Sort stripe regions by minimum bounding box longitude angle
2193  sRegions = list(sOverlap)
2194  sRegions.sort(key=lambda x: x[0].getMin()[0])
2195  minC = self.getChunk(minS, max(0.0,
2196  sRegions[0][0].getMin()[0] - ANGLE_EPSILON))
2197  cOverlap = _SubList(sRegions)
2198  cOverlap.append(0)
2199  for j in xrange(1, len(sRegions)):
2200  c = self.getChunk(minS, max(0.0,
2201  sRegions[j][0].getMin()[0] - ANGLE_EPSILON))
2202  if c == minC:
2203  cOverlap.append(j)
2204  continue
2205  # All regions overlapping minC have been accumulated
2206  for x in self._processChunk(minS, minC, c, cOverlap):
2207  yield x
2208  minC = c
2209  cOverlap.append(j)
2210  maxC = self.numChunks[minS]
2211  for x in self._processChunk(minS, minC, maxC, cOverlap):
2212  yield x
2213  # Finished processing minS - remove any regions not
2214  # intersecting stripes greater than minS and advance
2215  minS += 1
2216  phi = (minS * self.numSSPerStripe) * self.subStripeHeight - 90.0
2217  if phi >= 90.0 - ANGLE_EPSILON:
2218  phi = 90.0 + ANGLE_EPSILON
2219  else:
2220  phi -= ANGLE_EPSILON
2221  sOverlap.filter(lambda br: br[0].getMax()[1] < phi)
def lsst.geom.geometry.SphericalBoxPartitionMap._processSubChunk (   self,
  minSS,
  minSC,
  sc,
  scOverlap 
)
private

Definition at line 2280 of file geometry.py.

2281  def _processSubChunk(self, minSS, minSC, sc, scOverlap):
2282  while minSC < sc and len(scOverlap) > 0:
2283  partial = None
2284  bbox = self._getSubChunkBoundingBox(minSS, minSC)
2285  for br in scOverlap:
2286  if br[1].contains(bbox):
2287  partial = set()
2288  break
2289  elif br[1].intersects(bbox):
2290  if partial == None:
2291  partial = set()
2292  partial.add(br[1])
2293  if partial != None:
2294  yield (self.getSubChunkId(minSS, minSC), partial)
2295  # Finished processing minSC - remove any regions not
2296  # intersecting sub-chunks > minSC and advance
2297  minSC += 1
2298  theta = minSC * self.subChunkWidth[minSS]
2299  if theta >= 360.0 - ANGLE_EPSILON:
2300  theta = 360.0 + ANGLE_EPSILON
2301  else:
2302  theta -= ANGLE_EPSILON
2303  scOverlap.filter(lambda br: br[0].getMax()[0] < theta)
def lsst.geom.geometry.SphericalBoxPartitionMap._processSubStripe (   self,
  minSS,
  ss,
  chunk,
  ssOverlap 
)
private

Definition at line 2304 of file geometry.py.

2305  def _processSubStripe(self, minSS, ss, chunk, ssOverlap):
2306  while minSS < ss and len(ssOverlap) > 0:
2307  firstSC = chunk * self.numSCPerChunk[minSS]
2308  ssRegions = list(ssOverlap)
2309  # Sort sub-stripe regions by minimum bounding box longitude
2310  ssRegions.sort(key=lambda x: x[0].getMin()[0])
2311  minSC = max(firstSC, self.getSubChunk(minSS, max(0.0,
2312  ssRegions[0][0].getMin()[0] - ANGLE_EPSILON)))
2313  scOverlap = _SubList(ssRegions)
2314  scOverlap.append(0)
2315  for j in xrange(1, len(ssRegions)):
2316  sc = max(firstSC, self.getSubChunk(minSS, max(0.0,
2317  ssRegions[j][0].getMin()[0] - ANGLE_EPSILON)))
2318  if sc == minSC:
2319  scOverlap.append(j)
2320  continue
2321  # All regions overlapping minSC have been accumulated
2322  for x in self._processSubChunk(minSS, minSC, sc, scOverlap):
2323  yield x
2324  minSC = sc
2325  scOverlap.append(j)
2326  maxSC = firstSC + self.numSCPerChunk[minSS]
2327  for x in self._processSubChunk(minSS, minSC, maxSC, scOverlap):
2328  yield x
2329  # Finished processing minSS - remove any regions not
2330  # intersecting stripes greater than minSS and advance
2331  minSS += 1
2332  phi = minSS * self.subStripeHeight - 90.0
2333  if phi >= 90.0 - ANGLE_EPSILON:
2334  phi = 90.0 + ANGLE_EPSILON
2335  else:
2336  phi -= ANGLE_EPSILON
2337  ssOverlap.filter(lambda br: br[0].getMax()[1] < phi)
def lsst.geom.geometry.SphericalBoxPartitionMap._subIntersect (   self,
  stripe,
  chunk,
  regions 
)
private
Returns an iterator over (subChunkId, Regions) tuples, where
Regions is a set of all regions that intersect with (but do not
completely contain) a particular sub-chunk.

Definition at line 2338 of file geometry.py.

2339  def _subIntersect(self, stripe, chunk, regions):
2340  """Returns an iterator over (subChunkId, Regions) tuples, where
2341  Regions is a set of all regions that intersect with (but do not
2342  completely contain) a particular sub-chunk.
2343  """
2344  # Sort regions by minimum bounding box latitude angle
2345  regions.sort(key=lambda x: x[0].getMin()[1])
2346  firstSS = stripe * self.numSSPerStripe
2347  minSS = max(firstSS, self.getSubStripe(max(-90.0,
2348  regions[0][0].getMin()[1] - ANGLE_EPSILON)))
2349  ssOverlap = _SubList(regions)
2350  ssOverlap.append(0)
2351  # Loop over regions
2352  for i in xrange(1, len(regions)):
2353  ss = max(firstSS, self.getSubStripe(max(-90.0,
2354  regions[i][0].getMin()[1] - ANGLE_EPSILON)))
2355  if ss == minSS:
2356  ssOverlap.append(i)
2357  continue
2358  for x in self._processSubStripe(minSS, ss, chunk, ssOverlap):
2359  yield x
2360  minSS = ss
2361  ssOverlap.append(i)
2362  maxSS = firstSS + self.numSSPerStripe
2363  for x in self._processSubStripe(minSS, maxSS, chunk, ssOverlap):
2364  yield x
def lsst.geom.geometry.SphericalBoxPartitionMap.getChunk (   self,
  stripe,
  theta 
)
Returns the chunk number of the chunk containing all points
in the given stripe with the given longitude angle.

Definition at line 2053 of file geometry.py.

2054  def getChunk(self, stripe, theta):
2055  """Returns the chunk number of the chunk containing all points
2056  in the given stripe with the given longitude angle.
2057  """
2058  assert stripe >= 0 and theta >= 0.0 and theta <= 360.0
2059  ss = stripe * self.numSSPerStripe
2060  sc = self.getSubChunk(ss, theta)
2061  return sc / self.numSCPerChunk[ss]
def lsst.geom.geometry.SphericalBoxPartitionMap.getChunkBoundingBox (   self,
  chunkId 
)
Returns a SphericalBox bounding the given chunk. Note that
this is a bounding box only - not an exact representation! In
particular, for a point p and a chunk C with bounding box B,
B.contains(p) == True does not imply that p is assigned to C.
However, for all points p assigned to C, B.contains(p) is True.

Definition at line 2091 of file geometry.py.

2092  def getChunkBoundingBox(self, chunkId):
2093  """Returns a SphericalBox bounding the given chunk. Note that
2094  this is a bounding box only - not an exact representation! In
2095  particular, for a point p and a chunk C with bounding box B,
2096  B.contains(p) == True does not imply that p is assigned to C.
2097  However, for all points p assigned to C, B.contains(p) is True.
2098  """
2099  s = chunkId / (self.numStripes * 2)
2100  c = chunkId - s * self.numStripes * 2
2101  return self._getChunkBoundingBox(s, c)
def lsst.geom.geometry.SphericalBoxPartitionMap.getChunkId (   self,
  stripe,
  chunk 
)
Returns the chunk ID of the chunk with the given
stripe/chunk numbers.

Definition at line 2142 of file geometry.py.

2143  def getChunkId(self, stripe, chunk):
2144  """Returns the chunk ID of the chunk with the given
2145  stripe/chunk numbers.
2146  """
2147  return stripe * self.numStripes * 2 + chunk
def lsst.geom.geometry.SphericalBoxPartitionMap.getStripe (   self,
  phi 
)
Returns the stripe number of the stripe containing all points
with the given latitude angle.

Definition at line 2034 of file geometry.py.

2035  def getStripe(self, phi):
2036  """Returns the stripe number of the stripe containing all points
2037  with the given latitude angle.
2038  """
2039  ss = self.getSubStripe(phi)
2040  return ss / self.numSSPerStripe
def lsst.geom.geometry.SphericalBoxPartitionMap.getSubChunk (   self,
  subStripe,
  theta 
)
Returns the sub-chunk number of the sub-chunk containing all points
in the given sub-stripe with the given longitude angle.

Definition at line 2041 of file geometry.py.

2042  def getSubChunk(self, subStripe, theta):
2043  """Returns the sub-chunk number of the sub-chunk containing all points
2044  in the given sub-stripe with the given longitude angle.
2045  """
2046  assert subStripe >= 0 and theta >= 0.0 and theta <= 360.0
2047  sc = int(math.floor(theta / self.subChunkWidth[subStripe]))
2048  nsc = (self.numSCPerChunk[subStripe] *
2049  self.numChunks[subStripe / self.numSSPerStripe])
2050  if sc >= nsc:
2051  sc = nsc - 1
2052  return sc
def lsst.geom.geometry.SphericalBoxPartitionMap.getSubChunkBoundingBox (   self,
  chunkId,
  subChunkId 
)
Returns a SphericalBox bounding the given sub-chunk. Note that
this is a bounding box only - not an exact representation! In
particular, for a point p and a sub-chunk SC with bounding box B,
B.contains(p) == True does not imply that p is assigned to SC.
However, for all points p assigned to SC, B.contains(p) is True.

Definition at line 2127 of file geometry.py.

2128  def getSubChunkBoundingBox(self, chunkId, subChunkId):
2129  """Returns a SphericalBox bounding the given sub-chunk. Note that
2130  this is a bounding box only - not an exact representation! In
2131  particular, for a point p and a sub-chunk SC with bounding box B,
2132  B.contains(p) == True does not imply that p is assigned to SC.
2133  However, for all points p assigned to SC, B.contains(p) is True.
2134  """
2135  s = chunkId / (self.numStripes * 2)
2136  c = chunkId - s * self.numStripes * 2
2137  ssc = subChunkId / self.maxSCPerChunk
2138  scc = subChunkId - ssc * self.maxSCPerChunk
2139  ss = s * self.numSSPerStripe + ssc
2140  sc = c * self.numSCPerChunk[ss] + scc
2141  return self._getSubChunkBoundingBox(ss, sc)
def lsst.geom.geometry.SphericalBoxPartitionMap.getSubChunkId (   self,
  subStripe,
  subChunk 
)
Returns the sub-chunk ID of the sub-chunk with the given
sub-stripe/sub-chunk numbers.

Definition at line 2148 of file geometry.py.

2149  def getSubChunkId(self, subStripe, subChunk):
2150  """Returns the sub-chunk ID of the sub-chunk with the given
2151  sub-stripe/sub-chunk numbers.
2152  """
2153  ss = (subStripe % self.numSSPerStripe) * self.maxSCPerChunk
2154  sc = (subChunk % self.numSCPerChunk[subStripe])
2155  return ss + sc
def lsst.geom.geometry.SphericalBoxPartitionMap.getSubStripe (   self,
  phi 
)
Returns the sub-stripe number of the sub-stripe containing points
with the given latitude angle.

Definition at line 2024 of file geometry.py.

2025  def getSubStripe(self, phi):
2026  """Returns the sub-stripe number of the sub-stripe containing points
2027  with the given latitude angle.
2028  """
2029  assert phi >= -90.0 and phi <= 90.0
2030  ss = int(math.floor((phi + 90.0) / self.subStripeHeight))
2031  if ss >= self.numSubStripes:
2032  ss = self.numSubStripes - 1
2033  return ss
def lsst.geom.geometry.SphericalBoxPartitionMap.intersect (   self,
  args 
)
Computes the intersection of a spherical box partitioning of the
unit sphere and one or more SphericalRegions. Results are
returned as an iterator over (chunkId, SubIterator) tuples. These
correspond to all chunks overlapping at least one input region,
and contain sub-iterators over all sub-chunks intersecting at least
one input region. The sub-iterators return (subChunkId, Regions)
tuples, where Regions is a set of the regions that intersect with
(but do not completely contain) a particular sub-chunk. Note that
Regions can be an empty set - this means that the sub-chunk
is completely contained in at least one of the input regions.

Definition at line 2222 of file geometry.py.

2223  def intersect(self, *args):
2224  """Computes the intersection of a spherical box partitioning of the
2225  unit sphere and one or more SphericalRegions. Results are
2226  returned as an iterator over (chunkId, SubIterator) tuples. These
2227  correspond to all chunks overlapping at least one input region,
2228  and contain sub-iterators over all sub-chunks intersecting at least
2229  one input region. The sub-iterators return (subChunkId, Regions)
2230  tuples, where Regions is a set of the regions that intersect with
2231  (but do not completely contain) a particular sub-chunk. Note that
2232  Regions can be an empty set - this means that the sub-chunk
2233  is completely contained in at least one of the input regions.
2234  """
2235  if len(args) == 0:
2236  return
2237  elif len(args) == 1 and not isinstance(args[0], SphericalRegion):
2238  # accept arbitrary sequences of SphericalRegion objects
2239  args = args[0]
2240  if not all(isinstance(r, SphericalRegion) for r in args):
2241  raise TypeError(
2242  'Input must consist of one or more SphericalRegion objects')
2243  # Construct list of (bounding box, region) tuples
2244  regions = []
2245  for r in args:
2246  b = r.getBoundingBox()
2247  if b.wraps():
2248  # Split boxes that wrap
2249  bMin = (0.0, b.getMin()[1])
2250  bMax = (360.0, b.getMax()[1])
2251  regions.append((SphericalBox(bMin, b.getMax()), r))
2252  # Cannot use SphericalBox constructor: 360.0 would get
2253  # range reduced to 0!
2254  b2 = SphericalBox()
2255  b2.min = b.getMin()
2256  b2.max = bMax
2257  regions.append((b2, r))
2258  else:
2259  regions.append((b, r))
2260  # Sort regions by minimum bounding box latitude angle
2261  regions.sort(key=lambda x: x[0].getMin()[1])
2262  minS = self.getStripe(
2263  max(-90.0, regions[0][0].getMin()[1] - ANGLE_EPSILON))
2264  sOverlap = _SubList(regions)
2265  sOverlap.append(0)
2266  # Loop over regions
2267  for i in xrange(1, len(regions)):
2268  s = self.getStripe(
2269  max(-90.0, regions[i][0].getMin()[1] - ANGLE_EPSILON))
2270  if s == minS:
2271  sOverlap.append(i)
2272  continue
2273  # All regions overlapping minS have been accumulated
2274  for x in self._processStripe(minS, s, sOverlap):
2275  yield x
2276  minS = s
2277  sOverlap.append(i)
2278  for x in self._processStripe(minS, self.numStripes, sOverlap):
2279  yield x
bool all(CoordinateExpr< N > const &expr)
Return true if all elements are true.

Member Data Documentation

lsst.geom.geometry.SphericalBoxPartitionMap.maxSCPerChunk

Definition at line 2022 of file geometry.py.

lsst.geom.geometry.SphericalBoxPartitionMap.numChunks

Definition at line 2012 of file geometry.py.

lsst.geom.geometry.SphericalBoxPartitionMap.numSCPerChunk

Definition at line 2014 of file geometry.py.

lsst.geom.geometry.SphericalBoxPartitionMap.numSSPerStripe

Definition at line 2006 of file geometry.py.

lsst.geom.geometry.SphericalBoxPartitionMap.numStripes

Definition at line 2005 of file geometry.py.

lsst.geom.geometry.SphericalBoxPartitionMap.numSubStripes

Definition at line 2007 of file geometry.py.

lsst.geom.geometry.SphericalBoxPartitionMap.stripeHeight

Definition at line 2010 of file geometry.py.

lsst.geom.geometry.SphericalBoxPartitionMap.subChunkWidth

Definition at line 2015 of file geometry.py.

lsst.geom.geometry.SphericalBoxPartitionMap.subStripeHeight

Definition at line 2011 of file geometry.py.


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