LSST Applications  21.0.0-172-gfb10e10a+18fedfabac,22.0.0+297cba6710,22.0.0+80564b0ff1,22.0.0+8d77f4f51a,22.0.0+a28f4c53b1,22.0.0+dcf3732eb2,22.0.1-1-g7d6de66+2a20fdde0d,22.0.1-1-g8e32f31+297cba6710,22.0.1-1-geca5380+7fa3b7d9b6,22.0.1-12-g44dc1dc+2a20fdde0d,22.0.1-15-g6a90155+515f58c32b,22.0.1-16-g9282f48+790f5f2caa,22.0.1-2-g92698f7+dcf3732eb2,22.0.1-2-ga9b0f51+7fa3b7d9b6,22.0.1-2-gd1925c9+bf4f0e694f,22.0.1-24-g1ad7a390+a9625a72a8,22.0.1-25-g5bf6245+3ad8ecd50b,22.0.1-25-gb120d7b+8b5510f75f,22.0.1-27-g97737f7+2a20fdde0d,22.0.1-32-gf62ce7b1+aa4237961e,22.0.1-4-g0b3f228+2a20fdde0d,22.0.1-4-g243d05b+871c1b8305,22.0.1-4-g3a563be+32dcf1063f,22.0.1-4-g44f2e3d+9e4ab0f4fa,22.0.1-42-gca6935d93+ba5e5ca3eb,22.0.1-5-g15c806e+85460ae5f3,22.0.1-5-g58711c4+611d128589,22.0.1-5-g75bb458+99c117b92f,22.0.1-6-g1c63a23+7fa3b7d9b6,22.0.1-6-g50866e6+84ff5a128b,22.0.1-6-g8d3140d+720564cf76,22.0.1-6-gd805d02+cc5644f571,22.0.1-8-ge5750ce+85460ae5f3,master-g6e05de7fdc+babf819c66,master-g99da0e417a+8d77f4f51a,w.2021.48
LSST Data Management Base Package
Public Member Functions | Public Attributes | List of all members
lsst.skymap.detail.dodecahedron.Dodecahedron Class Reference

Public Member Functions

def __init__ (self, withFacesOnPoles=False)
 
def getFaceCtrList (self)
 
def getFaceCtr (self, ind)
 
def getVertices (self, ind)
 
def getFaceInd (self, vec)
 
def getWithFacesOnPoles (self)
 

Public Attributes

 vertexVecList
 
 faceVecList
 

Detailed Description

A dodecahedron with  positions of faces and associated vertices.

Parameters
----------
withFacesOnPoles : `bool`
    If True center a face on each pole, else put a vertex on each pole.

Definition at line 9 of file dodecahedron.py.

Constructor & Destructor Documentation

◆ __init__()

def lsst.skymap.detail.dodecahedron.Dodecahedron.__init__ (   self,
  withFacesOnPoles = False 
)

Definition at line 17 of file dodecahedron.py.

17  def __init__(self, withFacesOnPoles=False):
18  self._withFacesOnPoles = bool(withFacesOnPoles)
19 
20  # Basis cartesian vectors describing the faces of a dodecahedron; the full set of vectors is obtained
21  # by choosing both signs of each nonzero component of each vector.
22  # The orientation of the resulting dodecahedron, while very convenient
23  # for specifying face vectors, is not an orientation we want so it must be rotated.
24  g = (1.0 + math.sqrt(5.0)) / 2.0
25  faceBases = (
26  (0, 1, g),
27  (1, g, 0),
28  (g, 0, 1),
29  )
30  unrotFaceVecList = _computeFullVecList(faceBases)
31  unrotVertexVecList = _computeDodecahedronVertices(unrotFaceVecList)
32 
33  if self._withFacesOnPoles:
34  # one face is centered on each pole
35  vec0, vec1 = _findClosePair(unrotFaceVecList, 0)
36  rotMat = _computeCoordTransform(vec0, vec1)
37  else:
38  # one vertex is on each pole
39  vec0, vec1 = _findClosePair(unrotVertexVecList, 0)
40  rotMat = _computeCoordTransform(vec0, vec1, vec1NegativeX=True)
41  self.vertexVecList = [numpy.dot(rotMat, unrotVertexVec) for unrotVertexVec in unrotVertexVecList]
42  unsortedFaceList = [numpy.dot(rotMat, unrotFaceVec) for unrotFaceVec in unrotFaceVecList]
43  self.faceVecList = _sortedVectorList(unsortedFaceList)
44 

