Skip to content

Commit cd17800

Browse files
authored
Expand margin generation explanation. Use anon references. (#485)
1 parent 201397c commit cd17800

8 files changed

+63
-29
lines changed

docs/catalogs/arguments.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This page discusses a few topics around setting up a catalog pipeline.
55

66
Once your catalog has been imported, you can verify and inspect the metadata,
77
either with the :doc:`Verification Pipeline </guide/verification>`, or methods
8-
described in the `Manual catalog verification notebook <https://docs.lsdb.io/en/stable/tutorials/manual_verification.html>`_
8+
described in the `Manual catalog verification notebook <https://docs.lsdb.io/en/stable/tutorials/manual_verification.html>`__
99

1010
At a minimum, you need arguments that include where to find the input files,
1111
the column names for RA, and DEC, and where to put the output files.

docs/guide/contact.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ making our products better, or pretty much anything else, reach out!
1111
* Start a new github discussion
1212
* https://github.com/astronomy-commons/hats-import/discussions/new/choose
1313
* If you're on LSSTC slack, so are we!
14-
* `#lincc-frameworks-qa <https://lsstc.slack.com/archives/C062LG1AK1S>`_
15-
* `#lincc-frameworks-lsdb <https://lsstc.slack.com/archives/C04610PQW9F>`_
14+
* `#lincc-frameworks-qa <https://lsstc.slack.com/archives/C062LG1AK1S>`__
15+
* `#lincc-frameworks-lsdb <https://lsstc.slack.com/archives/C04610PQW9F>`__
1616
* Join the working group, where we discuss HATS standardization and early results
17-
* Google group: `[email protected] <https://groups.google.com/g/hipscat-wg>`_
17+
* Google group: `[email protected] <https://groups.google.com/g/hipscat-wg>`__
1818
* You can listen in to demo meetings, or ask questions during co-working sessions.
1919
Events are published on a google calendar, embedded below.
2020
* Key:
@@ -34,4 +34,4 @@ making our products better, or pretty much anything else, reach out!
3434

3535
However you reach out, we want to make sure that any discourse is open and
3636
inclusive, and we ask that everyone involved read and adhere to the
37-
`LINCC Frameworks Code of Conduct <https://lsstdiscoveryalliance.org/programs/lincc-frameworks/code-conduct/>`_
37+
`LINCC Frameworks Code of Conduct <https://lsstdiscoveryalliance.org/programs/lincc-frameworks/code-conduct/>`__

docs/guide/contributing.rst

+9-9
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ HATS, hats-import, and LSDB are primarily written and maintained by LINCC Framew
55
would love to turn it over to the open-source scientific community!! We want to
66
make sure that any discourse is open and inclusive, and we ask that everyone
77
involved read and adhere to the
8-
`LINCC Frameworks Code of Conduct <https://lsstdiscoveryalliance.org/programs/lincc-frameworks/code-conduct/>`_
8+
`LINCC Frameworks Code of Conduct <https://lsstdiscoveryalliance.org/programs/lincc-frameworks/code-conduct/>`__
99

1010
Installation from Source
1111
------------------------
@@ -47,21 +47,21 @@ by creating a new GitHub issue.
4747
Note that you may need to make changes in multiple repos to fully implement new
4848
features or bug fixes! See related projects:
4949

50-
* HATS (`on GitHub <https://github.com/astronomy-commons/hats>`_
51-
and `on ReadTheDocs <https://hats.readthedocs.io/en/stable/>`_)
52-
* LSDB (`on GitHub <https://github.com/astronomy-commons/lsdb>`_
53-
and `on ReadTheDocs <https://docs.lsdb.io>`_)
50+
* HATS (`on GitHub <https://github.com/astronomy-commons/hats>`__
51+
and `on ReadTheDocs <https://hats.readthedocs.io/en/stable/>`__)
52+
* LSDB (`on GitHub <https://github.com/astronomy-commons/lsdb>`__
53+
and `on ReadTheDocs <https://docs.lsdb.io>`__)
5454

5555
Fork the repository
5656
-------------------------------------------------------------------------------
5757

58-
Contributing to hats-import requires you to `fork <https://github.com/astronomy-commons/hats-import/fork>`_
58+
Contributing to hats-import requires you to `fork <https://github.com/astronomy-commons/hats-import/fork>`__
5959
the GitHub repository. The next steps assume the creation of branches and PRs are performed from your fork.
6060

6161
.. note::
6262

6363
If you are (or expect to be) a frequent contributor, you should consider requesting
64-
access to the `hats-friends <https://github.com/orgs/astronomy-commons/teams/hats-friends>`_
64+
access to the `hats-friends <https://github.com/orgs/astronomy-commons/teams/hats-friends>`__
6565
working group. Members of this GitHub group should be able to create branches and PRs directly
6666
on LSDB, hats and hats-import, without the need of a fork.
6767

@@ -70,7 +70,7 @@ Testing
7070

7171
We use ``pytest`` as our preferred unit test runner engine, in keeping with
7272
LSST DM style guide. We make heavy use of
73-
`pytest fixtures <https://docs.pytest.org/en/7.1.x/explanation/fixtures.html#about-fixtures>`_,
73+
`pytest fixtures <https://docs.pytest.org/en/7.1.x/explanation/fixtures.html#about-fixtures>`__,
7474
which set up various resources used for unit testing, or provide consistent
7575
paths. These are defined in ``conftest.py`` files. They're powerful and flexible
7676
(and fun in their own way), and we encourage contributors to familiarize themselves.
@@ -126,4 +126,4 @@ Release new version
126126

127127
New versions are manually tagged and automatically released to pypi. To request
128128
a new release of LSDB, HATS, and hats-import packages, create a
129-
`release ticket <https://github.com/astronomy-commons/lsdb/issues/new?assignees=delucchi-cmu&labels=&projects=&template=4-release_tracker.md&title=Release%3A+>`_.
129+
`release ticket <https://github.com/astronomy-commons/lsdb/issues/new?assignees=delucchi-cmu&labels=&projects=&template=4-release_tracker.md&title=Release%3A+>`__.

docs/guide/hipscat_conversion.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,4 +129,4 @@ What next?
129129

130130
You can validate that your new HATS catalog meets both the HATS/LSDB expectations,
131131
as well as your own expectations of the data contents. You can follow along with the
132-
`Manual catalog verification <https://docs.lsdb.io/en/stable/tutorials/pre_executed/manual_verification.html>`_.
132+
`Manual catalog verification <https://docs.lsdb.io/en/stable/tutorials/pre_executed/manual_verification.html>`__.

docs/guide/margin_cache.rst

+46-12
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
Margin Cache
22
===============================================================================
33

4-
For more discussion of the whys and hows of margin caches, please see
5-
`Max's AAS iPoster <https://aas242-aas.ipostersessions.com/?s=66-E9-54-B6-6B-C3-4B-47-79-24-44-5A-13-25-82-E7>`_
4+
For more discussion of the whys and hows of margin caches, please see the
5+
`demo notebook in LSDB documentation <https://docs.lsdb.io/en/latest/tutorials/margins.html>`__ and
6+
`Max's AAS iPoster <https://aas242-aas.ipostersessions.com/?s=66-E9-54-B6-6B-C3-4B-47-79-24-44-5A-13-25-82-E7>`__
67
for more information.
78

89
This page discusses topics around setting up a pipeline to generate a margin
9-
cache from an existing hats catalog on disk.
10+
cache from an existing HATS catalog on disk.
1011

1112
At a minimum, you need arguments that include where to find the input files,
1213
and where to put the output files. A minimal arguments block will look something like:
@@ -91,15 +92,48 @@ This defaults to 5 arcseconds, but you should set this value to whatever is
9192
appropriate for the astrometry error/PSF width for your instruments. If you're
9293
not sure how to determine this, please reach out! We'd love to help! :doc:`/guide/contact`.
9394

94-
Setting ``margin_order`` *can* make your pipeline run faster.
95-
96-
#. For each input catalog partition, we can quickly determine all possible
97-
neighboring healpix pixels at the given ``margin_order``. All of these partitions
98-
*may* contain points that are inside the ``margin_threshold``.
99-
#. For each point in the input catalog, we can quickly determine the healpix
100-
pixel at ``margin_order`` and filter points based on this.
101-
#. Using this smaller, constrained data set, we do precise boundary checking
102-
to determine if the points are within the ``margin_threshold``.
95+
This is equivalent to setting the ``margin_order``. We use a lookup, with roughly
96+
the following table of values. This is the minimum separation angle possible within
97+
healpix pixels of a given order.
98+
99+
================= =========================
100+
``margin_order`` minimum separation angle
101+
================= =========================
102+
10 2.15 arcmin
103+
11 1.07 arcmin
104+
12 32.21 arcsec
105+
13 16.10 arcsec
106+
14 8.05 arcsec
107+
15 4.03 arcsec
108+
16 2.01 arcsec
109+
17 1.01 arcsec
110+
18 0.50 arcsec
111+
19 0.25 arcsec
112+
20 0.13 arcsec
113+
21 62.91 msec
114+
22 31.45 msec
115+
================= =========================
116+
117+
118+
For each input catalog partition, we can quickly determine all possible neighboring
119+
healpix pixels at the given ``margin_order``. All of these partitions *may* contain
120+
points that are inside the ``margin_threshold``. For each point in the input catalog,
121+
we can quickly determine the healpix pixel at ``margin_order`` and filter points
122+
based on this.
123+
124+
In the figure below, the central yellow pixel is the primary catalog pixel at order 10,
125+
and the surrounding pink order 13 pixels represent the margin for 10 arcsec.
126+
127+
.. figure:: /static/margin_pixels.png
128+
:class: no-scaled-link
129+
:align: center
130+
:alt: Visual of primary catalog pixel and the margin pixels.
131+
132+
Visual of primary catalog pixel and the margin pixels.
133+
134+
135+
For reasons of runtime performance and numerical precision, we do not perform precise
136+
boundary checking on individual points.
103137

104138
Progress Reporting
105139
-------------------------------------------------------------------------------

docs/guide/verification.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,4 @@ Additional Steps
125125
-------------------------------------------------------------------------------
126126

127127
You can verify and inspect the metadata using methods described in the
128-
`Manual catalog verification notebook <https://docs.lsdb.io/en/stable/tutorials/manual_verification.html>`_.
128+
`Manual catalog verification notebook <https://docs.lsdb.io/en/stable/tutorials/manual_verification.html>`__.

docs/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ need to install or upgrade versions of dependencies to work with hats-import.
3232
``healpy`` is an optional dependency for hats-import (included in the ``full`` extra)
3333
to support converting from older HiPSCat catalogs, but
3434
native prebuilt binaries for healpy on Apple Silicon Macs
35-
`do not yet exist <https://healpy.readthedocs.io/en/latest/install.html#binary-installation-with-pip-recommended-for-most-other-python-users>`_,
35+
`do not yet exist <https://healpy.readthedocs.io/en/latest/install.html#binary-installation-with-pip-recommended-for-most-other-python-users>`__,
3636
so it's recommended to install via conda before proceeding to hats-import.
3737

3838
.. code-block:: console

docs/static/margin_pixels.png

18.5 KB
Loading

0 commit comments

Comments
 (0)