@@ -6,27 +6,95 @@ User documentation
6
6
SMOC (a.k.a MOC): Spatial coverages
7
7
***********************************
8
8
9
- Gallery of notebooks examples using SMOCs
10
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9
+ Introduction to Space-MOCs
10
+ ==========================
11
+
12
+ Space MOCs are an ensemble of HEALPix cells of mixed orders. They represent sky regions
13
+ in an approximate way. They are designed for efficient calculations between sky regions.
14
+
15
+ The coordinates for Space-MOCs are always in IRCS at epoch J2000 by definition.
16
+
17
+ Space-MOCs can represent arbitrary shapes. Common examples are an approximated cone, an
18
+ ensemble of approximated cones, or the coverage of a specific survey.
19
+
20
+ The following notebook is an introduction to manipulation of Space-MOCs with MOCPy:
11
21
12
22
.. nbgallery ::
13
23
../_collections/notebooks/00-MOCpy_introduction
14
- ../_collections/notebooks/compute_moc_borders
15
- ../_collections/notebooks/filtering_astropy_table
16
- ../_collections/notebooks/FITS-image-pixels-intersecting-MOC
17
- ../_collections/notebooks/from_astropy_table.ipynb
24
+
25
+ As you saw, Space-MOCs can be visualized with either astropy+matplotlib or with the
26
+ ipyaladin widget.
27
+
28
+ Space-MOC creation methods
29
+ ==========================
30
+
31
+ Reading a MOC from a file or from a server
32
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33
+
34
+ There are diverse ways to instantiate a MOC. A first approach is to get a MOC from a
35
+ FITS file on our disk, or from a distant server that already has a pre-calculated MOC.
36
+
37
+ .. nbgallery ::
38
+ ../_collections/notebooks/from_fits_and_intersection
39
+ ../_collections/notebooks/from_vizier_table
40
+
41
+ Calculating a MOC on the fly from a region of the sky
42
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43
+
44
+ Here is a simple example of the creation of a MOC that fully covers a polygon defined
45
+ by its vertices on the sky. The vertices are linked by great circles.
46
+
47
+ .. plot :: examples/polygon_coverage.py
48
+ :include-source:
49
+
50
+ For a more extended description on how to create MOCs from diverse shapes, you can check
51
+ the example notebooks :doc: `../_collections/notebooks/01-Creating_MOCs_from_shapes ` and
52
+ :doc: `../_collections/notebooks/02-Creating_MOCs_from_astropy_regions `.
53
+
54
+ .. nbgallery ::
18
55
../_collections/notebooks/01-Creating_MOCs_from_shapes
19
56
../_collections/notebooks/02-Creating_MOCs_from_astropy_regions
20
- ../_collections/notebooks/from_fits_and_intersection
57
+ ../_collections/notebooks/from_astropy_table.ipynb
21
58
../_collections/notebooks/from_image_with_mask
22
- ../_collections/notebooks/from_vizier_table
23
- ../_collections/notebooks/query_vizier_table
24
59
25
- Here are some code examples manipulating :py:class: `MOC ` objects.
60
+ Instantiating a MOC when we already know its HEALPix cells
61
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26
62
27
- Examples use cases
28
- ==================
63
+ This can be done with methods like :py:meth: `~mocpy.moc.MOC.from_string `,
64
+ :py:meth: `~mocpy.moc.MOC.from_healpix_cells `, :py:meth: `~mocpy.moc.MOC.from_depth29_ranges `.
65
+ A simple MOC that represents the full sky is the MOC of order 0 that contains all the 12
66
+ HEALPix cells of the order 0. Creating it from a string looks like:
29
67
68
+ .. plot :: examples/all_sky.py
69
+ :include-source:
70
+
71
+ We could also take only odd numbered cells of order 1. Let's use
72
+ :py:meth: `~mocpy.moc.MOC.from_json ` that takes a dictionary:
73
+
74
+ .. plot :: examples/odd_cells.py
75
+ :include-source:
76
+
77
+ Useful methods
78
+ ==============
79
+
80
+ Calculating a Space-MOC sky area
81
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
82
+
83
+ This example shows how to calculate the sky area of a Space-MOC.
84
+
85
+ .. plot :: examples/calculate_moc_sky_area.py
86
+ :include-source:
87
+
88
+ Other examples (operations, use-cases)
89
+ ======================================
90
+
91
+ Here are some other code examples manipulating :py:class: `MOC ` objects.
92
+
93
+ .. nbgallery ::
94
+ ../_collections/notebooks/compute_moc_borders
95
+ ../_collections/notebooks/filtering_astropy_table
96
+ ../_collections/notebooks/FITS-image-pixels-intersecting-MOC
97
+ ../_collections/notebooks/query_vizier_table
30
98
31
99
Loading and plotting the MOC of SDSS
32
100
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -38,7 +106,7 @@ This example:
38
106
39
107
1. Defining a matplotlib figure.
40
108
2. Defining an astropy WCS representing the field of view of the plot.
41
- 3. Call the :py:meth: `mocpy.moc.MOC.fill ` and :py:meth: `mocpy.moc.MOC.border ` so that mocpy plot on a matplotlib axis.
109
+ 3. Call the :py:meth: `~ mocpy.moc.MOC.fill ` and :py:meth: `~ mocpy.moc.MOC.border ` so that mocpy plot on a matplotlib axis.
42
110
4. Set the axis labels, a title, enable the grid and plot the final figure.
43
111
44
112
@@ -59,22 +127,10 @@ This example:
59
127
.. plot :: examples/logical_operations.py
60
128
:include-source:
61
129
62
- Create a MOC from a polygon
63
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
64
-
65
- This example shows how to call :py:meth: `mocpy.moc.MOC.from_polygon ` or :py:meth: `mocpy.moc.MOC.from_polygon_skycoord `.
66
-
67
- .. plot :: examples/polygon_coverage.py
68
- :include-source:
69
-
70
- For a more extended description on how to create MOCs from shapes, you can check the example notebooks
71
- :doc: `../_collections/notebooks/01-Creating_MOCs_from_shapes ` and
72
- :doc: `../_collections/notebooks/02-Creating_MOCs_from_astropy_regions `.
73
-
74
130
Get the border(s) of a MOC
75
131
~~~~~~~~~~~~~~~~~~~~~~~~~~
76
132
77
- This example shows how to call `mocpy.moc.MOC.get_boundaries `. The borders are returned as a list of `~astropy.coordinates.SkyCoord ` each defining one border.
133
+ This example shows how to call `~ mocpy.moc.MOC.get_boundaries `. The borders are returned as a list of `~astropy.coordinates.SkyCoord ` each defining one border.
78
134
In this example:
79
135
80
136
1. The sky coordinates defining the border of the MOC are projected to the pixel image system.
@@ -98,14 +154,6 @@ By definition the MOC which has 100% of chance of containing a GW is the full sk
98
154
.. plot :: examples/bayestar.py
99
155
:include-source:
100
156
101
- Calculate MOC sky area
102
- ~~~~~~~~~~~~~~~~~~~~~~
103
-
104
- This example shows how to Calculate the sky area of a MOC instance.
105
-
106
- .. plot :: examples/calculate_moc_sky_area.py
107
- :include-source:
108
-
109
157
Performing computation on the pixels of an FITS image lying in a MOC
110
158
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
111
159
0 commit comments