Receive the list of supported datasets for automatic retrieval of archived SPICE kernels
The supported datasets are tabled here at NAIF: https://naif.jpl.nasa.gov/naif/data_archived.html
Receive the list of required SPICE kernels for a given mission and time range
Automatic download of kernels for a given mission and time range either into a given location or the planetarypy local archive.
As always in planetarypy the general design philosophy is to first develop a management class to give the user full control over all the details, and then add easy-to-use function for the end-user that do the most frequently used things in one go. (See section “User Functions”)
Identifying and downloading kernel sets
One repeating task for SPICE calculations is the identification and retrieval of all SPICE kernels for a mission for a given time interval.
The folks at NAIF offer a “Subset” feature at their servers. Here we set up a table of the currently supported datasets:
Now we build a management class for wrapping the Perl script available at below’s URL for accessing subsets of these datasets.
First, the basic URLs we will use:
The Perl script subsetds.pl (the name at the end of the BASE_URL) requires as input:
the dataset name
start and stop of the time interval
a constant named “Subset” to identify the action for this Perl script
We can assemble these parameters into a payload dictionary for the requests.get call and we manage different potential actions on the zipfile with a Subsetter class, that only requires the mission identifier, start and stop as parameters.
KPL/MK
This meta-kernel lists a subset of kernels from the meta-kernel
cas_2011_v17.tm provided in the CO-S/J/E/V-SPICE-6-V1.0 SPICE PDS3 archive,
covering the whole or a part of the customer requested time period
from 2011-02-13T00:00:00.000 to 2011-02-14T00:00:00.000.
The documentation describing these kernels can be found in the
complete CO-S/J/E/V-SPICE-6-V1.0 SPICE PDS3 archive available at this URL
https://naif.jpl.nasa.gov/pub/naif/pds/data/co-s_j_e_v-spice-6-v1.0/cosp_1000
To use this meta-kernel users may need to modify the value of the
PATH_VALUES keyword to point to the actual location of the archive's
``data'' directory on their system. Replacing ``/'' with ``\''
and converting line terminators to the format native to the user's
system may also be required if this meta-kernel is to be used on a
non-UNIX workstation.
This meta-kernel was created by the NAIF node's SPICE PDS archive
subsetting service version 2.1 on Mon Jun 19 08:13:34 PDT 2023.
\begindata
PATH_VALUES = (
'/home/ayek72/mnt/slowdata/planetarypy/spice_kernels/cassini'
)
PATH_SYMBOLS = (
'KERNELS'
)
KERNELS_TO_LOAD = (
'$KERNELS/lsk/naif0012.tls'
'$KERNELS/pck/pck00010.tpc'
'$KERNELS/fk/cas_rocks_v18.tf'
'$KERNELS/fk/cas_mimi_v202.tf'
'$KERNELS/fk/cas_dyn_v03.tf'
'$KERNELS/fk/cas_v41.tf'
'$KERNELS/ik/cas_caps_v03.ti'
'$KERNELS/ik/cas_cda_v01.ti'
'$KERNELS/ik/cas_cirs_v09.ti'
'$KERNELS/ik/cas_inms_v02.ti'
'$KERNELS/ik/cas_iss_v10.ti'
'$KERNELS/ik/cas_mag_v01.ti'
'$KERNELS/ik/cas_mimi_v11.ti'
'$KERNELS/ik/cas_radar_v11.ti'
'$KERNELS/ik/cas_rpws_v01.ti'
'$KERNELS/ik/cas_rss_v03.ti'
'$KERNELS/ik/cas_sru_v02.ti'
'$KERNELS/ik/cas_uvis_v06.ti'
'$KERNELS/ik/cas_vims_v06.ti'
'$KERNELS/sclk/cas00172.tsc'
'$KERNELS/spk/180927AP_RE_90165_18018.bsp'
'$KERNELS/spk/140809BP_IRRE_00256_25017.bsp'
'$KERNELS/spk/110504R_SCPSE_11041_11093.bsp'
'$KERNELS/ck/11001_12001pa_gapfill_v14.bc'
'$KERNELS/ck/11017_11066py_as_flown.bc'
'$KERNELS/ck/11044_11049ra.bc'
'$KERNELS/ck/cas_cda_20120517.bc'
'$KERNELS/ck/cas_lemms_05109_20001_v2.bc'
)
\begintext
The metakernel is correctly adapted, however for these tests, I didn’t download the kernels again
!cat {mkpath}
KPL/MK
This meta-kernel lists a subset of kernels from the meta-kernel
cas_2011_v17.tm provided in the CO-S/J/E/V-SPICE-6-V1.0 SPICE PDS3 archive,
covering the whole or a part of the customer requested time period
from 2011-02-13T00:00:00.000 to 2011-02-14T00:00:00.000.
The documentation describing these kernels can be found in the
complete CO-S/J/E/V-SPICE-6-V1.0 SPICE PDS3 archive available at this URL
https://naif.jpl.nasa.gov/pub/naif/pds/data/co-s_j_e_v-spice-6-v1.0/cosp_1000
To use this meta-kernel users may need to modify the value of the
PATH_VALUES keyword to point to the actual location of the archive's
``data'' directory on their system. Replacing ``/'' with ``\''
and converting line terminators to the format native to the user's
system may also be required if this meta-kernel is to be used on a
non-UNIX workstation.
This meta-kernel was created by the NAIF node's SPICE PDS archive
subsetting service version 2.1 on Mon Jun 19 08:13:34 PDT 2023.
\begindata
PATH_VALUES = (
'.'
)
PATH_SYMBOLS = (
'KERNELS'
)
KERNELS_TO_LOAD = (
'$KERNELS/lsk/naif0012.tls'
'$KERNELS/pck/pck00010.tpc'
'$KERNELS/fk/cas_rocks_v18.tf'
'$KERNELS/fk/cas_mimi_v202.tf'
'$KERNELS/fk/cas_dyn_v03.tf'
'$KERNELS/fk/cas_v41.tf'
'$KERNELS/ik/cas_caps_v03.ti'
'$KERNELS/ik/cas_cda_v01.ti'
'$KERNELS/ik/cas_cirs_v09.ti'
'$KERNELS/ik/cas_inms_v02.ti'
'$KERNELS/ik/cas_iss_v10.ti'
'$KERNELS/ik/cas_mag_v01.ti'
'$KERNELS/ik/cas_mimi_v11.ti'
'$KERNELS/ik/cas_radar_v11.ti'
'$KERNELS/ik/cas_rpws_v01.ti'
'$KERNELS/ik/cas_rss_v03.ti'
'$KERNELS/ik/cas_sru_v02.ti'
'$KERNELS/ik/cas_uvis_v06.ti'
'$KERNELS/ik/cas_vims_v06.ti'
'$KERNELS/sclk/cas00172.tsc'
'$KERNELS/spk/180927AP_RE_90165_18018.bsp'
'$KERNELS/spk/140809BP_IRRE_00256_25017.bsp'
'$KERNELS/spk/110504R_SCPSE_11041_11093.bsp'
'$KERNELS/ck/11001_12001pa_gapfill_v14.bc'
'$KERNELS/ck/11017_11066py_as_flown.bc'
'$KERNELS/ck/11044_11049ra.bc'
'$KERNELS/ck/cas_cda_20120517.bc'
'$KERNELS/ck/cas_lemms_05109_20001_v2.bc'
)
\begintext
/Users/maye/mambaforge/envs/py39/lib/python3.9/site-packages/distributed/node.py:182: UserWarning: Port 8787 is already in use.
Perhaps you already have a cluster running?
Hosting the HTTP server on port 57624 instead
warnings.warn(
ck 11001_12001pa_gapfill_v14.bc locally available.
ck 11017_11066py_as_flown.bc locally available.
ck 11044_11049ra.bc locally available.
ck cas_cda_20120517.bc locally available.
ck cas_lemms_05109_20001_v2.bc locally available.
fk cas_dyn_v03.tf locally available.
fk cas_mimi_v202.tf locally available.
fk cas_rocks_v18.tf locally available.
fk cas_v41.tf locally available.
ik cas_caps_v03.ti locally available.
ik cas_cda_v01.ti locally available.
ik cas_cirs_v09.ti locally available.
ik cas_inms_v02.ti locally available.
ik cas_iss_v10.ti locally available.
ik cas_mag_v01.ti locally available.
ik cas_mimi_v11.ti locally available.
ik cas_radar_v11.ti locally available.
ik cas_rpws_v01.ti locally available.
ik cas_rss_v03.ti locally available.
ik cas_sru_v02.ti locally available.
ik cas_uvis_v06.ti locally available.
ik cas_vims_v06.ti locally available.
lsk naif0012.tls locally available.
pck pck00010.tpc locally available.
sclk cas00172.tsc locally available.
spk 110504R_SCPSE_11041_11093.bsp locally available.
spk 140809BP_IRRE_00256_25017.bsp locally available.
spk 180927AP_RE_90165_18018.bsp locally available.
def _test_mission_kernels_available(mission):print("Doing", mission) start = datasets.at[mission, "Start Time"] end = datasets.at[mission, "Stop Time"] half = Time(start) + (Time(end) - Time(start)) /2print("Half time:", half)try: found = list_kernels_for_day(mission, half)exceptIndexError:print("Problem with", mission)else:print(f"Found {len(found)} kernels for {mission}")for mission in datasets.index: _test_mission_kernels_available(mission)
Doing bc
Half time: 2020-11-25 00:00:00.000
Found 41 kernels for bc
Doing cassini
Half time: 2007-09-30 12:00:01.000
Found 32 kernels for cassini
Doing clementine
Half time: 1994-03-17 12:00:00.000
Found 19 kernels for clementine
Doing dart
Half time: 2035-12-06 00:00:00.000
Found 14 kernels for dart
Doing dawn
Half time: 2013-04-14 00:00:00.000
Found 21 kernels for dawn
Doing di
Half time: 2005-04-26 12:00:00.000
Found 16 kernels for di
Doing ds1
Half time: 2000-05-21 11:59:59.500
Found 11 kernels for ds1
Doing epoxi
Half time: 2008-05-27 00:00:00.000
Found 12 kernels for epoxi
Doing em16
Half time: 2019-08-07 23:59:59.500
Found 27 kernels for em16
Doing grail
Half time: 2012-04-29 00:00:00.500
Found 20 kernels for grail
Doing hayabusa
Half time: 2005-10-15 12:00:00.000
Found 15 kernels for hayabusa
Doing insight
Half time: 2020-08-24 12:00:00.000
Found 21 kernels for insight
Doing juno
Half time: 2017-02-08 23:59:58.500
Found 25 kernels for juno
Doing ladee
Half time: 2031-11-04 11:59:59.000
Found 12 kernels for ladee
Doing lro
Half time: 2016-04-30 23:59:59.500
Found 24 kernels for lro
Doing maven
Half time: 2018-07-25 11:59:59.000
Found 20 kernels for maven
Doing opportunity
Half time: 2010-12-23 00:00:00.500
Found 23 kernels for opportunity
Doing spirit
Half time: 2006-11-20 12:00:00.000
Found 24 kernels for spirit
Doing messenger
Half time: 2009-12-15 23:59:59.500
Found 18 kernels for messenger
Doing mars2020
Half time: 2021-10-13 12:00:00.000
Found 17 kernels for mars2020
Doing mex
Half time: 2013-03-01 11:59:59.500
Found 39 kernels for mex
Doing mgs
Half time: 2001-11-03 23:59:59.500
Found 20 kernels for mgs
Doing ody
Half time: 2012-01-03 12:00:00.500
Found 14 kernels for ody
Doing mro
Half time: 2014-06-06 11:59:59.500
Found 20 kernels for mro
Doing msl
Half time: 2017-05-16 23:59:58.500
Found 50 kernels for msl
Doing near
Half time: 1998-10-14 12:00:00.000
Found 15 kernels for near
Doing nh
Half time: 2013-01-08 12:00:00.000
Found 28 kernels for nh
Doing orex
Half time: 2018-11-30 23:59:59.500
warnings.warn('ERFA function "{}" yielded {}'.format(func_name, wmsg),
warnings.warn('ERFA function "{}" yielded {}'.format(func_name, wmsg),
warnings.warn('ERFA function "{}" yielded {}'.format(func_name, wmsg),
warnings.warn('ERFA function "{}" yielded {}'.format(func_name, wmsg),
OSError: SPICE Server request returned status code: {r.status_code}
NOTE: Any ErfaWarnings above are caused by the LADEE mission using a kernel up to 2050, and the astropy.Time module warns about potential precicision issues regarding unknown leapseconds that will be put in in the future.
Generic kernel management
There are a few generic kernels that are required for basic illumination calculations as supported by this package.