Skip to content

Commit

Permalink
example calculate moc sky area
Browse files Browse the repository at this point in the history
  • Loading branch information
and-santos committed May 29, 2024
1 parent a32c9a1 commit fe08b6b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docs/examples/calculate_moc_sky_area.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import numpy as np
import astropy.units as u
from mocpy import MOC

ALL_SKY = 4 * np.pi * u.steradian
moc = MOC.from_string("0/0-11") # any other MOC instance will work
area = moc.sky_fraction * ALL_SKY
area = area.to(u.deg**2).value
8 changes: 8 additions & 0 deletions docs/examples/user_documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ By definition the MOC which has 100% of chance of containing a GW is the full sk
.. plot:: examples/bayestar.py
:include-source:

Calculate MOC sky area
~~~~~~~~~~~~~~~~~~~~~~

This example shows how to Calculate the sky area of a MOC instance.

.. plot:: examples/calculate_moc_sky_area.py
:include-source:

Performing computation on the pixels of an FITS image lying in a MOC
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Expand Down

0 comments on commit fe08b6b

Please sign in to comment.