Member Function Documentation

◆ getFaceCtr()

def lsst.skymap.detail.dodecahedron.Dodecahedron.getFaceCtr (   self,
  ind 
)
Return the center of the specified face.

Parameters
----------
ind : `int`
    Index of the face to look up.

Returns
-------
results : `np.ndarray`
    Face center as a unit vector.

Definition at line 55 of file dodecahedron.py.

55  def getFaceCtr(self, ind):
56  """Return the center of the specified face.
57 
58  Parameters
59  ----------
60  ind : `int`
61  Index of the face to look up.
62 
63  Returns
64  -------
65  results : `np.ndarray`
66  Face center as a unit vector.
67  """
68  return self.faceVecList[ind][:]
69 

◆ getFaceCtrList()

def lsst.skymap.detail.dodecahedron.Dodecahedron.getFaceCtrList (   self)
Return a list of face centers.

Returns
-------
results : `list` of `numpy.ndarray`
    A list of face centers (in index order); each a unit vector.

Definition at line 45 of file dodecahedron.py.

45  def getFaceCtrList(self):
46  """Return a list of face centers.
47 
48  Returns
49  -------
50  results : `list` of `numpy.ndarray`
51  A list of face centers (in index order); each a unit vector.
52  """
53  return self.faceVecList[:]
54 

◆ getFaceInd()

def lsst.skymap.detail.dodecahedron.Dodecahedron.getFaceInd (   self,
  vec 
)
Return the index of the face containing the cartesian vector.

Parameters
----------
vec : `numpy.ndarray`
    Cartesian vector (length is ignored).

Returns
-------
results : `numpy.ndarray`
    Index of face containing vec.

Definition at line 95 of file dodecahedron.py.

95  def getFaceInd(self, vec):
96  """Return the index of the face containing the cartesian vector.
97 
98  Parameters
99  ----------
100  vec : `numpy.ndarray`
101  Cartesian vector (length is ignored).
102 
103  Returns
104  -------
105  results : `numpy.ndarray`
106  Index of face containing vec.
107  """
108  return numpy.argmax(numpy.dot(self.faceVecList, vec))
109 

◆ getVertices()

def lsst.skymap.detail.dodecahedron.Dodecahedron.getVertices (   self,
  ind 
)
Return the vertices for a given face.

Parameters
----------
ind : `int`
    Face index.

Returns
-------
sortedVertexList : `list` of `numpy.ndarray`
    A list of vertices, each a unit vector.

Definition at line 70 of file dodecahedron.py.

70  def getVertices(self, ind):
71  """Return the vertices for a given face.
72 
73  Parameters
74  ----------
75  ind : `int`
76  Face index.
77 
78  Returns
79  -------
80  sortedVertexList : `list` of `numpy.ndarray`
81  A list of vertices, each a unit vector.
82  """
83  faceVec = self.getFaceCtr(ind)
84  vertexList, indList = _findCloseList(self.vertexVecList, faceVec)
85 
86  # sort vertex list about face vector (direction is random)
87  sortedVertexList = [vertexList[0]]
88  vertexList = list(vertexList[1:])
89  while len(vertexList) != 0:
90  nearVertexList, nearInd = _findCloseList(vertexList, sortedVertexList[-1])
91  sortedVertexList.append(nearVertexList[0])
92  vertexList.pop(nearInd[0])
93  return sortedVertexList
94 
daf::base::PropertyList * list
Definition: fits.cc:913

◆ getWithFacesOnPoles()

def lsst.skymap.detail.dodecahedron.Dodecahedron.getWithFacesOnPoles (   self)

Definition at line 110 of file dodecahedron.py.

110  def getWithFacesOnPoles(self):
111  return self._withFacesOnPoles
112 
113 

Member Data Documentation

◆ faceVecList

lsst.skymap.detail.dodecahedron.Dodecahedron.faceVecList

Definition at line 43 of file dodecahedron.py.

◆ vertexVecList

lsst.skymap.detail.dodecahedron.Dodecahedron.vertexVecList

Definition at line 41 of file dodecahedron.py.


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