geodesic#

m4opt.skygrid.geodesic(area, base='icosahedron', class_='I')[source] [edit on github]#

Generate a geodesic polyhedron with the fewest vertices >= n.

Parameters:
  • area (Annotated[Quantity, PhysicalType('solid angle')]) – The average area per tile in any Astropy solid angle units: for example, 10 * astropy.units.deg**2 or 0.1 * astropy.units.steradian.

  • base (Literal['icosahedron', 'octahedron', 'tetrahedron'] | str) – The base polyhedron of the tessellation.

  • class – The class of the geodesic polyhedron, which constrains the allowed values of the number of points. Class III permits the most freedom.

  • class_ (Literal['I', 'II', 'III'] | str)

Returns:

The coordinates of the vertices of the geodesic polyhedron.

References

https://en.wikipedia.org/wiki/Geodesic_polyhedron

Examples

from astropy import units as u
from matplotlib import pyplot as plt
import ligo.skymap.plot
import numpy as np

from m4opt import skygrid

n_vertices_target = 1024
vertices = skygrid.geodesic(4 * np.pi * u.sr / n_vertices_target)
n_vertices = len(vertices)

ax = plt.axes(projection='astro globe', center='0d 25d')
plt.suptitle('Class I')
ax.set_title(f'{n_vertices} vertices (goal was {n_vertices_target})')
ax.plot_coord(vertices, '.')
ax.grid()

(Source code)

../_images/m4opt-skygrid-geodesic-1.svg
vertices = skygrid.geodesic(4 * np.pi * u.sr / n_vertices_target,
                            class_='II')
n_vertices = len(vertices)

ax = plt.axes(projection='astro globe', center='0d 25d')
plt.suptitle('Class II')
ax.set_title(f'{n_vertices} vertices (goal was {n_vertices_target})')
ax.plot_coord(vertices, '.')
ax.grid()

(Source code)

../_images/m4opt-skygrid-geodesic-2.svg
vertices = skygrid.geodesic(4 * np.pi * u.sr / n_vertices_target,
                                class_='III')
n_vertices = len(vertices)

ax = plt.axes(projection='astro globe', center='0d 25d')
plt.suptitle('Class III')
ax.set_title(f'{n_vertices} vertices (goal was {n_vertices_target})')
ax.plot_coord(vertices, '.')
ax.grid()

(Source code)

../_images/m4opt-skygrid-geodesic-3.svg