LSSTApplications  12.1-5-gbdcc3ab,15.0+10,15.0+19,15.0-1-g19261fa+10,15.0-1-g60afb23+19,15.0-1-g615e0bb+11,15.0-1-g6668b0b+6,15.0-1-g788a293+19,15.0-1-ga91101e+19,15.0-1-gae1598d+9,15.0-1-gd076f1f+17,15.0-1-gdf18595+3,15.0-1-gf4f1c34+9,15.0-10-g113cadf7+2,15.0-11-g5674e3b,15.0-2-g100d730+12,15.0-2-g20c4630+8,15.0-2-g35685a8+15,15.0-2-g5dfaa72+8,15.0-2-gf38729e+14,15.0-24-g02ed2a30c+2,15.0-3-g11fe1a0+3,15.0-3-g130a88a+2,15.0-3-g707930d+1,15.0-3-g9103c06+9,15.0-3-ga03b4ca+26,15.0-3-gaec6799+6,15.0-4-g32c2b40+2,15.0-4-g535e784+3,15.0-4-g654b129+17,15.0-5-g23e394c+7,15.0-5-g54bfcd9+2,15.0-5-gb31927c,15.0-6-g4418537+2,15.0-7-g0c26201,15.0-7-g6bb3a066+2,15.0-9-g5661f8f+4,w.2018.18
LSSTDataManagementBasePackage
Public Member Functions | Public Attributes | List of all members
lsst.geom.geometry.SphericalEllipse Class Reference
Inheritance diagram for lsst.geom.geometry.SphericalEllipse:
lsst.geom.geometry.SphericalRegion

Public Member Functions

def __init__ (self, center, semiMajorAxisLength, semiMinorAxisLength, majorAxisAngle)
 
def getBoundingBox (self)
 
def getBoundingCircle (self)
 
def getInnerCircle (self)
 
def getCenter (self)
 
def getMajorAxisAngle (self)
 
def getSemiMajorAxisLength (self)
 
def getSemiMinorAxisLength (self)
 
def contains (self, pointOrRegion)
 
def intersects (self, pointOrRegion)
 
def __repr__ (self)
 
def __eq__ (self, other)
 
def __hash__ (self)
 

Public Attributes

 center
 
 semiMajorAxisLength
 
 semiMinorAxisLength
 
 majorAxisAngle
 
 boundingCircle
 
 innerCircle
 

Detailed Description

An ellipse on the unit sphere. This is a standard 2D cartesian
ellipse defined on the plane tangent to the unit sphere at the ellipse
center and then orthographically projected onto the surface of the
unit sphere.

Definition at line 962 of file geometry.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.geom.geometry.SphericalEllipse.__init__ (   self,
  center,
  semiMajorAxisLength,
  semiMinorAxisLength,
  majorAxisAngle 
)

Definition at line 970 of file geometry.py.

970  semiMajorAxisLength, semiMinorAxisLength, majorAxisAngle):
971  self.center = sphericalCoords(center)
972  self.semiMajorAxisLength = float(semiMajorAxisLength)
973  self.semiMinorAxisLength = float(semiMinorAxisLength)
974  a = math.fmod(float(majorAxisAngle), 180.0)
975  if a < 0.0:
976  a += 180.0
977  self.majorAxisAngle = a
978  self.boundingCircle = None
979  self.innerCircle = None
980  if self.semiMinorAxisLength < 0.0:
981  raise RuntimeError('Negative semi-minor axis length')
982  if self.semiMajorAxisLength < self.semiMinorAxisLength:
983  raise RuntimeError(
984  'Semi-major axis length is less than semi-minor axis length')
985  # large spherical ellipses don't make much sense
986  if self.semiMajorAxisLength > 10.0 * ARCSEC_PER_DEG:
987  raise RuntimeError(
988  'Semi-major axis length must be less than or equal to 10 deg')
989  self.center = (reduceTheta(self.center[0]), self.center[1])
990 
def sphericalCoords(args)
Definition: geometry.py:108
def reduceTheta(theta)
Definition: geometry.py:194

