pneo 0.99.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pneo-0.99.0/CITATION.cff +29 -0
- pneo-0.99.0/LICENSE +28 -0
- pneo-0.99.0/MANIFEST.in +32 -0
- pneo-0.99.0/PKG-INFO +154 -0
- pneo-0.99.0/README.md +122 -0
- pneo-0.99.0/examples/example.psv +15 -0
- pneo-0.99.0/pyproject.toml +116 -0
- pneo-0.99.0/rust/Cargo.lock +281 -0
- pneo-0.99.0/rust/Cargo.toml +28 -0
- pneo-0.99.0/rust/README.md +312 -0
- pneo-0.99.0/rust/build.rs +48 -0
- pneo-0.99.0/rust/build.sh +74 -0
- pneo-0.99.0/rust/src/consts.rs +38 -0
- pneo-0.99.0/rust/src/guard.rs +770 -0
- pneo-0.99.0/rust/src/kernel.rs +634 -0
- pneo-0.99.0/rust/src/lib.rs +689 -0
- pneo-0.99.0/rust/src/model.rs +363 -0
- pneo-0.99.0/setup.cfg +4 -0
- pneo-0.99.0/src/pneo/__init__.py +35 -0
- pneo-0.99.0/src/pneo/_api.py +389 -0
- pneo-0.99.0/src/pneo/_attributable.py +280 -0
- pneo-0.99.0/src/pneo/_backend.py +977 -0
- pneo-0.99.0/src/pneo/_classifier.py +1335 -0
- pneo-0.99.0/src/pneo/_constants.py +28 -0
- pneo-0.99.0/src/pneo/_fetch_model.py +55 -0
- pneo-0.99.0/src/pneo/_ingest.py +1510 -0
- pneo-0.99.0/src/pneo/_ranging.py +201 -0
- pneo-0.99.0/src/pneo/_transforms.py +1073 -0
- pneo-0.99.0/src/pneo/cli.py +1258 -0
- pneo-0.99.0/src/pneo/models/__init__.py +96 -0
- pneo-0.99.0/src/pneo/models/_base.py +73 -0
- pneo-0.99.0/src/pneo/models/digest2.py +1638 -0
- pneo-0.99.0/src/pneo/paths.py +68 -0
- pneo-0.99.0/src/pneo.egg-info/PKG-INFO +154 -0
- pneo-0.99.0/src/pneo.egg-info/SOURCES.txt +52 -0
- pneo-0.99.0/src/pneo.egg-info/dependency_links.txt +1 -0
- pneo-0.99.0/src/pneo.egg-info/entry_points.txt +2 -0
- pneo-0.99.0/src/pneo.egg-info/requires.txt +10 -0
- pneo-0.99.0/src/pneo.egg-info/scm_file_list.json +64 -0
- pneo-0.99.0/src/pneo.egg-info/scm_version.json +8 -0
- pneo-0.99.0/src/pneo.egg-info/top_level.txt +1 -0
- pneo-0.99.0/tests/conftest.py +15 -0
- pneo-0.99.0/tests/model_location.py +24 -0
- pneo-0.99.0/tests/test_api.py +120 -0
- pneo-0.99.0/tests/test_attributable.py +408 -0
- pneo-0.99.0/tests/test_backend_parity.py +1173 -0
- pneo-0.99.0/tests/test_classifier.py +1631 -0
- pneo-0.99.0/tests/test_cli.py +1012 -0
- pneo-0.99.0/tests/test_imports.py +18 -0
- pneo-0.99.0/tests/test_ingest.py +914 -0
- pneo-0.99.0/tests/test_paths.py +55 -0
- pneo-0.99.0/tests/test_population.py +2193 -0
- pneo-0.99.0/tests/test_ranging.py +497 -0
- pneo-0.99.0/tests/test_transforms.py +1318 -0
pneo-0.99.0/CITATION.cff
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: >-
|
|
3
|
+
If you use pneo, please cite the paper describing it (see preferred-citation).
|
|
4
|
+
title: "pneo: Bayesian classification of near-Earth object tracklets"
|
|
5
|
+
type: software
|
|
6
|
+
license: BSD-3-Clause
|
|
7
|
+
repository-code: "https://github.com/lsst-ssp/pneo"
|
|
8
|
+
keywords:
|
|
9
|
+
- near-Earth objects
|
|
10
|
+
- asteroids
|
|
11
|
+
- Bayesian statistics
|
|
12
|
+
- classification
|
|
13
|
+
- Vera C. Rubin Observatory
|
|
14
|
+
authors:
|
|
15
|
+
- given-names: Mario
|
|
16
|
+
family-names: Jurić
|
|
17
|
+
affiliation: University of Washington
|
|
18
|
+
orcid: "https://orcid.org/0000-0003-1996-9252"
|
|
19
|
+
preferred-citation:
|
|
20
|
+
type: article
|
|
21
|
+
title: "A Bayesian Approach to Prioritizing the Follow-Up of Near-Earth Objects"
|
|
22
|
+
status: in-preparation
|
|
23
|
+
authors:
|
|
24
|
+
- given-names: Devanshi
|
|
25
|
+
family-names: Singh
|
|
26
|
+
- given-names: Mario
|
|
27
|
+
family-names: Jurić
|
|
28
|
+
- given-names: Željko
|
|
29
|
+
family-names: Ivezić
|
pneo-0.99.0/LICENSE
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, Mario Juric
|
|
4
|
+
|
|
5
|
+
Redistribution and use in source and binary forms, with or without
|
|
6
|
+
modification, are permitted provided that the following conditions are met:
|
|
7
|
+
|
|
8
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
list of conditions and the following disclaimer.
|
|
10
|
+
|
|
11
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
12
|
+
this list of conditions and the following disclaimer in the documentation
|
|
13
|
+
and/or other materials provided with the distribution.
|
|
14
|
+
|
|
15
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
16
|
+
contributors may be used to endorse or promote products derived from
|
|
17
|
+
this software without specific prior written permission.
|
|
18
|
+
|
|
19
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
20
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
21
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
22
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
23
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
24
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
25
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
26
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
27
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
28
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
pneo-0.99.0/MANIFEST.in
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# What the sdist carries beyond setuptools' defaults (the Python package under
|
|
2
|
+
# src/, README.md, pyproject.toml and the license files).
|
|
3
|
+
#
|
|
4
|
+
# The Rust crate is in the sdist even though installing the sdist never builds
|
|
5
|
+
# it: the sdist is then a complete source release, and a downstream packager
|
|
6
|
+
# (conda-forge, a distro, a site build) can produce the extension from it with
|
|
7
|
+
# tar xf pneo-<v>.tar.gz && cd pneo-<v> && maturin build --release
|
|
8
|
+
# using the [tool.maturin] table in pyproject.toml, or with rust/build.sh.
|
|
9
|
+
#
|
|
10
|
+
# Deliberately NOT in the sdist:
|
|
11
|
+
# * the population model (digest2.model.csv) -- ~4 MB of MPC data that
|
|
12
|
+
# `pneo fetch-model` downloads into the per-user cache at use time, and
|
|
13
|
+
# not ours to redistribute;
|
|
14
|
+
# * docs of record, .github/ -- development material,
|
|
15
|
+
# not part of the installable package;
|
|
16
|
+
# * rust/target/ and any compiled extension -- build products.
|
|
17
|
+
# The release workflow asserts each of those absences on the built sdist rather
|
|
18
|
+
# than trusting these rules.
|
|
19
|
+
#
|
|
20
|
+
# The explicit prunes below matter: setuptools-scm adds every git-tracked file
|
|
21
|
+
# to the sdist, so anything not wanted must be removed here, not merely left
|
|
22
|
+
# out of the include lines.
|
|
23
|
+
|
|
24
|
+
recursive-include rust *.rs *.toml *.lock *.sh *.py *.md
|
|
25
|
+
recursive-include tests *.py
|
|
26
|
+
recursive-include examples *.psv
|
|
27
|
+
include MANIFEST.in
|
|
28
|
+
|
|
29
|
+
prune rust/target
|
|
30
|
+
prune .github
|
|
31
|
+
exclude .gitignore
|
|
32
|
+
prune docs
|
pneo-0.99.0/PKG-INFO
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: pneo
|
|
3
|
+
Version: 0.99.0
|
|
4
|
+
Summary: Bayesian NEO tracklet classification by ranging over topocentric distance and range-rate
|
|
5
|
+
Author-email: Mario Juric <mjuric@uw.edu>
|
|
6
|
+
License-Expression: BSD-3-Clause
|
|
7
|
+
Project-URL: Homepage, https://github.com/lsst-ssp/pneo
|
|
8
|
+
Project-URL: Repository, https://github.com/lsst-ssp/pneo
|
|
9
|
+
Project-URL: Issues, https://github.com/lsst-ssp/pneo/issues
|
|
10
|
+
Keywords: astronomy,asteroids,NEO,digest2,classification,Bayesian,LSST
|
|
11
|
+
Classifier: Development Status :: 3 - Alpha
|
|
12
|
+
Classifier: Intended Audience :: Science/Research
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Programming Language :: Rust
|
|
19
|
+
Classifier: Topic :: Scientific/Engineering :: Astronomy
|
|
20
|
+
Requires-Python: >=3.11
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
License-File: LICENSE
|
|
23
|
+
Requires-Dist: numpy>=1.24
|
|
24
|
+
Requires-Dist: astropy>=5.3
|
|
25
|
+
Provides-Extra: plot
|
|
26
|
+
Requires-Dist: matplotlib>=3.7; extra == "plot"
|
|
27
|
+
Provides-Extra: dev
|
|
28
|
+
Requires-Dist: pytest>=7; extra == "dev"
|
|
29
|
+
Requires-Dist: pytest-xdist>=3; extra == "dev"
|
|
30
|
+
Requires-Dist: matplotlib>=3.7; extra == "dev"
|
|
31
|
+
Dynamic: license-file
|
|
32
|
+
|
|
33
|
+
# `pneo` — a Bayesian update to digest2
|
|
34
|
+
|
|
35
|
+
[](https://github.com/lsst-ssp/pneo/actions/workflows/ci.yml)
|
|
36
|
+
|
|
37
|
+
`pneo` computes the probability that a newly detected moving object is a near-Earth object
|
|
38
|
+
(NEO), using only what a single night's tracklet measures: its sky position, angular
|
|
39
|
+
motion, and apparent magnitude. Its classifications are provably optimal for the adopted
|
|
40
|
+
population model, and its probabilities are calibrated.
|
|
41
|
+
|
|
42
|
+
Applied to present-day NEOCP candidates, its selection is 1.14x purer than digest2's. It
|
|
43
|
+
was shown to be 1.4–1.7x as pure on early Rubin data, and is expected to be ~2x as pure
|
|
44
|
+
at full LSST depth.
|
|
45
|
+
|
|
46
|
+
## Installation
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
pip install pneo # CPython >= 3.11
|
|
50
|
+
pneo fetch # once: the MPC population model and observatory codes
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Both are stored in a per-user cache; see
|
|
54
|
+
[docs/cli.md](https://github.com/lsst-ssp/pneo/blob/main/docs/cli.md#downloaded-files)
|
|
55
|
+
to change where.
|
|
56
|
+
|
|
57
|
+
Add the `plot` extra (`pip install 'pneo[plot]'`) for the diagnostic plots, which need
|
|
58
|
+
matplotlib.
|
|
59
|
+
|
|
60
|
+
Wheels for Linux (x86_64), macOS (Apple silicon) and Windows (x64) include a compiled
|
|
61
|
+
Rust kernel. On other platforms `pip` installs a pure-Python version that gives the same
|
|
62
|
+
results about 40 times more slowly.
|
|
63
|
+
|
|
64
|
+
## Quick start: command line
|
|
65
|
+
|
|
66
|
+
`pneo classify` reads astrometry in ADES PSV or MPC 80-column format (detected
|
|
67
|
+
automatically), fits one tracklet per object, and writes one row per tracklet. With the
|
|
68
|
+
four synthetic tracklets in
|
|
69
|
+
[examples/example.psv](https://github.com/lsst-ssp/pneo/blob/main/examples/example.psv):
|
|
70
|
+
|
|
71
|
+
```console
|
|
72
|
+
$ pneo classify examples/example.psv
|
|
73
|
+
object_id n_obs arc_hours epoch obscode mag_v p_neo log_lr status
|
|
74
|
+
T000001 4 0.7500 2026-03-15T06:00:00.000Z X05 19.77 1 inf ok
|
|
75
|
+
T000002 3 0.0667 2026-03-15T06:00:00.000Z X05 22.62 1 nan beyond_model
|
|
76
|
+
T000003 5 1.3333 2026-03-15T06:00:00.000Z F51 20.25 0.929963 2.58612 ok
|
|
77
|
+
T000004 1 X05 single_detection
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`p_neo` is the probability that the object is an NEO. `status` says how each row was
|
|
81
|
+
obtained: `ok` is a computed probability; `beyond_model` marks a very small, nearby
|
|
82
|
+
object beyond the population model's size range, assigned P(NEO) = 1 by rule; any other
|
|
83
|
+
value says why there is no probability. Use only `status == ok` rows when
|
|
84
|
+
checking calibration. Output is tab-separated by default (`--format csv` or `json` for
|
|
85
|
+
other formats). `pneo classify --help` lists every option, and [docs/cli.md](https://github.com/lsst-ssp/pneo/blob/main/docs/cli.md)
|
|
86
|
+
describes them in more detail.
|
|
87
|
+
|
|
88
|
+
## Quick start: Python
|
|
89
|
+
|
|
90
|
+
```python
|
|
91
|
+
import pneo
|
|
92
|
+
|
|
93
|
+
# One tracklet: position [deg], on-sky rates [deg/day], epoch [MJD, UTC], V magnitude.
|
|
94
|
+
p = pneo.classify(166.2, 5.7, -1.1, 0.29, 61114.25, 21.0, obscode="X05")
|
|
95
|
+
|
|
96
|
+
# Arrays work the same way, and observation files can be read directly:
|
|
97
|
+
tracklets, failures = pneo.read_observations("examples/example.psv")
|
|
98
|
+
p = pneo.classify(**tracklets) # one P(NEO) per tracklet
|
|
99
|
+
r = pneo.classify(**tracklets, details=True) # also log_lr, likelihoods and status
|
|
100
|
+
|
|
101
|
+
# Where the probability lies in distance and range-rate (needs pneo[plot]):
|
|
102
|
+
m = pneo.posterior_map(166.2, 5.7, -1.1, 0.29, 61114.25, 21.0, obscode="X05")
|
|
103
|
+
pneo.plot_posterior_map(m)
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
`ra_rate` is the on-sky rate, d(α)/dt·cos δ. The population model is loaded from the
|
|
107
|
+
cache on first use; `pneo.load_model()` loads it explicitly, for example with
|
|
108
|
+
`variant="Unk"`, and the result can be passed as `model=`. [docs/api.md](https://github.com/lsst-ssp/pneo/blob/main/docs/api.md)
|
|
109
|
+
describes every function.
|
|
110
|
+
|
|
111
|
+
## How it works
|
|
112
|
+
|
|
113
|
+
A tracklet measures an object's position and angular motion on the sky, but not its
|
|
114
|
+
distance or its velocity along the line of sight. `pneo` considers every distance and
|
|
115
|
+
radial velocity that gives a bound orbit around the Sun. Each such hypothesis implies a
|
|
116
|
+
full orbit and, from the apparent magnitude, the object's absolute magnitude (its size).
|
|
117
|
+
`pneo` weighs each hypothesis by how many objects with that orbit and size a population
|
|
118
|
+
model predicts, accounting for how a grid of distances and velocities maps onto orbits.
|
|
119
|
+
P(NEO) is the fraction of this weight that falls on NEO orbits (perihelion below
|
|
120
|
+
1.3 AU).
|
|
121
|
+
|
|
122
|
+
The population model is the one digest2 uses, maintained by the Minor Planet Center, so
|
|
123
|
+
differences from digest2 come from the method alone. It is a separate component and can
|
|
124
|
+
be replaced with a newer model without changing the classifier.
|
|
125
|
+
|
|
126
|
+
## Performance
|
|
127
|
+
|
|
128
|
+
The Rust kernel scores one tracklet in about 12 ms on a single CPU core, or about
|
|
129
|
+
1.5×10⁷ tracklets per hour on a 96-thread server.
|
|
130
|
+
|
|
131
|
+
## Development
|
|
132
|
+
|
|
133
|
+
```bash
|
|
134
|
+
git clone https://github.com/lsst-ssp/pneo && cd pneo
|
|
135
|
+
pip install -e ".[dev]"
|
|
136
|
+
pneo fetch # the population model, into the user cache
|
|
137
|
+
rust/build.sh # optional: build the Rust kernel (needs cargo)
|
|
138
|
+
pytest -n auto # run the tests in parallel
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
An editable install is pure Python until `rust/build.sh` compiles the kernel into the
|
|
142
|
+
source tree; rerun it after changing the Rust code. The `docs/` directory holds the
|
|
143
|
+
detailed [command-line notes](https://github.com/lsst-ssp/pneo/blob/main/docs/cli.md), the [release process](https://github.com/lsst-ssp/pneo/blob/main/docs/RELEASING.md),
|
|
144
|
+
and the [design records](https://github.com/lsst-ssp/pneo/blob/main/docs/design/README.md) from `pneo`'s development.
|
|
145
|
+
|
|
146
|
+
## Citing `pneo`
|
|
147
|
+
|
|
148
|
+
The method and the tests behind the numbers above are described in Singh, Jurić &
|
|
149
|
+
Ivezić (in preparation). If you use `pneo`, please cite that paper; see
|
|
150
|
+
[CITATION.cff](https://github.com/lsst-ssp/pneo/blob/main/CITATION.cff).
|
|
151
|
+
|
|
152
|
+
## License
|
|
153
|
+
|
|
154
|
+
BSD 3-Clause; see [LICENSE](https://github.com/lsst-ssp/pneo/blob/main/LICENSE).
|
pneo-0.99.0/README.md
ADDED
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
# `pneo` — a Bayesian update to digest2
|
|
2
|
+
|
|
3
|
+
[](https://github.com/lsst-ssp/pneo/actions/workflows/ci.yml)
|
|
4
|
+
|
|
5
|
+
`pneo` computes the probability that a newly detected moving object is a near-Earth object
|
|
6
|
+
(NEO), using only what a single night's tracklet measures: its sky position, angular
|
|
7
|
+
motion, and apparent magnitude. Its classifications are provably optimal for the adopted
|
|
8
|
+
population model, and its probabilities are calibrated.
|
|
9
|
+
|
|
10
|
+
Applied to present-day NEOCP candidates, its selection is 1.14x purer than digest2's. It
|
|
11
|
+
was shown to be 1.4–1.7x as pure on early Rubin data, and is expected to be ~2x as pure
|
|
12
|
+
at full LSST depth.
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
pip install pneo # CPython >= 3.11
|
|
18
|
+
pneo fetch # once: the MPC population model and observatory codes
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Both are stored in a per-user cache; see
|
|
22
|
+
[docs/cli.md](https://github.com/lsst-ssp/pneo/blob/main/docs/cli.md#downloaded-files)
|
|
23
|
+
to change where.
|
|
24
|
+
|
|
25
|
+
Add the `plot` extra (`pip install 'pneo[plot]'`) for the diagnostic plots, which need
|
|
26
|
+
matplotlib.
|
|
27
|
+
|
|
28
|
+
Wheels for Linux (x86_64), macOS (Apple silicon) and Windows (x64) include a compiled
|
|
29
|
+
Rust kernel. On other platforms `pip` installs a pure-Python version that gives the same
|
|
30
|
+
results about 40 times more slowly.
|
|
31
|
+
|
|
32
|
+
## Quick start: command line
|
|
33
|
+
|
|
34
|
+
`pneo classify` reads astrometry in ADES PSV or MPC 80-column format (detected
|
|
35
|
+
automatically), fits one tracklet per object, and writes one row per tracklet. With the
|
|
36
|
+
four synthetic tracklets in
|
|
37
|
+
[examples/example.psv](https://github.com/lsst-ssp/pneo/blob/main/examples/example.psv):
|
|
38
|
+
|
|
39
|
+
```console
|
|
40
|
+
$ pneo classify examples/example.psv
|
|
41
|
+
object_id n_obs arc_hours epoch obscode mag_v p_neo log_lr status
|
|
42
|
+
T000001 4 0.7500 2026-03-15T06:00:00.000Z X05 19.77 1 inf ok
|
|
43
|
+
T000002 3 0.0667 2026-03-15T06:00:00.000Z X05 22.62 1 nan beyond_model
|
|
44
|
+
T000003 5 1.3333 2026-03-15T06:00:00.000Z F51 20.25 0.929963 2.58612 ok
|
|
45
|
+
T000004 1 X05 single_detection
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`p_neo` is the probability that the object is an NEO. `status` says how each row was
|
|
49
|
+
obtained: `ok` is a computed probability; `beyond_model` marks a very small, nearby
|
|
50
|
+
object beyond the population model's size range, assigned P(NEO) = 1 by rule; any other
|
|
51
|
+
value says why there is no probability. Use only `status == ok` rows when
|
|
52
|
+
checking calibration. Output is tab-separated by default (`--format csv` or `json` for
|
|
53
|
+
other formats). `pneo classify --help` lists every option, and [docs/cli.md](https://github.com/lsst-ssp/pneo/blob/main/docs/cli.md)
|
|
54
|
+
describes them in more detail.
|
|
55
|
+
|
|
56
|
+
## Quick start: Python
|
|
57
|
+
|
|
58
|
+
```python
|
|
59
|
+
import pneo
|
|
60
|
+
|
|
61
|
+
# One tracklet: position [deg], on-sky rates [deg/day], epoch [MJD, UTC], V magnitude.
|
|
62
|
+
p = pneo.classify(166.2, 5.7, -1.1, 0.29, 61114.25, 21.0, obscode="X05")
|
|
63
|
+
|
|
64
|
+
# Arrays work the same way, and observation files can be read directly:
|
|
65
|
+
tracklets, failures = pneo.read_observations("examples/example.psv")
|
|
66
|
+
p = pneo.classify(**tracklets) # one P(NEO) per tracklet
|
|
67
|
+
r = pneo.classify(**tracklets, details=True) # also log_lr, likelihoods and status
|
|
68
|
+
|
|
69
|
+
# Where the probability lies in distance and range-rate (needs pneo[plot]):
|
|
70
|
+
m = pneo.posterior_map(166.2, 5.7, -1.1, 0.29, 61114.25, 21.0, obscode="X05")
|
|
71
|
+
pneo.plot_posterior_map(m)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
`ra_rate` is the on-sky rate, d(α)/dt·cos δ. The population model is loaded from the
|
|
75
|
+
cache on first use; `pneo.load_model()` loads it explicitly, for example with
|
|
76
|
+
`variant="Unk"`, and the result can be passed as `model=`. [docs/api.md](https://github.com/lsst-ssp/pneo/blob/main/docs/api.md)
|
|
77
|
+
describes every function.
|
|
78
|
+
|
|
79
|
+
## How it works
|
|
80
|
+
|
|
81
|
+
A tracklet measures an object's position and angular motion on the sky, but not its
|
|
82
|
+
distance or its velocity along the line of sight. `pneo` considers every distance and
|
|
83
|
+
radial velocity that gives a bound orbit around the Sun. Each such hypothesis implies a
|
|
84
|
+
full orbit and, from the apparent magnitude, the object's absolute magnitude (its size).
|
|
85
|
+
`pneo` weighs each hypothesis by how many objects with that orbit and size a population
|
|
86
|
+
model predicts, accounting for how a grid of distances and velocities maps onto orbits.
|
|
87
|
+
P(NEO) is the fraction of this weight that falls on NEO orbits (perihelion below
|
|
88
|
+
1.3 AU).
|
|
89
|
+
|
|
90
|
+
The population model is the one digest2 uses, maintained by the Minor Planet Center, so
|
|
91
|
+
differences from digest2 come from the method alone. It is a separate component and can
|
|
92
|
+
be replaced with a newer model without changing the classifier.
|
|
93
|
+
|
|
94
|
+
## Performance
|
|
95
|
+
|
|
96
|
+
The Rust kernel scores one tracklet in about 12 ms on a single CPU core, or about
|
|
97
|
+
1.5×10⁷ tracklets per hour on a 96-thread server.
|
|
98
|
+
|
|
99
|
+
## Development
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
git clone https://github.com/lsst-ssp/pneo && cd pneo
|
|
103
|
+
pip install -e ".[dev]"
|
|
104
|
+
pneo fetch # the population model, into the user cache
|
|
105
|
+
rust/build.sh # optional: build the Rust kernel (needs cargo)
|
|
106
|
+
pytest -n auto # run the tests in parallel
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
An editable install is pure Python until `rust/build.sh` compiles the kernel into the
|
|
110
|
+
source tree; rerun it after changing the Rust code. The `docs/` directory holds the
|
|
111
|
+
detailed [command-line notes](https://github.com/lsst-ssp/pneo/blob/main/docs/cli.md), the [release process](https://github.com/lsst-ssp/pneo/blob/main/docs/RELEASING.md),
|
|
112
|
+
and the [design records](https://github.com/lsst-ssp/pneo/blob/main/docs/design/README.md) from `pneo`'s development.
|
|
113
|
+
|
|
114
|
+
## Citing `pneo`
|
|
115
|
+
|
|
116
|
+
The method and the tests behind the numbers above are described in Singh, Jurić &
|
|
117
|
+
Ivezić (in preparation). If you use `pneo`, please cite that paper; see
|
|
118
|
+
[CITATION.cff](https://github.com/lsst-ssp/pneo/blob/main/CITATION.cff).
|
|
119
|
+
|
|
120
|
+
## License
|
|
121
|
+
|
|
122
|
+
BSD 3-Clause; see [LICENSE](https://github.com/lsst-ssp/pneo/blob/main/LICENSE).
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Four synthetic tracklets (ADES PSV) for trying pneo: `pneo classify examples/example.psv`
|
|
2
|
+
permID |provID |trkSub |mode |stn |obsTime |ra |dec |mag |band |astCat
|
|
3
|
+
| |T000001 |CCD |X05 |2026-03-15T06:00:00.000Z |166.15776059 | +5.72957795 | 19.77 |V |Gaia3
|
|
4
|
+
| |T000001 |CCD |X05 |2026-03-15T06:15:00.000Z |166.17859392 | +5.73686962 | 19.77 |V |Gaia3
|
|
5
|
+
| |T000001 |CCD |X05 |2026-03-15T06:30:00.000Z |166.19942725 | +5.74416128 | 19.77 |V |Gaia3
|
|
6
|
+
| |T000001 |CCD |X05 |2026-03-15T06:45:00.000Z |166.22026059 | +5.75145295 | 19.77 |V |Gaia3
|
|
7
|
+
| |T000002 |CCD |X05 |2026-03-15T06:00:00.000Z |166.15776059 | +5.72957795 | 22.62 |V |Gaia3
|
|
8
|
+
| |T000002 |CCD |X05 |2026-03-15T06:02:00.000Z |166.19942725 | +5.75735573 | 22.62 |V |Gaia3
|
|
9
|
+
| |T000002 |CCD |X05 |2026-03-15T06:04:00.000Z |166.24109392 | +5.78513351 | 22.62 |V |Gaia3
|
|
10
|
+
| |T000003 |CCD |F51 |2026-03-15T06:00:00.000Z | 68.75493542 |-17.18873385 | 20.02 |r |Gaia3
|
|
11
|
+
| |T000003 |CCD |F51 |2026-03-15T06:20:00.000Z | 68.75701875 |-17.18803941 | 20.02 |r |Gaia3
|
|
12
|
+
| |T000003 |CCD |F51 |2026-03-15T06:40:00.000Z | 68.75910208 |-17.18734497 | 20.02 |r |Gaia3
|
|
13
|
+
| |T000003 |CCD |F51 |2026-03-15T07:00:00.000Z | 68.76118542 |-17.18665052 | 20.02 |r |Gaia3
|
|
14
|
+
| |T000003 |CCD |F51 |2026-03-15T07:20:00.000Z | 68.76326875 |-17.18595608 | 20.02 |r |Gaia3
|
|
15
|
+
| |T000004 |CCD |X05 |2026-03-15T06:00:00.000Z |166.15776059 | +5.72957795 | 19.77 |V |Gaia3
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
# pneo packaging.
|
|
2
|
+
#
|
|
3
|
+
# Two artifacts are published, built by two different tools on purpose (see
|
|
4
|
+
# docs/RELEASING.md):
|
|
5
|
+
#
|
|
6
|
+
# * the **sdist**, built by setuptools (the `[build-system]` backend below).
|
|
7
|
+
# It carries the Python package *and* the Rust crate sources, but installing
|
|
8
|
+
# it compiles nothing: `pip install pneo` from source needs no Rust
|
|
9
|
+
# toolchain and yields the numpy reference implementation, which is exactly
|
|
10
|
+
# what `backend="auto"` degrades to at run time. This is what keeps the
|
|
11
|
+
# package installable on every platform we do not ship a wheel for.
|
|
12
|
+
# * the **wheels**, built by `maturin` driven as a plain CLI over the
|
|
13
|
+
# `[tool.maturin]` table below (`maturin build`, never as the PEP 517
|
|
14
|
+
# backend). They carry the same Python package plus the compiled
|
|
15
|
+
# `pneo._core` extension. Because the crate is built against the
|
|
16
|
+
# stable ABI (abi3-py311), one wheel per platform covers CPython >= 3.11.
|
|
17
|
+
#
|
|
18
|
+
# Consequences, all deliberate:
|
|
19
|
+
# * `pip install -e .` / `pip install .` from a checkout is a *pure Python*
|
|
20
|
+
# install and does not touch cargo, so the CI job that asserts
|
|
21
|
+
# "no extension present, auto degrades to python" keeps testing the thing a
|
|
22
|
+
# user actually gets from the sdist, and the documented dev flow
|
|
23
|
+
# (`pip install -e .` once, then `rust/build.sh` after every crate edit)
|
|
24
|
+
# is unchanged.
|
|
25
|
+
# * setuptools and maturin read the *same* `[project]` table, so the two
|
|
26
|
+
# artifacts cannot disagree about name, version, dependencies or metadata.
|
|
27
|
+
# The release workflow diffs their METADATA anyway.
|
|
28
|
+
|
|
29
|
+
[build-system]
|
|
30
|
+
# >=77 for PEP 639 (`license` as an SPDX expression, License-Expression in the
|
|
31
|
+
# metadata). maturin needs no entry here: it is never the PEP 517 backend.
|
|
32
|
+
requires = ["setuptools>=77", "setuptools-scm>=8"]
|
|
33
|
+
build-backend = "setuptools.build_meta"
|
|
34
|
+
|
|
35
|
+
[project]
|
|
36
|
+
name = "pneo"
|
|
37
|
+
# The version is derived from git by setuptools-scm: a `vX.Y.Z` tag IS the
|
|
38
|
+
# version (and pushing one publishes the release -- see docs/RELEASING.md); between
|
|
39
|
+
# tags, dev installs get `X.Y.(Z+1).devN+g<hash>`. There is no hand-maintained
|
|
40
|
+
# version string anywhere: `__init__.__version__` reads installed metadata, and
|
|
41
|
+
# rust/Cargo.toml carries no version (publish = false; the crate is an
|
|
42
|
+
# implementation detail of this package). The maturin wheel build cannot run
|
|
43
|
+
# setuptools-scm, so release.yml resolves the version from the tag and stamps
|
|
44
|
+
# it into the workspace pyproject before `maturin build` -- see the
|
|
45
|
+
# `version-check` job.
|
|
46
|
+
dynamic = ["version"]
|
|
47
|
+
description = "Bayesian NEO tracklet classification by ranging over topocentric distance and range-rate"
|
|
48
|
+
readme = "README.md"
|
|
49
|
+
requires-python = ">=3.11"
|
|
50
|
+
license = "BSD-3-Clause"
|
|
51
|
+
authors = [{ name = "Mario Juric", email = "mjuric@uw.edu" }]
|
|
52
|
+
keywords = ["astronomy", "asteroids", "NEO", "digest2", "classification", "Bayesian", "LSST"]
|
|
53
|
+
# No `License :: ...` classifier: PEP 639 forbids mixing those with the SPDX
|
|
54
|
+
# `license` expression above, and setuptools >= 77 rejects the combination.
|
|
55
|
+
classifiers = [
|
|
56
|
+
"Development Status :: 3 - Alpha",
|
|
57
|
+
"Intended Audience :: Science/Research",
|
|
58
|
+
"Operating System :: OS Independent",
|
|
59
|
+
"Programming Language :: Python :: 3",
|
|
60
|
+
"Programming Language :: Python :: 3.11",
|
|
61
|
+
"Programming Language :: Python :: 3.12",
|
|
62
|
+
"Programming Language :: Python :: 3.13",
|
|
63
|
+
"Programming Language :: Rust",
|
|
64
|
+
"Topic :: Scientific/Engineering :: Astronomy",
|
|
65
|
+
]
|
|
66
|
+
dependencies = [
|
|
67
|
+
"numpy>=1.24",
|
|
68
|
+
"astropy>=5.3",
|
|
69
|
+
]
|
|
70
|
+
|
|
71
|
+
[project.optional-dependencies]
|
|
72
|
+
# matplotlib is needed only by the diagnostic plotting methods
|
|
73
|
+
# (ClassificationResult.plot_*); scoring never imports it.
|
|
74
|
+
plot = ["matplotlib>=3.7"]
|
|
75
|
+
dev = ["pytest>=7", "pytest-xdist>=3", "matplotlib>=3.7"]
|
|
76
|
+
|
|
77
|
+
[project.scripts]
|
|
78
|
+
pneo = "pneo.cli:main"
|
|
79
|
+
|
|
80
|
+
[project.urls]
|
|
81
|
+
Homepage = "https://github.com/lsst-ssp/pneo"
|
|
82
|
+
Repository = "https://github.com/lsst-ssp/pneo"
|
|
83
|
+
Issues = "https://github.com/lsst-ssp/pneo/issues"
|
|
84
|
+
|
|
85
|
+
[tool.setuptools.packages.find]
|
|
86
|
+
where = ["src"]
|
|
87
|
+
|
|
88
|
+
# The compiled extension and the population model are deliberately absent from
|
|
89
|
+
# the setuptools build: `src/pneo/_core.abi3.so` is a build product of
|
|
90
|
+
# rust/build.sh (and is what maturin puts in the wheel itself), and the
|
|
91
|
+
# population model is downloaded into the per-user cache by `pneo fetch-model`.
|
|
92
|
+
# Neither is package data. MANIFEST.in states
|
|
93
|
+
# what the sdist carries; the release workflow asserts what it must not.
|
|
94
|
+
|
|
95
|
+
[tool.maturin]
|
|
96
|
+
# Mixed Python/Rust layout: the Python package is the authoritative one at
|
|
97
|
+
# `src/pneo` and the crate contributes exactly one submodule to it. Naming
|
|
98
|
+
# the module `pneo._core` (rather than letting maturin default to the crate
|
|
99
|
+
# name, `pneo_core`) is what makes the wheel a drop-in for the layout
|
|
100
|
+
# rust/build.sh already installs into. `python-source` must stay in sync with
|
|
101
|
+
# `[tool.setuptools.packages.find] where`.
|
|
102
|
+
python-source = "src"
|
|
103
|
+
module-name = "pneo._core"
|
|
104
|
+
manifest-path = "rust/Cargo.toml"
|
|
105
|
+
# maturin copies `python-source` into the wheel verbatim, which would otherwise
|
|
106
|
+
# pick up a developer's stale bytecode. (A stale `_core.abi3.so` from
|
|
107
|
+
# rust/build.sh is already overwritten by the freshly built extension.)
|
|
108
|
+
exclude = ["**/__pycache__/**", "**/*.py[cod]"]
|
|
109
|
+
|
|
110
|
+
[tool.pytest.ini_options]
|
|
111
|
+
testpaths = ["tests"]
|
|
112
|
+
|
|
113
|
+
[tool.setuptools_scm]
|
|
114
|
+
# A build from a tarball with no .git (and no PKG-INFO) still installs, with a
|
|
115
|
+
# version that is obviously not a release.
|
|
116
|
+
fallback_version = "0.0.0+unknown"
|