Commit 9997828
* Use astropy.coordinates.angular_separation in cone_filter (#624)
Replace manual spherical cosine formula with astropy's angular_separation,
converting all coordinates to radians and comparing the separation in radians.
Add an ASV benchmark for the cone_filter angular separation computation.
https://claude.ai/code/session_01D2WEdPXU3F8cfdmewEYXX8
* Rename benchmark method and fix uniform sphere sampling
Append 'benchmark' to the cone filter benchmark name, and use
arcsin(uniform(-1,1)) for declination to produce a uniform distribution
on the sphere instead of biasing toward the poles.
https://claude.ai/code/session_01D2WEdPXU3F8cfdmewEYXX8
* Rename AngularSeparationSuite to ConeFilterSuite
https://claude.ai/code/session_01D2WEdPXU3F8cfdmewEYXX8
* Use haversine formula instead of astropy angular_separation for speed
Replace the slow astropy.coordinates.angular_separation call with an
inline haversine formula using only numpy operations. All math remains
in radians, and the result is compared in radians.
https://claude.ai/code/session_01D2WEdPXU3F8cfdmewEYXX8
* Optimize haversine: compare sin² half-angles, avoid arcsin/sqrt
- Compare haversine value a <= sin²(radius/2) directly, eliminating
the expensive arcsin and sqrt operations
- Use np.square instead of **2
- Multiply by 0.5 instead of dividing by 2
- Precompute cos(dec0) scalar
Valid for all separations up to 180 degrees since sin²(sep/2) is
monotonically increasing on [0, pi].
https://claude.ai/code/session_01D2WEdPXU3F8cfdmewEYXX8
* Fix pylint: initialize attributes in ConeFilterSuite.__init__
https://claude.ai/code/session_01D2WEdPXU3F8cfdmewEYXX8
* Reformat haversine equation for readability
https://claude.ai/code/session_01D2WEdPXU3F8cfdmewEYXX8
* Split haversine terms for readability, add comment
Break the haversine equation into named intermediate variables
(hav_dec, hav_ra) so the formatter doesn't mangle the layout.
https://claude.ai/code/session_01D2WEdPXU3F8cfdmewEYXX8
---------
Co-authored-by: Claude <noreply@anthropic.com>
1 parent ebbd155 commit 9997828
2 files changed
+41
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
80 | 82 | | |
81 | 83 | | |
82 | 84 | | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
92 | 92 | | |
93 | 93 | | |
94 | 94 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
| |||
0 commit comments