Member Function Documentation

◆ __eq__()

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

Definition at line 1098 of file geometry.py.

1098  def __eq__(self, other):
1099  if isinstance(other, SphericalEllipse):
1100  return (self.center == other.center and
1101  self.semiMajorAxisLength == other.semiMajorAxisLength and
1102  self.semiMinorAxisLength == other.semiMinorAxisLength and
1103  self.majorAxisAngle == other.majorAxisAngle)
1104  return False
1105 

◆ __hash__()

def lsst.geom.geometry.SphericalEllipse.__hash__ (   self)

Definition at line 1106 of file geometry.py.

1106  def __hash__(self):
1107  return hash((self.center, self.semiMajorAxisLength, self.semiMinorAxisLength, self.majorAxisAngle))
1108 
1109 

◆ __repr__()

def lsst.geom.geometry.SphericalEllipse.__repr__ (   self)
Returns a string representation of this ellipse.

Definition at line 1089 of file geometry.py.

1089  def __repr__(self):
1090  """Returns a string representation of this ellipse.
1091  """
1092  return ''.join([
1093  self.__class__.__name__, '(', repr(self.center), ', ',
1094  repr(self.semiMajorAxisLength), ', ',
1095  repr(self.semiMinorAxisLength), ', ',
1096  repr(self.majorAxisAngle), ')'])
1097 

◆ contains()

def lsst.geom.geometry.SphericalEllipse.contains (   self,
  pointOrRegion 
)
Returns True if the specified point or spherical region is
completely contained in this ellipse. The implementation is
conservative in the sense that False may be returned for a region
that really is contained by this ellipse.

Definition at line 1065 of file geometry.py.

1065  def contains(self, pointOrRegion):
1066  """Returns True if the specified point or spherical region is
1067  completely contained in this ellipse. The implementation is
1068  conservative in the sense that False may be returned for a region
1069  that really is contained by this ellipse.
1070  """
1071  if isinstance(pointOrRegion, (tuple, list)):
1072  v = cartesianUnitVector(pointOrRegion)
1073  return self._containsPoint(v)
1074  else:
1075  return self.getInnerCircle().contains(pointOrRegion)
1076 
bool contains(VertexIterator const begin, VertexIterator const end, UnitVector3d const &v)
def cartesianUnitVector(args)
Definition: geometry.py:141

◆ getBoundingBox()

def lsst.geom.geometry.SphericalEllipse.getBoundingBox (   self)
Returns a bounding box for this spherical ellipse. Note that at
present this is conservative: a bounding box for the circle C with
radius equal to the semi-major axis length of this ellipse is returned.

Definition at line 991 of file geometry.py.

991  def getBoundingBox(self):
992  """Returns a bounding box for this spherical ellipse. Note that at
993  present this is conservative: a bounding box for the circle C with
994  radius equal to the semi-major axis length of this ellipse is returned.
995  """
996  return self.getBoundingCircle().getBoundingBox()
997 

◆ getBoundingCircle()

def lsst.geom.geometry.SphericalEllipse.getBoundingCircle (   self)
Returns a bounding circle for this spherical ellipse. This is
a circle with the same center as this ellipse and with radius
equal to the arcsine of the semi-major axis length.

Definition at line 998 of file geometry.py.

998  def getBoundingCircle(self):
999  """Returns a bounding circle for this spherical ellipse. This is
1000  a circle with the same center as this ellipse and with radius
1001  equal to the arcsine of the semi-major axis length.
1002  """
1003  if self.boundingCircle is None:
1004  r = math.degrees(math.asin(math.radians(
1005  DEG_PER_ARCSEC * self.semiMajorAxisLength)))
1006  self.boundingCircle = SphericalCircle(self.center, r)
1007  return self.boundingCircle
1008 

◆ getCenter()

def lsst.geom.geometry.SphericalEllipse.getCenter (   self)
Returns an (ra, dec) 2-tuple of floats corresponding to the center
of this ellipse.

Definition at line 1019 of file geometry.py.

