A spherical coordinate space bounding box.
This is similar to a bounding box in cartesian space in that
it is specified by a pair of points; however, a spherical box may
correspond to the entire unit-sphere, a spherical cap, a lune or
the traditional rectangle. Additionally, spherical boxes can span
the 0/360 degree longitude angle discontinuity.
Note that points falling exactly on spherical box edges are
considered to be inside (contained by) the box.
Definition at line 347 of file geometry.py.
def lsst.geom.geometry.SphericalBox.__init__ |
( |
|
self, |
|
|
|
args |
|
) |
| |
Creates a new spherical box. If no arguments are supplied, then
an empty box is created. If the arguments consist of a single
SphericalRegion, then a copy of its bounding box is created.
Otherwise, the arguments must consist of a pair of 2 (spherical)
or 3 (cartesian 3-vector) element coordinate tuples/lists that
specify the minimum/maximum longitude/latitude angles for the box.
Latitude angles must be within [-90, 90] degrees, and the minimum
latitude angle must be less than or equal to the maximum. If both
minimum and maximum longitude angles lie in the range [0.0, 360.0],
then the maximum can be less than the minimum. For example, a box
with min/max longitude angles of 350/10 deg spans the longitude angle
ranges [350, 360) and [0, 10]. Otherwise, the minimum must be less
than or equal to the maximum, though values can be arbitrary. If
the two are are separated by 360 degrees or more, then the box
spans longitude angles [0, 360). Otherwise, both values are range
reduced. For example, a spherical box with min/max longitude angles
specified as 350/370 deg spans longitude angle ranges [350, 360) and
[0, 10].
Definition at line 359 of file geometry.py.
362 Creates a new spherical box. If no arguments are supplied, then
363 an empty box is created. If the arguments consist of a single
364 SphericalRegion, then a copy of its bounding box is created.
365 Otherwise, the arguments must consist of a pair of 2 (spherical)
366 or 3 (cartesian 3-vector) element coordinate tuples/lists that
367 specify the minimum/maximum longitude/latitude angles for the box.
368 Latitude angles must be within [-90, 90] degrees, and the minimum
369 latitude angle must be less than or equal to the maximum. If both
370 minimum and maximum longitude angles lie in the range [0.0, 360.0],
371 then the maximum can be less than the minimum. For example, a box
372 with min/max longitude angles of 350/10 deg spans the longitude angle
373 ranges [350, 360) and [0, 10]. Otherwise, the minimum must be less
374 than or equal to the maximum, though values can be arbitrary. If
375 the two are are separated by 360 degrees or more, then the box
376 spans longitude angles [0, 360). Otherwise, both values are range
377 reduced. For example, a spherical box with min/max longitude angles
378 specified as 350/370 deg spans longitude angle ranges [350, 360) and
385 if isinstance(args[0], SphericalRegion):
387 self.
min = tuple(bbox.getMin())
388 self.
max = tuple(bbox.getMax())
395 raise TypeError(
'Expecting a spherical region, 2 points, '
396 'or a tuple/list containing 2 points')
397 if self.
min[1] > self.
max[1]:
399 'Latitude angle minimum is greater than maximum')
400 if (self.
max[0] < self.
min[0]
and
401 (self.
max[0] < 0.0
or self.
min[0] > 360.0)):
403 'Longitude angle minimum is greater than maximum')
405 if self.
max[0] - self.
min[0] >= 360.0:
406 self.
min = (0.0, self.
min[1])
407 self.
max = (360.0, self.
max[1])