Improve FOV contour and add Comet and Asteroid support in SpiceBody
RECTANGLE
and POLYGON
shapes
Add support for irregular point distribution on >>> traj.fovs.npts = (3, 1)
>>> traj.fovs.pts.shape
(3, 1, 13)
Corresponding to the following points distribution in the FOV after interpolation:
C0 -> +3 pts -> C1
^ |
+1 pt +1 pt
| v
C3 <- +3 pts <- C2
The final (closed) sequence is [C0, P0, P1, P2, C1, P3, C2, P4, P5, P6, C3, P7, C0]
= 13 pts
.
Notes:
- If the tuple size is smaller than the number of edges/corners (like here), its values will be cycled.
This is very useful for
POLYGON
shapes for example to customized every edge if needed. - Single value tuple can be used to perform regular points distribution.
Closes #107 (closed)
Fix footprints on the limb
It is now possible to disable the representation of the pixels at the limb with
traj.fovs.limb_contour = False
Note: Previously, if any point in the FOV was on the limb, the whole FOV was not represented when traj.fovs.limb
was False
; now all the points on the surface will be represented.
Similarly to Trajectory.surface
and Trajectory.limb
; it is possible to identify which points on the contour
are either on the surface
or on the limb
:
>>> traj.fovs.surface
[
[True, True, True, True, True],
[True, True, True, False, True],
[False, False, False, False, False],
]
>>> traj.fovs.limb
[
[False, False, False, False, False],
[False, False, False, True, False],
[True, True, True, True, True],
]
- It is also possible to identify if at one point is on the
surface
(respectively on thelimb
) and if all are:
>>> fovs.surface_all
[True, False, False]
>>> fovs.surface_any
[True, True, False]
>>> fovs.limb_all
[False, False, True]
>>> fovs.limb_any
[False, True, True]
Closes #91 (closed).
Add Comet and Asteroid support in SpiceBody
Now Comets and Asteroids are properly supported in SpiceBody
:
>>> SpiceRef('CHURYUMOV-GERASIMENKO')
<SpiceBody> CHURYUMOV-GERASIMENKO (1_000_012)
>>> SpiceRef('RYUGU')
<SpiceBody> RYUGU (2_162_173)
This also included comet's fragments from Shoemaker Levy-9 and multi-body asteroids codes:
>>> SpiceBody('SHOEMAKER-LEVY 9-W')
<SpiceBody> SHOEMAKER-LEVY 9-W (50_000_001)
>>> SpiceBody('DIDYMOS')
<SpiceBody> SHOEMAKER-LEVY 9-W (920_065_803)
>>> SpiceBody('DIMORPHOS')
<SpiceBody> SHOEMAKER-LEVY 9-W (120_065_803)
-
Fix inner moon codes that are invalid (eg.,
101
,302
,403
, …) -
Added also
SpiceRefRegex
to improve regular expression parsing of the NAIF codes (with|
concatenation support):
from planetary_coverage.spice.references import SpiceRefRegex
>>> 399 in SpiceRefRegex(r'[1-9]99')
True
>>> INNER_MOONS = SpiceRefRegex(r'301|401|402')
>>> OUTER_MOONS = SpiceRefRegex(r'[5-9](?!00|99)\d{2}')
>>> 501 in INNER_MOONS | OUTER_MOONS
True
Closes #105 (closed).
Other
- Add Mario D'Amore as new contributor
👏 -
⚠️ intersect_pt()
,boresight_pt()
andfov_pts()
in theplanetary_coverage.spice.toolbox
now returns a 4D vector with an explicit surface intersection flag - Remove
imp
import in docs (closes #106 (closed)) - Fix
ENVISION
kernels location for the docs. - Improve formatting with ruff
- Bump repo year to 2025
- Bump poetry lock dependencies