1019  def getCenter(self):
1020  """Returns an (ra, dec) 2-tuple of floats corresponding to the center
1021  of this ellipse.
1022  """
1023  return self.center
1024 

◆ getInnerCircle()

def lsst.geom.geometry.SphericalEllipse.getInnerCircle (   self)
Returns the circle of maximum radius having the same center as
this ellipse and which is completely contained in the ellipse.

Definition at line 1009 of file geometry.py.

1009  def getInnerCircle(self):
1010  """Returns the circle of maximum radius having the same center as
1011  this ellipse and which is completely contained in the ellipse.
1012  """
1013  if self.innerCircle is None:
1014  r = math.degrees(math.asin(math.radians(
1015  DEG_PER_ARCSEC * self.semiMinorAxisLength)))
1016  self.innerCircle = SphericalCircle(self.center, r)
1017  return self.innerCircle
1018 

◆ getMajorAxisAngle()

def lsst.geom.geometry.SphericalEllipse.getMajorAxisAngle (   self)
Return the major axis angle (east of north, in degrees) for this
ellipse.

Definition at line 1025 of file geometry.py.

1025  def getMajorAxisAngle(self):
1026  """Return the major axis angle (east of north, in degrees) for this
1027  ellipse.
1028  """
1029  return self.majorAxisAngle
1030 

◆ getSemiMajorAxisLength()

def lsst.geom.geometry.SphericalEllipse.getSemiMajorAxisLength (   self)
Returns the semi-major axis length of this ellipse. Units
are in arcsec since ellipses are typically small.

Definition at line 1031 of file geometry.py.

1031  def getSemiMajorAxisLength(self):
1032  """Returns the semi-major axis length of this ellipse. Units
1033  are in arcsec since ellipses are typically small.
1034  """
1035  return self.semiMajorAxisLength
1036 

◆ getSemiMinorAxisLength()

def lsst.geom.geometry.SphericalEllipse.getSemiMinorAxisLength (   self)
Returns the semi-minor axis length of this ellipse. Units
are in arcsec since ellipses are typically small.

Definition at line 1037 of file geometry.py.

1037  def getSemiMinorAxisLength(self):
1038  """Returns the semi-minor axis length of this ellipse. Units
1039  are in arcsec since ellipses are typically small.
1040  """
1041  return self.semiMinorAxisLength
1042 

◆ intersects()

def lsst.geom.geometry.SphericalEllipse.intersects (   self,
  pointOrRegion 
)
Returns True if the specified point or spherical region intersects
this ellipse. The implementation is conservative in the sense that
True may be returned for a region that does not intersect this
ellipse.

Definition at line 1077 of file geometry.py.

1077  def intersects(self, pointOrRegion):
1078  """Returns True if the specified point or spherical region intersects
1079  this ellipse. The implementation is conservative in the sense that
1080  True may be returned for a region that does not intersect this
1081  ellipse.
1082  """
1083  if isinstance(pointOrRegion, (tuple, list)):
1084  v = cartesianUnitVector(pointOrRegion)
1085  return self._containsPoint(v)
1086  else:
1087  return self.getBoundingCircle().intersects(pointOrRegion)
1088 
def cartesianUnitVector(args)
Definition: geometry.py:141

Member Data Documentation

◆ boundingCircle

lsst.geom.geometry.SphericalEllipse.boundingCircle

Definition at line 978 of file geometry.py.

◆ center

lsst.geom.geometry.SphericalEllipse.center

Definition at line 971 of file geometry.py.

◆ innerCircle

lsst.geom.geometry.SphericalEllipse.innerCircle

Definition at line 979 of file geometry.py.

◆ majorAxisAngle

lsst.geom.geometry.SphericalEllipse.majorAxisAngle

Definition at line 977 of file geometry.py.

◆ semiMajorAxisLength

lsst.geom.geometry.SphericalEllipse.semiMajorAxisLength

Definition at line 972 of file geometry.py.

◆ semiMinorAxisLength

lsst.geom.geometry.SphericalEllipse.semiMinorAxisLength

Definition at line 973 of file geometry.py.


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