Trixel¶
- class rubin_sim.utils.Trixel(present_htmid, present_corners)¶
Bases:
object
A trixel is a single triangle in the Hierarchical Triangular Mesh (HTM) tiling scheme. It is defined by its three corners on the unit sphere.
Instantiating this class directly is a bad idea. __init__() does nothing to ensure that the parameters you give it are self-consistent. Instead, use the trixel_from_htmid() or get_all_trixels() methods in this module to instantiate trixels.
Attributes Summary
The circle on the unit sphere that bounds this trixel.
A numpy array containing the unit vectors pointing to the corners of this trixel.
The cross product of the unit vectors defining the zeroth and first corners of this trixel.
The cross product of the unit vectors defining the first and second corners of this trixel.
The cross product of the unit vectors defining the second and zeroth corners of this trixel.
The unique integer identifying this trixel.
Return the level of subdivision for this trixel.
The zeroth child trixel of this trixel.
The first child trixel of this trixel.
The second child trixel of this trixel.
The third child trixel of this trixel.
An array of vectors needed to define the child trixels of this trixel.
Methods Summary
contains
(ra, dec)Returns True if the specified RA, Dec are inside this trixel; False if not.
contains_pt
(pt)pt is either a single Cartesian point or an array of Cartesian points (pt[0] is the zeroth point, pt[1] is the first point, etc.).
Return the RA, Dec of the center of the circle bounding this trixel (RA, Dec both in degrees)
get_child
(dex)Return a specific child trixel of this trixel.
Return a list of all of the child trixels of this trixel.
Return the angular radius in degrees of the circle bounding this trixel.
Attributes Documentation
- bounding_circle¶
The circle on the unit sphere that bounds this trixel.
See equation 4.2 of
Szalay A. et al. (2007) “Indexing the Sphere with the Hierarchical Triangular Mesh” arXiv:cs/0701164
- Returns:
- A tuple:
Zeroth element is the unit vector pointing at the center of the bounding circle
First element is the distance from the center of the unit sphere to the plane of the bounding circle (i.e. the dot product of the zeroth element with the most distant corner of the trixel).
Second element is the half angular extent of the bounding circle.
- corners¶
A numpy array containing the unit vectors pointing to the corners of this trixel. corners[0] is the zeroth corner, corners[1] is the first corner, etc.
- cross01¶
The cross product of the unit vectors defining the zeroth and first corners of this trixel.
- cross12¶
The cross product of the unit vectors defining the first and second corners of this trixel.
- cross20¶
The cross product of the unit vectors defining the second and zeroth corners of this trixel.
- htmid¶
The unique integer identifying this trixel.
- level¶
Return the level of subdivision for this trixel. A higher level means a finer subdivision of the unit sphere and smaller trixels. What we refer to as ‘level’ is denoted by ‘d’ in equation 2.5 of
Szalay A. et al. (2007) “Indexing the Sphere with the Hierarchical Triangular Mesh” arXiv:cs/0701164
For a given level == ell, there are 8*4**(ell-1) trixels in the entire unit sphere.
The htmid values of trixels with level==ell will consist of 4 + 2*(ell-1) bits
- t0¶
The zeroth child trixel of this trixel.
See Figure 2 of
Szalay A. et al. (2007) “Indexing the Sphere with the Hierarchical Triangular Mesh” arXiv:cs/0701164
- t1¶
The first child trixel of this trixel.
See Figure 2 of
Szalay A. et al. (2007) “Indexing the Sphere with the Hierarchical Triangular Mesh” arXiv:cs/0701164
- t2¶
The second child trixel of this trixel.
See Figure 2 of
Szalay A. et al. (2007) “Indexing the Sphere with the Hierarchical Triangular Mesh” arXiv:cs/0701164
- t3¶
The third child trixel of this trixel.
See Figure 2 of
Szalay A. et al. (2007) “Indexing the Sphere with the Hierarchical Triangular Mesh” arXiv:cs/0701164
- w_arr¶
An array of vectors needed to define the child trixels of this trixel. See equation (3) of
Kunszt P., Szalay A., Thakar A. (2006) in “Mining The Sky”, Banday A, Zaroubi S, Bartelmann M. eds. ESO Astrophysics Symposia httpd://www.researchgate.net/publication/226072008_The_Hierarchical_Triangular_Mesh
Methods Documentation
- contains(ra, dec)¶
Returns True if the specified RA, Dec are inside this trixel; False if not.
RA and Dec are in degrees.
- contains_pt(pt)¶
pt is either a single Cartesian point or an array of Cartesian points (pt[0] is the zeroth point, pt[1] is the first point, etc.).
Return a
bool
or array of booleans denoting whether this point(s) projected onto the unit sphere is/are contained within the current trixel.
- get_center()¶
Return the RA, Dec of the center of the circle bounding this trixel (RA, Dec both in degrees)
- get_child(dex)¶
Return a specific child trixel of this trixel.
dex is an integer in the range [0,3] denoting which child to return
See Figure 1 of
Kunszt P., Szalay A., Thakar A. (2006) in “Mining The Sky”, Banday A, Zaroubi S, Bartelmann M. eds. ESO Astrophysics Symposia https://www.researchgate.net/publication/226072008_The_Hierarchical_Triangular_Mesh
for an explanation of which trixel corresponds to whic index.
- get_children()¶
Return a list of all of the child trixels of this trixel.
- get_radius()¶
Return the angular radius in degrees of the circle bounding this trixel.