from astropy import units as u
from numpy.linalg import norm
from planetarypy.spice.spicer import MoonSpicer, MarsSpicer
SPICE with planetarypy
HOWTO
Several useful SPICE related HOWTOs posssible to do with
planetarypy
Surface calculations on the Moon
= MoonSpicer("2022-02-22") moon
moon.time.isoformat()
'2022-02-22T00:00:00'
moon.solar_constant
\(1388.4482 \; \mathrm{\frac{W}{m^{2}}}\)
=0, lon=0) moon.set_spoint_by(lat
= 180
moon.aspect = 30 moon.tilt
moon.F_flat
\(497.68762 \; \mathrm{\frac{W}{m^{2}}}\)
moon.F_aspect
\(449.48514 \; \mathrm{\frac{W}{m^{2}}}\)
moon.F_tilt
\(412.53511 \; \mathrm{\frac{W}{m^{2}}}\)
moon.subsolar
array([ 622.78676959, -1621.28270346, -46.23629622])
moon.local_soltime
'16:35:58'
# MoonSpicer returns km (as all calculations in SPICE do)
# use astropy.units to convert to other values
"EARTH")[0]) * u.km norm(moon.body_to_object(
\(375365.92 \; \mathrm{km}\)
"MARS")[0]) * u.km).to(u.AU) (norm(moon.body_to_object(
\(2.0379563 \; \mathrm{AU}\)
= MarsSpicer() mars
mars.utc
'2023-06-27T18:37:50.876055'
mars.l_s
83.31658188802474
'inca') mars.goto(
mars.spoint
(220.09830399469547, -440.60853011059214, -3340.5081261541495)
=180
mars.aspect=30 mars.tilt
mars.F_flat
\(0 \; \mathrm{\frac{W}{m^{2}}}\)
mars.F_aspect
\(0 \; \mathrm{\frac{W}{m^{2}}}\)
=0, lon=0) mars.set_spoint_by(lat
mars.F_flat
\(339.2043 \; \mathrm{\frac{W}{m^{2}}}\)
mars.F_tilt
\(397.92501 \; \mathrm{\frac{W}{m^{2}}}\)