LSSTApplications
10.0-2-g4f67435,11.0.rc2+1,11.0.rc2+12,11.0.rc2+3,11.0.rc2+4,11.0.rc2+5,11.0.rc2+6,11.0.rc2+7,11.0.rc2+8
LSSTDataManagementBasePackage
|
Classes | |
class | SphericalRegion |
class | SphericalBox |
class | SphericalCircle |
class | SphericalEllipse |
class | SphericalConvexPolygon |
class | PartitionMap |
class | _SubList |
class | SphericalBoxPartitionMap |
Functions | |
def | isinf |
def | dot |
def | cross |
def | invScale |
def | normalize |
def | sphericalCoords |
def | cartesianUnitVector |
def | sphericalAngularSep |
def | clampPhi |
def | reduceTheta |
def | northEast |
def | alpha |
def | maxAlpha |
def | cartesianAngularSep |
def | minEdgeSep |
def | minPhiEdgeSep |
def | minThetaEdgeSep |
def | centroid |
def | between |
def | segments |
def | _partition |
def | _medianOfN |
def | _medianOfMedians |
def | median |
def | _prune |
def | _vrange |
def | _gh |
def | _feasible2D |
def | _feasible1D |
def | hemispherical |
def | convex |
def | convexHull |
Variables | |
float | ARCSEC_PER_DEG = 3600.0 |
float | DEG_PER_ARCSEC = 1.0 |
float | ANGLE_EPSILON = 0.001 |
float | POLE_EPSILON = 1.0 |
float | COS_MAX = 1.0 |
int | CROSS_N2MIN = 2 |
tuple | SIN_MIN = math.sqrt(CROSS_N2MIN) |
tuple | INF = float('inf') |
tuple | NEG_INF = float('-inf') |
MAX_FLOAT = float_info.max | |
MIN_FLOAT = float_info.min | |
EPSILON = float_info.epsilon | |
isinf = math.isinf | |
|
private |
Definition at line 1672 of file geometry.py.
|
private |
Definition at line 1601 of file geometry.py.
|
private |
Definition at line 1583 of file geometry.py.
|
private |
Returns the "median of medians" for an array. This primitive is used for pivot selection in the median finding algorithm.
Definition at line 1482 of file geometry.py.
|
private |
Finds the median of n consecutive elements in an array starting at index i (efficient for small n). The index of the median element is returned.
Definition at line 1460 of file geometry.py.
|
private |
Partitions an array around the pivot value at index i, returning the new index of the pivot value.
Definition at line 1443 of file geometry.py.
|
private |
Removes redundant constraints and reports intersection points of non-redundant pairs. The constraint list is modified in place.
Definition at line 1528 of file geometry.py.
|
private |
Definition at line 1570 of file geometry.py.
def lsst.geom.geometry.alpha | ( | r, | |
centerPhi, | |||
phi | |||
) |
Returns the longitude angle alpha of the intersections (alpha, phi), (-alpha, phi) of the circle centered on (0, centerPhi) with radius r and the plane z = sin(phi). If there is no intersection, None is returned.
Definition at line 206 of file geometry.py.
def lsst.geom.geometry.between | ( | p, | |
n, | |||
v1, | |||
v2 | |||
) |
Tests whether p lies on the shortest great circle arc from cartesian unit vectors v1 to v2, assuming that p is a unit vector on the plane defined by the origin, v1 and v2.
Definition at line 306 of file geometry.py.
def lsst.geom.geometry.cartesianAngularSep | ( | v1, | |
v2 | |||
) |
Returns the angular separation in degrees between points v1 and v2, which must both be specified as cartesian 3-vectors.
Definition at line 242 of file geometry.py.
def lsst.geom.geometry.cartesianUnitVector | ( | args | ) |
Returns a unit cartesian 3-vector corresponding to the input coordinates, which can be spherical or 3D cartesian. The 2 (spherical) or 3 (cartesian 3-vector) input coordinates can either be passed individually or as a tuple/list, and can be of any type convertible to a float.
Definition at line 130 of file geometry.py.
def lsst.geom.geometry.centroid | ( | vertices | ) |
Computes the centroid of a set of vertices (which must be passed in as a list of cartesian unit vectors) on the unit sphere.
Definition at line 294 of file geometry.py.
def lsst.geom.geometry.clampPhi | ( | phi | ) |
Clamps the input latitude angle phi to [-90.0, 90.0] deg.
Definition at line 171 of file geometry.py.
def lsst.geom.geometry.convex | ( | vertices | ) |
Tests whether an ordered list of vertices (which must be specified as cartesian unit vectors) form a spherical convex polygon and determines their winding order. Returns a 2-tuple as follows: (True, True): The vertex list forms a spherical convex polygon and is in counter-clockwise order when viewed from outside the unit sphere in a right handed coordinate system. (True, False): The vertex list forms a spherical convex polygon and is in in clockwise order. (False, msg): The vertex list does not form a spherical convex polygon - msg is a string describing why the test failed. The algorithm completes in O(n) time, where n is the number of input vertices.
Definition at line 1732 of file geometry.py.
def lsst.geom.geometry.convexHull | ( | points | ) |
Computes the convex hull (a spherical convex polygon) of an unordered list of points on the unit sphere, which must be passed in as cartesian unit vectors. The algorithm takes O(n log n) time, where n is the number of points.
Definition at line 1802 of file geometry.py.
def lsst.geom.geometry.cross | ( | v1, | |
v2 | |||
) |
Returns the cross product of cartesian 3-vectors v1 and v2.
Definition at line 78 of file geometry.py.
def lsst.geom.geometry.dot | ( | v1, | |
v2 | |||
) |
Returns the dot product of cartesian 3-vectors v1 and v2.
Definition at line 73 of file geometry.py.
def lsst.geom.geometry.hemispherical | ( | points | ) |
Tests whether a set of points is hemispherical, i.e. whether a plane exists such that all points are strictly on one side of the plane. The algorithm used is Megiddo's algorithm for linear programming in R2 and has run-time O(n), where n is the number of points. Points must be passed in as a list of cartesian unit vectors.
Definition at line 1690 of file geometry.py.
def lsst.geom.geometry.invScale | ( | v, | |
s | |||
) |
Returns a copy of the cartesian 3-vector v scaled by 1 / s.
Definition at line 85 of file geometry.py.
def lsst.geom.geometry.isinf | ( | x | ) |
Definition at line 68 of file geometry.py.
def lsst.geom.geometry.maxAlpha | ( | r, | |
centerPhi | |||
) |
Computes alpha, the extent in longitude angle [-alpha, alpha] of the circle with radius r and center (0, centerPhi) on the unit sphere. Both r and centerPhi are assumed to be in units of degrees. centerPhi is clamped to lie in the range [-90,90] and r must lie in the range [0, 90].
Definition at line 223 of file geometry.py.
def lsst.geom.geometry.median | ( | array | ) |
Finds the median element of the given array in linear time.
Definition at line 1500 of file geometry.py.
def lsst.geom.geometry.minEdgeSep | ( | p, | |
n, | |||
v1, | |||
v2 | |||
) |
Returns the minimum angular separation in degrees between p and points on the great circle edge with plane normal n and vertices v1, v2. All inputs must be unit cartesian 3-vectors.
Definition at line 253 of file geometry.py.
def lsst.geom.geometry.minPhiEdgeSep | ( | p, | |
phi, | |||
minTheta, | |||
maxTheta | |||
) |
Returns the minimum angular separation in degrees between p and points on the small circle edge with constant latitude angle phi and vertices (minTheta, phi), (maxTheta, phi). p must be in spherical coordinates.
Definition at line 265 of file geometry.py.
def lsst.geom.geometry.minThetaEdgeSep | ( | p, | |
theta, | |||
minPhi, | |||
maxPhi | |||
) |
Returns the minimum angular separation in degrees between p and points on the great circle edge with constant longitude angle theta and vertices (theta, minPhi), (theta, maxPhi). p must be a unit cartesian 3-vector.
Definition at line 280 of file geometry.py.
def lsst.geom.geometry.normalize | ( | v | ) |
def lsst.geom.geometry.northEast | ( | v | ) |
Returns unit N,E basis vectors for a point v, which must be a cartesian 3-vector.
Definition at line 190 of file geometry.py.
def lsst.geom.geometry.reduceTheta | ( | theta | ) |
Range reduces the given longitude angle to lie in the range [0.0, 360.0).
Definition at line 180 of file geometry.py.
def lsst.geom.geometry.segments | ( | phiMin, | |
phiMax, | |||
width | |||
) |
Computes the number of segments to divide the given latitude angle range [phiMin, phiMax] (degrees) into. Two points within the range separated by at least one segment are guaranteed to have angular separation of at least width degrees.
Definition at line 315 of file geometry.py.
def lsst.geom.geometry.sphericalAngularSep | ( | p1, | |
p2 | |||
) |
Returns the angular separation in degrees between points p1 and p2, which must both be specified in spherical coordinates. The implementation uses the halversine distance formula.
Definition at line 157 of file geometry.py.
def lsst.geom.geometry.sphericalCoords | ( | args | ) |
Returns spherical coordinates in degrees for the input coordinates, which can be spherical or 3D cartesian. The 2 (spherical) or 3 (cartesian 3-vector) inputs can be passed either individually or as a tuple/list, and can be of any type convertible to a float.
Definition at line 98 of file geometry.py.
float lsst.geom.geometry.ANGLE_EPSILON = 0.001 |
Definition at line 32 of file geometry.py.
float lsst.geom.geometry.ARCSEC_PER_DEG = 3600.0 |
Definition at line 28 of file geometry.py.
float lsst.geom.geometry.COS_MAX = 1.0 |
Definition at line 39 of file geometry.py.
int lsst.geom.geometry.CROSS_N2MIN = 2 |
Definition at line 43 of file geometry.py.
float lsst.geom.geometry.DEG_PER_ARCSEC = 1.0 |
Definition at line 29 of file geometry.py.
float lsst.geom.geometry.EPSILON = float_info.epsilon |
Definition at line 57 of file geometry.py.
tuple lsst.geom.geometry.INF = float('inf') |
Definition at line 50 of file geometry.py.
lsst.geom.geometry.isinf = math.isinf |
Definition at line 66 of file geometry.py.
float lsst.geom.geometry.MAX_FLOAT = float_info.max |
Definition at line 55 of file geometry.py.
float lsst.geom.geometry.MIN_FLOAT = float_info.min |
Definition at line 56 of file geometry.py.
tuple lsst.geom.geometry.NEG_INF = float('-inf') |
Definition at line 51 of file geometry.py.
float lsst.geom.geometry.POLE_EPSILON = 1.0 |
Definition at line 35 of file geometry.py.
tuple lsst.geom.geometry.SIN_MIN = math.sqrt(CROSS_N2MIN) |
Definition at line 47 of file geometry.py.