rsspice 0.1.0

Pure Rust port of the SPICE Toolkit for space geometry
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
//! #  SPK Required Reading
//!
//!  Last revised on 2021 AUG 31 by B. V. Semenov.
//!
//!  
//!
//!
//!  
//! ##  Abstract
//!
//!  The SPK system is the component of SPICE concerned with ephemeris data.
//!
//!  
//!
//!
//!  
//! ###  Purpose
//!
//!  The purpose of this document is to describe the SPICE Toolkit software
//!    provided in the software library SPICELIB, (SPICE LIBrary) used for
//!    producing and accessing SPICE ephemeris data. In addition this document
//!    describes SPK---the common file format for NAIF's S-kernel and ephemeris
//!    portion of the P-kernel.
//!
//!  
//!
//!
//!  
//! ###  Intended Audience
//!
//!  This document is intended for all users of SPK (ephemeris) kernel files.
//!
//!  
//!
//!
//!  
//! ###  References
//!
//!  All references are to NAIF documents. The notation \[Dn] refers to NAIF
//!    document number.
//!
//!  
//!
//! *  1. \[349] Frames Required Reading ([frames.req](crate::required_reading::frames))
//!
//!  *  2. \[174] CK Required Reading ([ck.req](crate::required_reading::ck))
//!
//!  *  3. \[254] PCK Required Reading ([pck.req](crate::required_reading::pck))
//!
//!  *  4. \[222] Spacecraft Clock Time Required Reading ([sclk.req](crate::required_reading::sclk))
//!
//!  *  5. \[218] KERNEL Required Reading ([kernel.req](crate::required_reading::kernel))
//!
//!  *  6. \[219] NAIF IDS Required Reading ([naif_ids.req](crate::required_reading::naif_ids))
//!
//!  *  7. \[163] JPL Internal Memorandum on Modified Difference Array polynomials; F.
//! Krogh
//!
//!  *  8. \[164] Precession Matrix Based on IAU (1976) System of Astronomical
//! Constants; E. M. Standish; Astronomy and Astrophysics 73, 282-284 (1979)
//!
//!  *  9. \[165] Orientation of the JPL Ephemerides, DE200/LE200, to the Dynamical
//! Equinox of J2000; E. M. Standish; Astronomy and Astrophysics 114, 297-302
//! (1982)
//!
//!  *  10. \[166] The JPL Asteroid and Comet Database (as Implemented by NAIF); a
//! collection of papers and memos; assembled by I. Underwood; 11 Dec 1989
//!
//!  *  11. \[167] Double Precision Array Files (DAF) - Required Reading; latest version
//! ([daf.req](crate::required_reading::daf))
//!
//!  *  12. \[212] COMMNT User's Guide ([commnt.ug](crate::raw::commnt.ug))
//!
//!     
//! ###  DAF Run-Time Binary File Format Translation
//!
//!  Starting with the N0052 release of the SPICE Toolkit (January, 2002)
//!    certain supported platforms are able to read DAF-based binary files
//!    (SPK, CK and binary PCK) that were written using a different, or
//!    non-native, binary representation. This access is read-only; any
//!    operations requiring writing to the file (adding information to the
//!    comment area, or appending additional ephemeris data, for example)
//!    require prior conversion of the file to the native binary file format.
//!    See the Convert User's Guide, [convert.ug](crate::raw::convert.ug), for details.
//!
//!  
//!
//!
//!  
//! ###  Detection of Non-native Text Files
//!
//!  Starting with the N0057 release of the SPICE Toolkit (March, 2004) the
//!    SPICE data loading mechanism detects and prohibits loading text kernel
//!    files containing lines terminated with EOF character(s) non-native to
//!    the platform on which the Toolkit was compiled. If a non-native EOL
//!    terminator is detected in the first 132 characters of a text kernel, the
//!    execution is stopped and an error message is displayed. This feature
//!    does not work with files that are smaller than 132 bytes or have the
//!    first line longer than 132 characters.
//!
//!  
//!
//!
//!  
//! ##  If you're in a hurry
//!
//!  We'll discuss things in more detail in a moment but in case you are just
//!    looking for the right name of the routine to perform some ephemeris
//!    task, here is a categorization of the most frequently used SPK and
//!    related routines in SPICELIB. Input arguments are given in lower case
//!    and enclosed in "angle brackets." Output arguments are given in upper
//!    case.
//!
//!  
//!
//!
//!  
//! ###  High Level Routines
//!
//!  Loading/Unloading an SPK file
//!
//!  
//!
//! ```text
//!    FURNSH ( <file> )
//!    UNLOAD ( <file> )
//! ```
//!
//!  Getting coverage summary
//!
//!  
//!
//! ```text
//!    SPKOBJ ( <file>, IDS )
//!    SPKCOV ( <file>, <idcode>, COVER )
//! ```
//!
//!  Retrieving states (position and velocity) using names of objects
//!
//!  
//!
//! ```text
//!    SPKEZR ( <object>, <et>, <frame>, <corr>, <observer>, STATE, LT )
//! ```
//!
//!  Retrieving positions using names of objects
//!
//!  
//!
//! ```text
//!    SPKPOS ( <object>, <et>, <frame>, <corr>, <observer>, POSTN, LT )
//! ```
//!
//!  Retrieving states using NAIF ID codes
//!
//!  
//!
//! ```text
//!    SPKEZ  ( <obj_id>, <et>, <frame>, <corr>, <obj_id>, STATE, LT )
//!  
//!    SPKGEO ( <obj_id>, <et>, <frame>,         <obj_id>, STATE, LT )
//! ```
//!
//!  Retrieving positions using NAIF ID codes
//!
//!  
//!
//! ```text
//!    SPKEZP ( <obj_id>, <et>, <frame>, <corr>, <obj_id>, POSTN, LT )
//!  
//!    SPKGPS ( <obj_id>, <et>, <frame>,         <obj_id>, POSTN, LT )
//! ```
//!
//!  Calculating "Uplink and Downlink" Light Time
//!
//!  
//!
//! ```text
//!    LTIME ( <etobs>, <obs_id>, <dir>, <targ_id>, ETTARG, ELAPSD )
//! ```
//!
//!  Loading/Unloading Binary PCK files (see PCK Required Reading, [pck.req](crate::required_reading::pck))
//!
//!  
//!
//! ```text
//!    FURNSH ( <binary_pck> )
//!    UNLOAD ( <binary_pck> )
//! ```
//!
//!  Loading Text based kernels---PCK, SCLK, etc.
//!
//!  
//!
//! ```text
//!    FURNSH ( <text_kernel> )
//! ```
//!
//!  Loading/Unloading C-kernels (see CK Required Reading, [ck.req](crate::required_reading::ck))
//!
//!  
//!
//! ```text
//!    FURNSH ( <c-kernel> )
//!    UNLOAD ( <c-kernel> )
//! ```
//!
//!     
//! ###  Foundation Routines
//!
//!  The routines listed in this section are the real "work horses" of the
//!    SPK and related systems. Not all of the routines in this section are
//!    described in this document. In those cases, the appropriate SPICE
//!    document is cited.
//!
//!  Selecting files and segments
//!
//!  
//!
//! ```text
//!    SPKSFS ( <target>, <et>, HANDLE, DESCR, IDENT, FOUND )
//! ```
//!
//!  Computing states from segment descriptors
//!
//!  
//!
//! ```text
//!    SPKPVN ( <handle>, <descr>, <et>, REF, STATE, CENTER )
//! ```
//!
//!  Correcting for stellar aberration
//!
//!  
//!
//! ```text
//!    STELAB ( POBJ, VOBS, APPOBJ )
//!    STLABX ( POBJ, VOBS, CORPOS )
//! ```
//!
//!  Translating between object names and object ID codes (see NAIF_IDS
//!    Required Reading, [naif_ids.req](crate::required_reading::naif_ids))
//!
//!  
//!
//! ```text
//!    BODN2C ( <name>,   IDCODE, FOUND )
//!    BODC2N ( <idcode>, NAME,   FOUND )
//! ```
//!
//!  Translating between frame names and frame ID codes (see Frames Required
//!    Reading, [frames.req](crate::required_reading::frames))
//!
//!  
//!
//! ```text
//!    FRMNAM ( <idcode>, NAME   )
//!    NAMFRM ( <name>,   IDCODE )
//! ```
//!
//!  State transformation matrices (see Frames Required Reading, [frames.req](crate::required_reading::frames))
//!
//!  
//!
//! ```text
//!    SXFORM ( <from_name>,   <to_name>,   <et>, MAT6X6 )
//!    FRMCHG ( <from_idcode>, <to_idcode>, <et>, MAT6X6 )
//! ```
//!
//!  Classifying frames (see Frames Required Reading, [frames.req](crate::required_reading::frames))
//!
//!  
//!
//! ```text
//!    FRINFO ( <idcode>, CENTER, CLASS, CLSSID, FOUND )
//! ```
//!
//!     
//! ###  Utility Programs
//!
//!  Examining SPK files
//!
//!  
//!
//! ```text
//!    brief
//!    commnt
//!    spacit
//! ```
//!
//!  Converting to and from transfer format
//!
//!  
//!
//! ```text
//!    spacit
//!    tobin
//!    toxfr
//! ```
//!
//!     
//! ##  Introduction
//!
//!  To help fully understand the science data returned from a spacecraft's
//!    instruments it is necessary to know, at any given epoch, the positions
//!    and possibly the velocities of the spacecraft and all the target bodies
//!    of interest. The purpose of the SPK---which stands for S(pacecraft) and
//!    P(lanet) Kernel---file is to allow ephemerides for any collection of
//!    solar system bodies to be combined under a common file format, and
//!    accessed by a common set of subroutines.
//!
//!  Historically, ephemerides for spacecraft have been organized differently
//!    from those for planets and satellites. They are usually generated
//!    through different processes and using different representations.
//!    However, there is no essential reason for keeping them separate. A
//!    spacecraft, planet, satellite, comet, or asteroid has a position and
//!    velocity relative to some center of mass and reference frame.
//!    Consequently all of these objects can be represented in an SPK file.
//!
//!  Consider the Galileo mission. Some of the objects of special interest to
//!    the Galileo mission are:
//!
//!  
//!
//! ```text
//!    Galileo Spacecraft
//!    Galileo Probe
//!    Earth
//!    Moon
//!    Earth Moon Barycenter
//!    Venus
//!    Sun
//!    Solar System Barycenter (S.S.B.)
//!    Asteroid Ida
//!    Ida's Satellite Dactyl
//!    Asteroid Gaspra
//!    Comet Shoemaker-Levy
//!    Jupiter System Barycenter (J.B.)
//!    Jupiter
//!    Io
//!    Ganymede
//!    Europa
//!    Callysto
//!    Goldstone Tracking Station.
//! ```
//!
//!  Each of these objects has a position and velocity (state) relative to
//!    some other object. The graph below illustrates which objects will be
//!    used as reference objects for representing the states of others.
//!
//!  
//!
//! ```text
//!                           +Gll
//!                          /             probe
//!                         /               |    o Comet
//!                 Gaspra /             Gll+   /  Shoemaker Levy
//!          Gll +--o     /                  \ /
//!                 |    /   Venus    Jupiter o--probe
//!                 |   /      o--+           |
//!     Gll +       |  /      /   Gll         |  Io
//!         |       | /      /                |  o-----+Gll
//!         |       |/      /             J.B.| /
//!    Ida  o-------o------o------------------o ----o------+Gll
//!        /         Sun   S.S.B.            / \    Europa
//!       o                 \      Ganymede /   \
//!    Dactyl                \             o     \
//!                           \            |      o Callisto
//!     Earth-Moon Barycenter  o----o      +      |
//!                            |   Moon    Gll    |
//!                            |                  + Gll
//!                            o Earth
//!                           / \
//!                          /   \
//!                         /     + Gll
//!                        o
//!                     Goldstone
//! ```
//!
//!  This graph is somewhat complicated. Nevertheless, the complete ephemeris
//!    history for all of these objects can be captured in a single SPK file.
//!
//!  (Although we can store the entire ephemeris history illustrated above in
//!    a single SPK file, for the sake of data management a project is likely
//!    to use several SPK files. However, even in this case, all of the SPK
//!    files can be used simultaneously.)
//!
//!  The SPK format is supported by a collection of subroutines that are part
//!    of the SPICELIB library---the major component of the SPICE Toolkit. This
//!    family of SPK subroutines provides the following capabilities:
//!
//!  
//!
//! *  1. Insert ephemeris data from some source into an SPK file.
//!
//!  *  2. Make the ephemeris data in one or more SPK files available to a user's
//! program.
//!
//!  *  3. Return the apparent, true, or geometric state (position and velocity) of
//! one ephemeris object as seen from another in some convenient reference
//! frame.
//!
//!  The SPK software allows you to ignore the potential ephemeris complexity
//!    associated with the a mission such as Galileo and allows you to more
//!    directly compute various quantities that depend upon the position or
//!    velocity of one object as seen from another.
//!
//!  
//!
//!
//!  
//! ##  SPK Files
//!
//!  SPICE software writes SPK files in a binary (non-ASCII) format
//!    structured in a NAIF developed abstract file architecture called Double
//!    Precision Array File (DAF). The DAF architecture and supporting software
//!    is discussed in the DAF Required Reading document, [daf.req](crate::required_reading::daf). The SPICE
//!    file identification word occupying the first eight bytes of a properly
//!    created binary SPK file is "DAF/SPK ". For more information on SPICE
//!    identification words refer to the Kernel Required Reading document,
//!    [kernel.req](crate::required_reading::kernel). If you need only use SPK files as a data source or if you
//!    will use a SPICE utility program for creating SPK files, you can safely
//!    ignore aspects of the DAF system not covered by this document. On the
//!    other hand, if you plan to write software for creating SPK files you
//!    will probably need to familiarize yourself with the DAF software
//!    contained in SPICELIB. The particular aspects of the DAF architecture
//!    that are relevant to the SPK format are discussed later in this document
//!    (see below---SPK Format).
//!
//!  Since SPKs are written as binary files, the specific binary format
//!    depends on the computer architecture on which the SPK was created, in
//!    the case of SPICE either big-endian or little-endian (NAIF no longer
//!    supports DEC platforms).
//!
//!  
//!
//!
//!  
//! ###  Use of SPK files between computers
//!
//!  NAIF extended the DAF capability in SPICE Toolkit delivery N0052 to
//!    allow reading of both big-endian and little-endian binary DAF files by
//!    all toolkits. This process is a run-time interpretation of non-native
//!    binary files. Run-time interpretation does not yet work for any file
//!    built upon the SPICE "DAS" architecture.
//!
//!  NAIF provides two utility programs---TOXFR and SPACIT for converting
//!    SPICE binary kernels to a "transfer format" suitable for text copying
//!    from one computer to another. Once the transfer format file has been
//!    copied, the SPICE utilities TOBIN and SPACIT are available for
//!    converting the transfer format file to the binary format suitable for
//!    the new machine.
//!
//!  The utilities TOXFR and TOBIN are "command line" programs. To convert
//!    a binary kernel to transfer format you simply type TOXFR followed by the
//!    name of the binary kernel at your terminal prompt.
//!
//!  
//!
//! ```text
//!    prompt> toxfr spk_file
//! ```
//!
//!  To convert a transfer format to binary format, you type TOBIN followed
//!    by the name of the transfer format kernel.
//!
//!  
//!
//! ```text
//!    prompt> tobin transfer_file
//! ```
//!
//!  The utility SPACIT is an interactive program that allows you to select a
//!    function from a menu to perform on a file. This program can also be used
//!    to convert to or from transfer format files.
//!
//!  Note that transfer format files cannot be "loaded" into a SPICE based
//!    program to retrieve ephemeris data. Only binary format files can be used
//!    for retrieving ephemeris data with SPICE software.
//!
//!  CSPICE (and by extension Icy and Mice) uses the same binary kernels as
//!    does SPICELIB.
//!
//!  
//!
//!
//!  
//! ###  Examining SPK files
//!
//!  Since SPK files are binary files, you can't just open them with your
//!    favorite text editor to determine which ephemeris objects are
//!    represented in the file. Instead you need to use one of the SPICE
//!    utility programs that allow you to summarize the ephemeris contents of
//!    an SPK file. The first of these is SPACIT which was introduced above.
//!    The second is the command line utility BRIEF.
//!
//!  BRIEF gives a quick summary of the contents of the file and supports a
//!    wide set of summary options. SPACIT on the other hand, provides
//!    summaries that are more detailed and reflect closely the actual internal
//!    structure of the file. Unless you need the more detailed summary, you'll
//!    probably find BRIEF to be a better tool for examining the contents of an
//!    SPK file.
//!
//!  
//!
//!
//!  
//! ###  Meta Data in the SPK file
//!
//!  SPICE kernels may contain "meta" data that describe the contents,
//!    intended use, accuracy, etc. of the kernel. This meta data is called the
//!    "comments" portion of the kernel. Many SPK files contain comments that
//!    can help you decide upon the suitability of the kernel for your
//!    application. Two SPICE utilities are available for examining the
//!    comments of a binary kernel---COMMNT and SPACIT.
//!
//!  We've already introduced SPACIT. COMMNT is similar to SPACIT in that it
//!    too is an interactive program. However, COMMNT also allows you to modify
//!    the comments of an SPK file. Using COMMNT you can delete the comments of
//!    an SPK file, extract the comments to a text file, or append the text
//!    from some text file to the comments already present in the kernel.
//!
//!  If you create SPK files, we strongly recommend that you add comments to
//!    the kernel that describe who created it, expected usage of the kernel,
//!    and the expected accuracy of the position/velocity information contained
//!    in the kernel. A comment template is provided in the appendix
//!    "COMMENTS".
//!
//!  Warning: If you add comments to an SPK (or other binary kernel) using
//!    COMMNT, you must wait for the program to complete the task before
//!    exiting the program. Failure to wait for COMMNT to finish its work will
//!    result in irreparable corruption of the binary kernel. (See the COMMNT
//!    User's Guide, [commnt.ug](crate::raw::commnt.ug), \[212] for details on the use of COMMNT).
//!
//!  
//!
//!
//!  
//! ###  Terminology
//!
//!  Throughout this document we shall be using terms such as reference
//!    frame, state, ephemeris time, etc. We include a brief review of these
//!    terms below.
//!
//!  
//!
//! *  Reference Frame
//!
//!
//!  A reference frame is a Cartesian coordinate system with three axes---x,
//! y and z. The axes are mutually orthogonal. The center of the frame is
//! the origin of the Cartesian reference system. For the reference frames
//! in SPICE, the positions of the axes are typically defined by some
//! observable object. For example, in the J2000 reference frame, the
//! x-axis is defined to lie in the intersection of two planes: the plane
//! of the Earth's equator and the plane of the Earth's orbit. The z-axis
//! is perpendicular to the Earth's equator. The y-axis completes a
//! right-handed system. The center of the frame is typically taken to be
//! the solar system barycenter. (Note we are not attempting to rigorously
//! define the J2000 frame here. We are only illustrating how reference
//! frames are defined. Many more details are required for a rigorous
//! definition of the J2000 frame. These details are given in the SPICE
//! document "Frames" \[349].)
//!
//!  *  State
//!
//!
//!  A state is an array of six double precision numbers. The first three
//! numbers give the x, y, and z coordinates respectively for the position
//! of some object relative to another object in some Cartesian reference
//! frame. The next three numbers give the velocity ( dx/dt, dy/dt and
//! dz/dt respectively) of the object with respect to the same reference
//! frame.
//!
//!  *  Inertial Frame
//!
//!
//!  An inertial frame, is one in which Newton's laws of motion apply. A
//! frame whose axes are not moving with respect to the observed positions
//! of distant galaxies and quasars approximates an inertial frame.
//!
//!  *  Non-Inertial Frame
//!
//!
//!  A non-inertial frame is a frame that rotates with respect to the
//! celestial background. For example a frame whose axes are fixed with
//! respect to the features on the surface of the Earth is a non-inertial
//! frame.
//!
//!  *  Ephemeris Time (ET)
//!
//!
//!  Ephemeris time, ET, is the independent variable in the equations of
//! motion that describe the positions and velocities of objects in the
//! solar system. In SPICELIB we treat ET as a synonym for Barycentric
//! Dynamical Time. As far as has been experimentally determined, an atomic
//! clock placed at the solar system barycenter, would provide a faithful
//! measure of ET.
//!
//!  *  Seconds Past 2000
//!
//!
//!  In the SPK system times are specified as a count of seconds past a
//! particular epoch---the epoch of the J2000 reference frame. This
//! reference epoch is within a second or two of the UTC epoch:
//! 12:01:02.184 Jan 1, 2000 UTC. (See the document [time.req](crate::required_reading::time) for a more
//! thorough discussion of the J2000 epoch). Epochs prior to this epoch are
//! represented as negative numbers. The "units" of ET are designated in
//! several different ways: seconds past 2000, seconds past J2000, seconds
//! past the Julian year 2000, seconds past the epoch of the J2000 frame.
//! All of these phrases mean the same thing and are used interchangeably
//! throughout this document.
//!
//!  *  SPK segment
//!
//!
//!  The trajectories of objects in SPK files are represented in pieces
//! called segments. A segment represents some arc of the full trajectory
//! of an object. Each segment contains information that specifies the
//! trajectory of a particular object relative to a particular center of
//! motion in a fixed reference frame over some particular interval of
//! time. From the point of view of the SPK system segments are the atomic
//! portions of a trajectory.
//!
//!     
//! ##  The SPK Family of Subroutines
//!
//!  SPICELIB contains a family of subroutines that are designed specifically
//!    for use with SPK files. The name of each routine begins with the letters
//!    'SPK', followed by a two- or three-character mnemonic. For example, the
//!    routine that returns the state of one body with respect to another is
//!    named [SPKEZR](crate::raw::spkezr), pronounced 'S-P-K-easier'. A complete list of mnemonics,
//!    translations, and calling sequences can be found at the end of this
//!    document.
//!
//!  Each subroutine is prefaced by a complete SPICELIB header, which
//!    describes inputs, outputs, restrictions, and exceptions, discusses the
//!    context in which the subroutine can be used, and shows typical examples
//!    of its use. Any discussion of the subroutines in this document is
//!    intended as an introduction: the final documentation for any subroutine
//!    is its header.
//!
//!  Whenever an SPK subroutine appears in an example, the translation of the
//!    mnemonic part of its name will appear to the right of the reference, in
//!    braces. We also continue with the convention of distinguishing between
//!    input and output arguments by listing input arguments in lower case and
//!    enclosed in angle brackets. For example,
//!
//!  
//!
//! ```text
//!     CALL SPKEZR ( <targ>,  <et>, <frame>,
//!    .              <aberr>, <obs>,
//!    .              STATE,    LT          ) { Easier state }
//! ```
//!
//!  All subroutines and functions, including those whose names do not begin
//!    with 'SPK', are from SPICELIB.
//!
//!  Code examples will make use of the structured DO ... END DO and DO WHILE
//!    ... END DO statements supported by most Fortran compilers.
//!
//!  SPK readers are available to perform the following functions.
//!
//!  
//!
//! *  1. Determine the apparent, true, or geometric state of a body with respect to
//! another body relative to a user specified reference frame.
//!
//!  *  2. Determine the apparent, true, or geometric state of a body with respect to
//! an observer having a user-supplied state.
//!
//!  *  3. Determine the geometric state of a body with respect to the solar system
//! barycenter.
//!
//!  *  4. Determine the geometric state of a target body with respect to its center
//! of motion for a particular segment.
//!
//!  *  5. Determine, from a list of SPK files supplied by the calling program, the
//! files and segments needed to fulfill a request for the state of a
//! particular body.
//!
//!     
//! ###  Computing States
//!
//!  [SPKEZR](crate::raw::spkezr) is the most powerful of the SPK readers. It determines the
//!    apparent, true, or geometric state of one body (the target) as seen by a
//!    second body (the observer) relative to a user specified reference frame.
//!
//!  
//!
//! ```text
//!     CALL SPKEZR ( <targ>,  <et>, <frame>,
//!    .              <aberr>, <obs>,
//!    .              STATE,    LT          ) { Easier state }
//! ```
//!
//!  The subroutine accepts five inputs---target body, epoch, reference
//!    frame, aberration correction type, and observing body---and returns two
//!    outputs---state of the target body as seen from the observing body, and
//!    one-way light-time from the target body to the observing body.
//!
//!  The target body, observing body and frame are identified by strings that
//!    contain the names of these items. For example, to determine the state of
//!    Triton as seen from the Voyager-2 spacecraft relative to the J2000
//!    reference frame
//!
//!  
//!
//! ```text
//!     CALL SPKEZR ( 'TRITON', ET, 'J2000', ABERR,
//!    .              'VOYAGER-2',   STATE,  LT )      { Easier state }
//! ```
//!
//!  By definition, the ephemerides in SPK files are continuous: the user can
//!    obtain states at any epoch within the interval of coverage. Epochs are
//!    always specified in ephemeris seconds past the epoch of the J2000
//!    reference system (Julian Ephemeris Date 2451545.0 ) For example, to
//!    determine the state of Triton as seen from Voyager-2 at Julian Ephemeris
//!    Date 2447751.8293,
//!
//!  
//!
//! ```text
//!     ET = ( 2447751.8293D0 - J2000() ) * SPD()
//!  
//!     CALL SPKEZR ( 'TRITON', ET, 'J2000', <aberr>,
//!    .              'VOYAGER-2',   STATE,  LT )      { Easier state }
//! ```
//!
//!  where the function J2000 returns the epoch of the J2000 frame (Julian
//!    Ephemeris Date 2451545.0) and the function [SPD](crate::raw::spd) returns the number of
//!    seconds per Julian day (86400.0).
//!
//!  The ephemeris data in an SPK file may be referenced to a number of
//!    different reference frames. States returned by [SPKEZR](crate::raw::spkezr) do not have to be
//!    referenced to any of these "native" frames. The user can specify that
//!    states are to be returned in any of the frames recognized by the frame
//!    subsystem. For example, to determine the state of Triton as seen from
//!    Voyager-2, referenced to the J2000 ecliptic reference frame,
//!
//!  
//!
//! ```text
//!     CALL SPKEZR ( 'TRITON', ET, 'ECLIPJ2000', ABERR,
//!    .              'VOYAGER-2',   STATE,       LT )    { Easier state }
//! ```
//!
//!  [SPKEZR](crate::raw::spkezr) returns apparent, true, or geometric states depending on the
//!    value of the aberration correction type flag ABERR.
//!
//!  Apparent states are corrected for planetary aberration, which is the
//!    composite of the apparent angular displacement produced by motion of the
//!    observer (stellar aberration) and the actual motion of the target body
//!    (correction for light-time). True states are corrected for light-time
//!    only. Geometric states are uncorrected.
//!
//!  Instead of using the potentially confusing terms 'true' and 'geometric'
//!    to specify the type of state to be returned, [SPKEZR](crate::raw::spkezr) requires the
//!    specific corrections to be named. To compute apparent states, specify
//!    correction for both light-time and stellar aberration: 'LT+S'. To
//!    compute true states, specify correction for light-time only: 'LT'. To
//!    compute geometric states, specify no correction: 'NONE'.
//!
//!  In all cases, the one-way light-time from the target to the observer is
//!    returned along with the state.
//!
//!  
//!
//!
//!  
//! ###  Computing States using Constant-Velocity or Constant-Position Objects
//!
//!  Objects such as tracking stations, rover or spacecraft components, or
//!    fixed surface points can be treated by the SPK subsystem as ephemeris
//!    objects just as easily as bodies such as planets and natural satellites.
//!    For example, using an SPK file for the geocentric location of a tracking
//!    station enables [SPKEZR](crate::raw::spkezr) to compute states of targets relative to the
//!    tracking station, providing all needed kernel data have been loaded.
//!
//!  However, it is not always convenient to create an SPK file to provide
//!    data for an ephemeris object, particularly when that object's location
//!    is known only at run time.
//!
//!  For an object that has constant velocity, relative to a specified center
//!    of motion, in a specified reference frame, SPICE offers a set of
//!    routines to compute states relative to other ephemeris objects, where
//!    the other objects have ephemeris data provided by SPK files:
//!
//!  
//!
//! ```text
//!    SPKCPO  {SPK, constant position observer state}
//!    SPKCPT  {SPK, constant position target state}
//!    SPKCVO  {SPK, constant velocity observer state}
//!    SPKCVT  {SPK, constant velocity target state}
//! ```
//!
//!  The "constant position" routines have simplified interfaces; these
//!    handle the special case where the constant velocity is zero.
//!
//!  Each of the above routines requires that sufficient SPK data be
//!    available to compute the state of the center of motion, relative to the
//!    other ephemeris object, of the constant-velocity or constant-position
//!    object.
//!
//!  States computed by SPK routines for constant-velocity or
//!    constant-position objects optionally can be corrected for light time and
//!    stellar aberration, just as is done by [SPKEZR](crate::raw::spkezr).
//!
//!  A limitation of representing objects using constant velocities or
//!    positions, instead of creating SPK files to provide the ephemerides of
//!    those objects, is that high-level SPICE geometry routines such as [SINCPT](crate::raw::sincpt)
//!    or [SUBPT](crate::raw::subpt) cannot work with such objects---these routines require SPK data
//!    for all ephemeris objects participating in the computations they
//!    perform.
//!
//!  
//!
//!
//!  
//! ###  The Computation of Light Time
//!
//!  The light time corrected position component of a state vector returned
//!    by the SPK system is the 3-vector difference
//!
//!  
//!
//! ```text
//!    TARGET_SSB ( ET + S*LT )  - OBSERVER_SSB ( ET )
//! ```
//!
//!  where TARGET_SSB and OBSERVER_SSB give the position of the target and
//!    observer relative to the solar system barycenter, and where S is -1 for
//!    reception corrections (where light travels from the target to the
//!    observer) and 1 for transmission corrections (where light travels from
//!    the observer to the target).
//!
//!  LT is the unique number that satisfies:
//!
//!  
//!
//! ```text
//!          | TARGET_SSB ( ET + S*LT )  -  OBSERVER_SSB ( ET ) |
//!    LT =  ----------------------------------------------------
//!                            Speed of Light
//! ```
//!
//!  where
//!
//!  
//!
//! ```text
//!    | position |
//! ```
//!
//!  indicates the length of a position vector.
//!
//!  The velocity portion of the returned state is the derivative with
//!    respect to the observation time ET of the light time corrected position.
//!
//!  Mathematically, LT can be computed to arbitrary precision via the
//!    following algorithm:
//!
//!  
//!
//! ```text
//!    LT_0 = 0
//!  
//!  
//!  
//!            | TARGET_SSB ( ET - LT_(i-1) ) - OBSERVER_SSB ( ET ) |
//!    LT_i =  ------------------------------------------------------
//!                               Speed of Light
//!  
//!  
//!       for i = 1, ...
//! ```
//!
//!  It can be shown that the sequence LT_0, LT_1, LT_2, ... converges to LT
//!    geometrically. Moreover, it can be shown that the difference between
//!    LT_i and LT satisfies the following inequality.
//!
//!  
//!
//! ```text
//!                                  i
//!    | LT - LT_i | < LT_i * ( V/C )  / ( 1 - V/C )
//!  
//!       for i = 1, ...
//! ```
//!
//!  where V is the maximum speed of the target body with respect to the
//!    solar system barycenter and C is the speed of light.
//!
//!  
//!
//!
//!  
//! ###  Precision of Light Time Computations
//!
//!  Let's examine the error we make if we use LT_2 as an approximation for
//!    LT. This is an analysis of precision; we'll ignore errors in the data
//!    and those in the input times.
//!
//!  For nearly all objects in the solar system V is less than 60 km/sec. The
//!    value of C is approximately 300000 km/sec. Thus V/C is 2.0E-4, and the
//!    one iteration solution for LT (in which the target-SSB vector is
//!    corrected once) has a potential relative error of not more than 4.0E-8.
//!    This is a potential light time error of approximately 2.0E-5 seconds per
//!    astronomical unit of distance separating the observer and target. Thus
//!    as long as the observer and target are separated by less than 50
//!    Astronomical Units, the error in the light time returned using option
//!    'LT' is less than 1 millisecond.
//!
//!  For this reason, SPICE uses LT_2 to approximate LT when you request a
//!    light time corrected state by setting the aberration correction argument
//!    in [SPKEZR](crate::raw::spkezr) to any of 'LT', 'XLT', 'LT+S', 'XLT+S'.
//!
//!  The maximum error in the light time corrected target-SSB position vector
//!    is larger by a factor of C/V than V times the maximum relative light
//!    time error. This is because the (i-1)st light time estimate is used to
//!    compute the ith estimate of target-SSB position vector. Given the
//!    assumptions above, the maximum position error for the 'LT'-style
//!    correction is bounded by
//!
//!  
//!
//! ```text
//!    60 km/s * (1/(2.0E-4)) * 2*1.0E-5 s / AU
//! ```
//!
//!  or 6 km per astronomical unit of distance separating the observer and
//!    target.
//!
//!  In practice, the difference between positions obtained using
//!    one-iteration and converged light time is usually much smaller than the
//!    value computed above and can be insignificant. For example, for the
//!    spacecraft Mars Reconnaissance Orbiter and Mars Express, the position
//!    error for the one-iteration light time correction, applied to the
//!    spacecraft-to-Mars center vector, is approximately 2 cm.
//!
//!  You can make [SPKEZR](crate::raw::spkezr) (and other applicable SPK routines) compute a better
//!    approximation to LT and compute more accurate light-time corrected
//!    states by commanding that it compute a "converged Newtonian" value for
//!    LT. To do this set the light time portion of the aberration correction
//!    specification to 'CN' (the possible such aberration correction
//!    specifications are'CN', 'XCN', 'CN+S', or 'XCN+S'). [SPKEZR](crate::raw::spkezr) will then
//!    return a converged value, usually equal to LT_4, as the approximation
//!    for light time; the returned state will be converged as well. Then the
//!    maximum error in LT_4 is less than
//!
//!  
//!
//! ```text
//!    1.0E-3 * (V/C)**2 seconds
//! ```
//!
//!  which is less than 4e-11 seconds for any observer/target pair in the
//!    solar system that satisfies the assumptions above. The corresponding
//!    position error bound is 1.2 cm at a separation of 50 AU.
//!
//!  However, you should note that this is a purely Newtonian approximation
//!    to the light time. To model the actual light time between target and
//!    observer one must take into account effects due to General relativity.
//!    These may be as high as a few hundredths of a millisecond for some
//!    geometric cases.
//!
//!  The routines in the SPK family do not attempt to perform either general
//!    or special relativistic corrections in computing the various aberration
//!    corrections. For many applications relativistic corrections are not
//!    worth the expense of added computation cycles. If, however, your
//!    application requires these additional corrections we suggest you consult
//!    the astronomical almanac (page B36) for a discussion of how to carry out
//!    these corrections.
//!
//!  
//!
//!
//!  
//! ###  Light Time Corrected Non-Inertial States
//!
//!  When we observe a distant object, we don't see it as it is at the moment
//!    of observation. We see it as it was when the photons we have sensed were
//!    emitted by or reflected from the object. Thus when we look at Mars
//!    through a telescope, we see it not as it is now, but rather as it was
//!    one "light-time" ago. This is true not only for the position of Mars,
//!    but for its orientation as well.
//!
//!  Suppose that a large balloon has been launched into the Martian
//!    atmosphere and we want to determine the Mars bodyfixed state of the
//!    balloon as seen from Earth at the epoch ET. We need to determine both
//!    the light time corrected position of the balloon, and the light time
//!    corrected orientation of Mars. To do this we compute two light times.
//!    The light time to the center of the Mars bodyfixed frame (i.e. the
//!    center of Mars) and the light time to the balloon. Call the light time
//!    to the center of the Mars frame LT_F and call the light time to the
//!    balloon LT_T. The light time corrected state of the balloon relative to
//!    the Mars bodyfixed frame is the location of the balloon at ET - LT_T in
//!    the bodyfixed frame of Mars as oriented at ET - LT_F.
//!
//!  [SPKEZR](crate::raw::spkezr) carries out all of these computations automatically. In this case
//!    the computation would be computed by a subroutine call similar to this:
//!
//!  
//!
//! ```text
//!     CALL SPKEZR ( 'Mars_balloon', <et>, 'IAU_MARS', 'LT', 'EARTH',
//!    .               STATE, LT  )
//! ```
//!
//!  [SPKEZR](crate::raw::spkezr) uses the following rules when computing states.
//!
//!  
//!
//! *  1. When no corrections are requested from [SPKEZR](crate::raw::spkezr) (ABCORR = 'NONE'), the state
//! of the target is determined at the request time ET and is represented in
//! the specified reference frame as it is oriented at time ET.
//!
//!  *  2. When light time corrections are requested from [SPKEZR](crate::raw::spkezr) (ABCORR = 'LT'), two
//! light times are determined: LT_F the light time to the center of the
//! specified reference frame, and LT_T the light time to the target. The state
//! of the target is given as it was at ET - LT_T in the frame as it was
//! oriented at ET - LT_F.
//!
//!  *  3. When light time and stellar aberrations are requested from [SPKEZR](crate::raw::spkezr) (ABCORR =
//! 'LT+S'), both LT_F and LT_T are again computed. The state of the target at
//! ET - LT_T is corrected for stellar aberration and represented in the
//! reference frame as it was oriented at ET - LT_F.
//!
//!  *  4. Light-time corrected velocities are computed taking into account the rate
//! of change of light time both between observer and target and between
//! observer and the center of the non-inertial frame. The rate of change of
//! the target frame's orientation is accounted for as well.
//!
//!  In the actual implementation of [SPKEZR](crate::raw::spkezr) a few short cuts are taken. When
//!    light time requested states relative to an inertial frame are requested,
//!    the orientation of the frame is not corrected for light time. The
//!    orientation of an inertial frame at ET - LT_F is the same as the
//!    orientation of the frame at ET. Computations involving inertial frames
//!    take advantage of this observation and avoid redundant computations.
//!
//!  
//!
//!
//!  
//! ###  An example
//!
//!  Here we illustrate how you could use [SPKEZR](crate::raw::spkezr) together with other SPICELIB
//!    routines to determine if at a particular epoch ET the Mars Global
//!    Surveyor spacecraft is occulted by Mars.
//!
//!  We will need the lengths of the axes of the triaxial ellipsoid that is
//!    used to model the surface of Mars. Either of the SPICELIB routines
//!    [BODVCD](crate::raw::bodvcd) or [BODVRD](crate::raw::bodvrd) will retrieve this information from a loaded PCK file.
//!    [BODVRD](crate::raw::bodvrd) uses the name of the body, while [BODVCD](crate::raw::bodvcd) uses the NAIF ID code for
//!    Mars (499) to retrieve the lengths of the axes. We may call [BODVCD](crate::raw::bodvcd) as
//!    shown:
//!
//!  
//!
//! ```text
//!    CALL BODVCD ( 499, 'RADII', 3, NVALS, AXES )
//!  
//!    A = AXES(1)
//!    B = AXES(2)
//!    C = AXES(3)
//! ```
//!
//!  Next we compute the state of Mars relative to Earth and the state of MGS
//!    relative to Earth in the Mars bodyfixed frame.
//!
//!  
//!
//! ```text
//!     CALL SPKEZR ( 'MARS',  ET, 'IAU_MARS', 'LT+S', 'EARTH',
//!    .               MARSST, LT )
//!     CALL SPKEZR ( 'MGS',   ET, 'IAU_MARS', 'LT+S', 'EARTH',
//!    .               MGSST,  LT ) {Easier State}
//! ```
//!
//!  Compute the apparent position of the Earth relative to Mars in the
//!    apparent Mars bodyfixed frame. This means simply negating the components
//!    of MARSST. The SPICELIB routine [VMINUS](crate::raw::vminus) carries out this task.
//!
//!  
//!
//! ```text
//!    CALL VMINUS ( MARSST, ESTATE )
//! ```
//!
//!  Determine if the line of sight from Earth to MGS intersects the surface
//!    of Mars. The SPICELIB routine [SURFPT](crate::raw::surfpt) will find this intersection point
//!    if it exists.
//!
//!  
//!
//! ```text
//!    CALL SURFPT ( ESTATE, MGSST, A, B, C, POINT, FOUND )
//! ```
//!
//!  Finally, if a point of intersection was found, was it between the Earth
//!    and the MGS spacecraft. To find out we can compare the distances between
//!    the intersection point and the spacecraft. The SPICELIB function [VNORM](crate::raw::vnorm) computes the length of the vector from Earth to MGS. The function [VDIST](crate::raw::vdist) computes the distance between the point and the Earth.
//!
//!  
//!
//! ```text
//!    IF ( FOUND ) THEN
//!       BETWN = VDIST( ESTATE, POINT ) .LT. VNORM ( MGSST )
//!    ELSE
//!       BETWN = .FALSE.
//!    END IF
//!  
//!    IF ( BETWN ) THEN
//!       WRITE (*,*) 'MGS is behind Mars'
//!    ELSE
//!       WRITE (*,*) 'MGS is not behind Mars'
//!    END IF
//! ```
//!
//!     
//! ###  Integer ID Codes Used in SPK
//!
//!  Low level SPK software uses integer codes to identify ephemeris objects,
//!    reference frames and data representation, etc. At low levels of the
//!    SPICE system only integer codes are used to communicate information
//!    about objects. To some extent, these codes are a historical artifact in
//!    the design of the SPICE system. Nevertheless, these integer codes
//!    provide economies in the development of SPICE software.
//!
//!  High-level SPICE software uses names (character strings) to refer to the
//!    various SPICE objects and translates between names and integer codes.
//!    Thus to some extent you can disregard the integer codes used by the
//!    SPICE internals. However, occasionally, due to the introduction of new
//!    ephemeris objects, the name translation software will be unable to find
//!    a name associated with an ID code. To retrieve states for such an object
//!    you will need to use the integer code for the object in question. If you
//!    are using [SPKEZR](crate::raw::spkezr), you can supply this integer code as a quoted string.
//!    For example the following two subroutine calls will both return the
//!    state of TRITON as seen from Voyager-2. (The NAIF integer code for
//!    TRITON is 801; the NAIF integer code for Voyager 2 is -32).
//!
//!  
//!
//! ```text
//!     CALL SPKEZR ( 'TRITON', ET, 'ECLIPJ2000', ABERR,
//!    .              'VOYAGER-2',   STATE,       LT )    { Easier state }
//!  
//!  
//!     CALL SPKEZR ( '801',   ET, 'ECLIPJ2000', ABERR,
//!    .              '-32',        STATE,       LT )    { Easier state }
//! ```
//!
//!  Consult the NAIF IDS Required Reading file, [naif_ids.req](crate::required_reading::naif_ids), for the
//!    current list of body codes recognized by the SPICE Toolkit software.
//!
//!  
//!
//!
//!  
//! ###  [SPKEZ](crate::raw::spkez) and [SPKGEO](crate::raw::spkgeo)
//!
//!  [SPKEZR](crate::raw::spkezr) relies upon two lower level routines that may be useful under
//!    certain circumstances.
//!
//!  The routine [SPKEZ](crate::raw::spkez) performs the same functions as [SPKEZR](crate::raw::spkezr). The only
//!    difference is the means by which objects are specified. [SPKEZ](crate::raw::spkez) requires
//!    that the target and observing bodies be specified using the NAIF integer
//!    ID codes for those bodies.
//!
//!  
//!
//! ```text
//!    SPKEZ ( <targ_id>, <et>, <frame>, <corr>, <obj_id>,
//!             STATE,    LT )  { SPK Easy }
//! ```
//!
//!  The NAIF-ID codes for ephemeris objects are listed in the NAIF_IDS
//!    required reading file, [naif_ids.req](crate::required_reading::naif_ids).
//!
//!  [SPKEZ](crate::raw::spkez) is useful in those situations when you have ID codes for objects
//!    stored as integers. There is also a modest efficiency gain when using
//!    integer ID codes instead of character strings to specify targets and
//!    observers.
//!
//!  The routine [SPKGEO](crate::raw::spkgeo) returns only geometric (uncorrected) states. The
//!    following two subroutine calls are equivalent.
//!
//!  
//!
//! ```text
//!     CALL SPKEZ  ( <targ_id>, <et>, <frame>,
//!    .              'NONE',    <obj_id>,
//!    .              STATE,     LT )               {SPK Easy}
//!  
//!     CALL SPKGEO ( <targ_id>, <et>, <frame>,
//!                   <obj_id>,
//!    .              STATE,     LT )               {SPK Geometric }
//! ```
//!
//!  [SPKGEO](crate::raw::spkgeo) involves slightly less overhead than does [SPKEZ](crate::raw::spkez) and thus may be
//!    marginally faster than calling [SPKEZ](crate::raw::spkez).
//!
//!  
//!
//!
//!  
//! ###  Loading Files
//!
//!  Note that [SPKEZR](crate::raw::spkezr), [SPKEZ](crate::raw::spkez) and [SPKGEO](crate::raw::spkgeo) do not require the name of an SPK
//!    file as input. These routines rely on the lower level routine in the SPK
//!    subsystem to maintain a database of ephemeris files. Your application
//!    program indicates which files are to be used by passing their names to
//!    routine [FURNSH](crate::raw::furnsh) -- "generic loader" that can be used to load SPICE
//!    kernel files of any type.
//!
//!  
//!
//! ```text
//!    DO I = 1, N
//!       CALL FURNSH ( ephem(I) )      { Load kernel file }
//!    END DO
//! ```
//!
//!  In general, a state returned by [SPKEZR](crate::raw::spkezr) is built from several more
//!    primitive states. Consider the following diagram, which shows some of
//!    the states that might be needed to determine the state of the Galileo
//!    spacecraft as seen from Earth:
//!
//!  
//!
//! ```text
//!             Jupiter_Barycenter --- Europa
//!             /                       \
//!            /                         \
//!           /                          Spacecraft
//!          /
//!         /
//!        /
//!       /
//!    SSB
//!       \
//!        \
//!         \
//!         EMB --- Earth
//! ```
//!
//!  (SSB and EMB are the solar system and Earth-Moon barycenters.)
//!
//!  Each state is computed from a distinct segment. The segments may reside
//!    in a single SPK file, or may be contained in as many as five separate
//!    files. For example, the segments needed to compute the Earth-spacecraft
//!    state shown above might come from the following set of files:
//!
//!  
//!
//! ```text
//!    CALL FURNSH ( 'barycenters.bsp'    )  { Load kernel file }
//!    CALL FURNSH ( 'planet-centers.bsp' )  { Load kernel file }
//!    CALL FURNSH ( 'satellites.bsp'     )  { Load kernel file }
//!    CALL FURNSH ( 'spacecraft.bsp'     )  { Load kernel file }
//! ```
//!
//!  or from the following set:
//!
//!  
//!
//! ```text
//!    CALL FURNSH ( 'earth.bsp'      )      { Load kernel file }
//!    CALL FURNSH ( 'jupiter.bsp'    )      { Load kernel file }
//!    CALL FURNSH ( 'spacecraft.bsp' )      { Load kernel file }
//! ```
//!
//!     
//! ###  Data Precedence
//!
//!  An SPK file may contain any number of segments. A single file may
//!    contain overlapping segments: segments containing data for the same body
//!    over a common interval. When this happens, the latest segment in a file
//!    supersedes any competing segments earlier in the file. Similarly, the
//!    latest file loaded supersedes any earlier files. In effect, several
//!    loaded files become equivalent to one large file.
//!
//!  
//!
//!
//!  
//! ###  Unloading Files
//!
//!  The number of SPK files that may be loaded at any one time is limited
//!    but very large -- up to 5000 total for all loaded SPK, CK, and binary
//!    PCK files combined. Although unlikely, in some cases your application
//!    program may need to unload some SPK files to make room for others or to
//!    remove a particular SPK from the set of loaded data. An SPK file may be
//!    unloaded by supplying its name to subroutine [UNLOAD](crate::raw::unload) -- "generic
//!    unloader" that can be used to unload SPICE kernel of any type. The
//!    sequence of statements shown below,
//!
//!  
//!
//! ```text
//!    CALL FURNSH ( 'file.a' )     { Load kernel file }
//!    CALL FURNSH ( 'file.b' )     { Load kernel file }
//!    CALL FURNSH ( 'file.c' )     { Load kernel file }
//!    CALL UNLOAD ( 'file.b' )     { Unload kernel file }
//!    CALL FURNSH ( 'file.d' )     { Load kernel file }
//!    CALL UNLOAD ( 'file.c' )     { Unload kernel file }
//! ```
//!
//!  is equivalent to the following (shorter) sequence:
//!
//!  
//!
//! ```text
//!    CALL FURNSH ( 'file.a' )     { Load kernel file }
//!    CALL FURNSH ( 'file.d' )     { Load kernel file }
//! ```
//!
//!     
//! ###  Getting Coverage Summary
//!
//!  The SPICELIB includes two routines for obtaining information about the
//!    contents of an SPK file from within an application.
//!
//!  The [SPKOBJ](crate::raw::spkobj) routine provides an API via which an application can find the
//!    set of bodies for which a specified SPK file contains data. The body IDs
//!    are returned in a SPICE "set" data structure (see [sets.req](crate::required_reading::sets)).
//!
//!  The [SPKCOV](crate::raw::spkcov) routine provides an API via which an application can find the
//!    time periods for which a specified SPK file provides data for an body of
//!    interest. The coverage information is a set of disjoint time intervals
//!    returned in a SPICE "window" data structure (see [windows.req](crate::required_reading::windows)).
//!
//!  Refer to the headers of [SPKOBJ](crate::raw::spkobj) and [SPKCOV](crate::raw::spkcov) for details on the use of
//!    those routines.
//!
//!  
//!
//!
//!  
//! ###  Loading Auxiliary Files
//!
//!  Prior to the inclusion of non-inertial frames in the SPK system, the
//!    states of objects computed by the SPK system required only that you load
//!    the correct SPK files and call the correct subroutines. The inertial
//!    frame transformations needed for converting from one inertial frame to
//!    another are "hard wired" into the SPICE system. The transformations
//!    are part of the object code of the SPICELIB library---no additional data
//!    need be supplied to compute these transformations. This approach to
//!    carrying out inertial frame transformations was chosen because the
//!    transformations are compactly represented and do not change as the
//!    result of further observations. They are essentially definitions.
//!
//!  On the other hand, the orientation of non-inertial frames with respect
//!    to other frames are almost always the result of observation. They are
//!    improved and extended as further observations are made. For some of
//!    these frames (such as spacecraft fixed frames) very large data sets are
//!    needed to express the orientation of the frame with respect to other
//!    frames. Frame transformations that are a function of time and require
//!    megabytes of data are not suitable for encapsulation in FORTRAN source
//!    code. As a result, in the SPICE system, the computation of non-inertial
//!    frame transformations depends upon data stored in other SPICE kernels.
//!    If you request states relative to a non-inertial frame or use
//!    ephemerides that are represented relative to non-inertial frames you
//!    must load additional SPICE kernels. The method by which an auxiliary
//!    kernel is loaded depends upon the type of the kernel.
//!
//!  There are currently five classes of reference frames that are supported
//!    by the SPICE system. We give a brief overview of these frames here. For
//!    a more thorough discussion of the various types of frames see the
//!    recommended reading file "[frames.req](crate::required_reading::frames)."
//!
//!  Inertial frames
//!
//!  
//!
//! *  Inertial frames are built into the SPICE system. You don't need to do
//! anything to make their definitions available to your program. Inertial
//! frames have NAIF ID codes whose values are in the range from 1 to 10000.
//!
//!  PCK frames
//!
//!  
//!
//! *  PCK frames are bodyfixed frames. The orientation of a PCK frame is always
//! expressed relative to an inertial frame. The relationship between a PCK
//! frame and its associated inertial frame is provided by a PCK kernel. PCK
//! frames have ID codes between 10000 and 100000. There are two types of PCK
//! kernels---binary and text. Binary PCK kernels are loaded (and unloaded) in
//! a fashion analogous to the loading and unloading of SPK files. To load a
//! binary PCK file
//!
//!  ```text
//!             CALL FURNSH ( <file> )
//! ```
//!  *  To unload a binary PCK file
//!
//!  ```text
//!             CALL UNLOAD ( <file> )
//! ```
//!  *  Text based PCK files are loaded via the routine [FURNSH](crate::raw::furnsh).
//!
//!  ```text
//!             CALL FURNSH ( <file> )
//! ```
//!  CK Frames
//!
//!  
//!
//! *  CK frames are frames that are defined relative to a spacecraft structure.
//! The orientation of the structure is provided through a binary SPICE kernel
//! called a C-kernel. The ID codes for C-kernel frames are negative and
//! usually less than -999. A C-kernel frame may be defined relative to any
//! other kind of frame. (Most existing C-kernels are defined relative to
//! inertial frames.)
//!
//!  *  C-kernels are loaded and unloaded using the same loader routines as used to
//! load and unload SPK kernels. To load a C-kernel
//!
//!  ```text
//!             CALL FURNSH ( <file> )
//! ```
//!  *  To unload a C-kernel
//!
//!  ```text
//!             CALL UNLOAD ( <file> )
//! ```
//!  *  The times used to represent C-kernels are spacecraft clock times---not ET.
//! The relationship between ET and spacecraft clock times is stored in a SPICE
//! text kernel called a spacecraft clock kernel---usually abbreviated as SCLK
//! (ess-clock) kernel. To retrieve states relative to a CK frame you need to
//! make the relationship between ET and the spacecraft clock available to your
//! program by loading the appropriate SCLK kernel. SCLK kernels are loaded via
//! the routine [FURNSH](crate::raw::furnsh).
//!
//!  ```text
//!             CALL FURNSH ( <sclk_file_name> )
//! ```
//!  TK Frames
//!
//!  
//!
//! *  TK frames (short for Text Kernel frames) are frames that are defined via a
//! SPICE text kernel. These frames can be transformed to another reference
//! frame via a constant rotation matrix. Typical examples are topocentric
//! frames and instrument frames. TK frames are loaded via the routine [FURNSH](crate::raw::furnsh).
//!
//!  ```text
//!             CALL FURNSH ( <TK_frame_file> )
//! ```
//!  Dynamic Frames
//!
//!  
//!
//! *  Dynamic frames, like TK frames, are defined via a SPICE text kernel. A
//! dynamic frame has time-varying rotation relative to its base frame. A
//! dynamic frame can be defined by two time-varying vectors, by a set of
//! precession, nutation, and obliquity models, or by a set of Euler angles.
//! Typical examples are the geocentric solar ecliptic frame or the Earth true
//! equator and true equinox of date frame. Dynamic frames are loaded via the
//! routine [FURNSH](crate::raw::furnsh).
//!
//!  ```text
//!             CALL FURNSH ( <Dynamic_frame_file> )
//! ```
//!  In addition to the files mentioned above, it may be necessary to load a
//!    "frame definition" file along with the one of the SPICE kernels listed
//!    above. (If the producer of the file has done his or her homework this
//!    step should be unnecessary.) The frame definition file is a SPICE text
//!    kernel that specifies the type of the frame, the center of the frame,
//!    the name of the frame, and its ID code. (See [frames.req](crate::required_reading::frames) for more details
//!    concerning frame definitions.)
//!
//!  As is evident from the above discussion, the use of non-inertial frames
//!    requires more data management on the part of the user of the SPICE
//!    system. However, this data management problem is not a new problem. In
//!    previous versions of the SPICE system the same kernels would have been
//!    required. Moreover, in previous versions of the SPICE system, you would
//!    have been required to perform all non-inertial transformations in your
//!    own code. With the inclusion of non-inertial frames in the SPK system,
//!    we have relieved you of some of the tasks associated with non-inertial
//!    frames.
//!
//!  
//!
//!
//!  
//! ##  SPK File Structure
//!
//!  An SPK file is made up of one or more data "segments" and a
//!    "comment" area. These components are described below.
//!
//!  
//!
//!
//!  
//! ###  Segments--The Fundamental SPK Building Blocks
//!
//!  An SPK file contains one or more "segments." Each segment contains
//!    ephemeris data sufficient to compute the geometric state (position and
//!    velocity) of one solar system body (the 'target') with respect to
//!    another (the 'center') at any epoch throughout some finite interval of
//!    time.
//!
//!  Either body may be a spacecraft, a planet or planet barycenter, a
//!    satellite, a comet, an asteroid, a tracking station, a roving vehicle,
//!    or an arbitrary point for which an ephemeris has been calculated. Each
//!    body in the solar system is associated with a unique integer code. A
//!    list of names and codes for the planets, major satellites, spacecraft,
//!    asteroids and comets can be found in the document [naif_ids.req](crate::required_reading::naif_ids)
//!
//!  The states computed from the ephemeris data in a segment must be
//!    referenced to a single, recognized reference frame.
//!
//!  The data in each segment are stored as an array of double precision
//!    numbers. The summary for the array, called a 'descriptor', has two
//!    double precision components:
//!
//!  
//!
//! *  1. The initial epoch of the interval for which ephemeris data are contained in
//! the segment, given in ephemeris seconds past Julian year 2000.
//!
//!  *  2. The final epoch of the interval for which ephemeris data are contained in
//! the segment, given in ephemeris seconds past Julian year 2000.
//!
//!  The descriptor has six integer components:
//!
//!  
//!
//! *  1. The NAIF integer code for the target.
//!
//!  *  2. The NAIF integer code for the center.
//!
//!  *  3. The NAIF integer code for the reference frame.
//!
//!  *  4. The integer code for the representation (type of ephemeris data).
//!
//!  *  5. The initial address of the array.
//!
//!  *  6. The final address of the array.
//!
//!  In addition to a descriptor, each array also has a name. The name of
//!    each array may contain up to 40 characters. This space may be used to
//!    store a brief description of the segment. For example, the name may
//!    contain pedigree information concerning the segment or may contain the
//!    name of the object whose position is recorded in the segment.
//!
//!  
//!
//!
//!  
//! ###  Segment Order and Priority
//!
//!  Segments within an SPK file need not be ordered according to time;
//!    segments covering (that is, providing data for) a later time period may
//!    precede segments covering an earlier time period.
//!
//!  However, segment order does imply priority. For a given target body,
//!    segment priority increases with distance from the start of the file:
//!    segments closer to the end of the file have higher priority than
//!    segments for the same target body that occur earlier in the file. When a
//!    data request for a specified target body is made, the segment for that
//!    target body with highest priority, and whose time interval includes the
//!    request time, will be selected to satisfy the request.
//!
//!  SPK producers should note that this priority scheme would cause a higher
//!    priority segment for a target body to mask a lower priority segment for
//!    the same body over the intersection of the coverage intervals of the two
//!    segments, if two such segments were written to an SPK file. In
//!    particular, if an SPK file contained two segments for the same target
//!    body and time interval, where the segments had different central bodies,
//!    the lower priority segment would be invisible to the SPK system.
//!
//!  
//!
//!
//!  
//! ###  The Comment Area
//!
//!  Preceding the 'segments', the Comment Area provides space in the SPK
//!    file for storing textual information besides what is written in the
//!    array names. Ideally, each SPK file would contain internal documentation
//!    that describes the origin, recommended use, and any other pertinent
//!    information about the data in that file. For example, the beginning and
//!    ending epochs for the file, the names and NAIF integer codes of the
//!    bodies included, an accuracy estimate, the date the file was produced,
//!    and the names of the source files used in making the SPK file could be
//!    included in the Comment Area.
//!
//!  The utility programs COMMNT and SPACIT may be used to examine and
//!    manipulate the comments in an SPK file. In addition to these utilities,
//!    SPICELIB provides a family of subroutines for handling this Comment
//!    Area. The name of each routine in this family begins with the letters
//!    'SPC' which stand for 'SPk and Ck' because this feature is common to
//!    both types of files. The SPC software provides the ability to add,
//!    extract, read, and delete comments and convert commented files from
//!    binary format to SPICE transfer format and back to binary again.
//!
//!  The SPC routines and their functions are described in detail in the SPC
//!    Required Reading, [spc.req](crate::required_reading::spc).
//!
//!  
//!
//!
//!  
//! ###  SPK Data Types
//!
//!  The fourth integer component of the descriptor---the code for the
//!    representation, or 'data type'---is the key to the SPK format.
//!
//!  For purposes of determining the segment best suited to fulfill a
//!    particular request, all segments are treated equally. It is only when
//!    the data in a segment are to be evaluated---when a state vector is to be
//!    computed---that the type of data used to represent the ephemeris becomes
//!    important.
//!
//!  Because this step is isolated within a single low-level reader, [SPKPVN](crate::raw::spkpvn),
//!    new data types can be added to the SPK format without affecting
//!    application programs that use the higher level readers. [SPKPVN](crate::raw::spkpvn) is
//!    designed so that the changes required to implement a new data type are
//!    minimal.
//!
//!  There are no real limits on the possible representations that can be
//!    used for ephemeris data. Users with access to data suitable for creating
//!    an ephemeris may choose to invent their own representations, adapting
//!    [SPKPVN](crate::raw::spkpvn) accordingly. (We recommend that you consult with NAIF prior to
//!    implementing a new data type.)
//!
//!  The data types currently supported by SPICELIB software are listed under
//!    "Supported Data Types" later in this document.
//!
//!  
//!
//!
//!  
//! ##  Primitive States
//!
//!  At the lowest level, it is possible to compute states without combining
//!    them at all. Given the handle and descriptor for a particular segment,
//!    subroutine [SPKPVN](crate::raw::spkpvn) returns a state from that segment directly.
//!
//!  
//!
//! ```text
//!    CALL SPKPVN( <handle>,
//!                 <descr>,
//!                 <et>,
//!                 REF,
//!                 STATE,
//!                 CENTER   )  { Position, velocity, native frame }
//! ```
//!
//!  [SPKPVN](crate::raw::spkpvn) is the most basic SPK reader. It returns states relative to the
//!    frame in which they are stored in the SPK file. It does not rotate or
//!    combine them: it returns a state relative to the center whose integer
//!    code is stored in the descriptor for the segment. This state is relative
//!    to the frame whose integer ID code is also stored in the descriptor of
//!    the segment. The user is responsible for using that state correctly.
//!
//!  The user is also responsible for using DAF subroutines to determine the
//!    particular file and segment from which each state is to be computed.
//!
//!  Note that to use the state returned by [SPKPVN](crate::raw::spkpvn) in any frame other than
//!    the "native frame" of the segment, you must convert the state to the
//!    frame of interest.
//!
//!  A second low level routine [SPKPV](crate::raw::spkpv) can be used to perform the state
//!    transformations for you. The calling sequence for [SPKPV](crate::raw::spkpv) is identical to
//!    that for [SPKPVN](crate::raw::spkpvn). However, in the case of [SPKPV](crate::raw::spkpv) the reference frame is an
//!    input instead of an output argument.
//!
//!  
//!
//! ```text
//!    CALL SPKPV ( <handle>,
//!                 <descr>,
//!                 <et>,
//!                 <ref>,
//!                 STATE,
//!                 CENTER   )  { Position, velocity }
//! ```
//!
//!  Thus using [SPKPV](crate::raw::spkpv) instead of [SPKPVN](crate::raw::spkpvn) allows you to avoid the details of
//!    converting states to the frame of interest.
//!
//!  If files have been loaded by previous calls to [FURNSH](crate::raw::furnsh), it is possible to
//!    use the same segments that would normally be used by [SPKEZR](crate::raw::spkezr), [SPKEZ](crate::raw::spkez),
//!    [SPKSSB](crate::raw::spkssb), and [SPKGEO](crate::raw::spkgeo). Subroutine [SPKSFS](crate::raw::spksfs) selects, from the database of
//!    loaded files, the file handle and segment descriptor for the segment
//!    best suited to the request. If two segments from different files are
//!    suitable, [SPKSFS](crate::raw::spksfs) selects the one from the file that was loaded later. If
//!    two segments from the same file are suitable, [SPKSFS](crate::raw::spksfs) selects the one
//!    that is stored later in the file. The call
//!
//!  
//!
//! ```text
//!    CALL SPKSFS ( <801>,
//!                  <et>,
//!                  HANDLE,
//!                  DESCR,
//!                  SEGNAM,
//!                  FOUND )     { Select file and segment }
//! ```
//!
//!  returns the handle, descriptor, and segment name for the latest segment
//!    containing data for Triton at the specified epoch. [SPKSFS](crate::raw::spksfs) maintains a
//!    buffer of segment descriptors and segment names, so it doesn't waste
//!    time searching the database for bodies it already knows about.
//!
//!  
//!
//!
//!  
//! ##  Examples of Using SPK Readers
//!
//!  
//!
//!
//!  
//! ###  Example 1: Computing Latitude and Longitude
//!
//!  The next several sections present sample programs to show how the SPK
//!    readers can be used to compute state vectors, and how those vectors can
//!    be used to compute derived quantities.
//!
//!  All subroutines and functions used in the examples are from SPICELIB.
//!    The convention of expanding SPK subroutine names will be dropped for
//!    these examples.
//!
//!  The first example program computes the planetocentric latitude and
//!    longitude of the sub-observer point on a target body for any combination
//!    of observer, target, and epoch. (Note that planetocentric coordinates
//!    differ from planetographic and cartographic coordinates in that they are
//!    always right-handed, regardless of the rotation of the body. Also note
//!    that for this example we define the sub-observer point to be the point
//!    on the "surface" of the target that lies on the ray from the center of
//!    the target to the observer. )
//!
//!  
//!
//! ```text
//!          PROGRAM LATLON
//!  
//!    C
//!    C     SPICELIB functions
//!    C
//!          DOUBLE PRECISION  DPR
//!  
//!    C
//!    C     Variables
//!    C
//!          CHARACTER*(32)         TIME
//!          CHARACTER*(32)         OBS
//!          CHARACTER*(32)         TARG
//!  
//!          DOUBLE PRECISION       ET
//!          DOUBLE PRECISION       LAT
//!          DOUBLE PRECISION       LON
//!          DOUBLE PRECISION       LT
//!          DOUBLE PRECISION       RADIUS
//!          DOUBLE PRECISION       STATE  (   6 )
//!          DOUBLE PRECISION       TIBF   ( 3,3 )
//!  
//!    C
//!    C     Load constants into the kernel pool. Two files are
//!    C     needed. The first (`leapseconds.ker') contains the dates
//!    C     of leap seconds and values for constants needed to
//!    C     compute the difference between UTC and ET at any
//!    C     epoch. The second (`pck.ker') contains IAU values
//!    C     needed to compute transformations from inertial
//!    C     (J2000) coordinates to body-fixed (pole and prime
//!    C     meridian) coordinates for the major bodies of the
//!    C     solar system. (These files, or their equivalents,
//!    C     are normally distributed along with SPICELIB.)
//!    C
//!          CALL FURNSH ( 'leapseconds.ker'  )
//!          CALL FURNSH ( 'pck.ker'   )
//!  
//!    C
//!    C     Several ephemeris files are used. Most contain data for
//!    C     a single planetary system (`jupiter.bsp', `saturn.bsp',
//!    C     and so on). Some contain data for spacecraft (`vgr1.bsp',
//!    C     `mgn.bsp').
//!    C
//!          CALL FURNSH ( 'mercury.bsp' )
//!          CALL FURNSH ( 'venus.bsp'   )
//!          CALL FURNSH ( 'earth.bsp'   )
//!          CALL FURNSH ( 'mars.bsp'    )
//!          CALL FURNSH ( 'jupiter.bsp' )
//!          CALL FURNSH ( 'saturn.bsp'  )
//!          CALL FURNSH ( 'uranus.bsp'  )
//!          CALL FURNSH ( 'neptune.bsp' )
//!          CALL FURNSH ( 'pluto.bsp'   )
//!          CALL FURNSH ( 'vgr1.bsp'    )
//!          CALL FURNSH ( 'vgr2.bsp'    )
//!          CALL FURNSH ( 'mgn.bsp'     )
//!          CALL FURNSH ( 'gll.bsp'     )
//!  
//!    C
//!    C     Inputs are entered interactively. The user enters three
//!    C     items: the name for the observer , the name
//!    C     for the target, and the UTC epoch at which the
//!    C     sub-observer point is to be computed (a free-format string).
//!    C
//!    C     The epoch must be converted to ephemeris time (ET).
//!    C
//!          DO WHILE ( .TRUE. )
//!  
//!             CALL PROMPT ( 'Observer? ', OBS  )
//!             CALL PROMPT ( 'Target?   ', TARG )
//!             CALL PROMPT ( 'Epoch ?   ', TIME )
//!  
//!             CALL STR2ET ( TIME, ET )
//!             FRAME = 'IAU_' // TARG
//!  
//!    C
//!    C        Compute the true state (corrected for light-time)
//!    C        of the target as seen from the observer at the
//!    C        specified epoch in the target fixed reference frame.
//!    C
//!             CALL SPKEZR ( TARG, ET, FRAME, 'LT', OBS, STATE, LT )
//!  
//!    C
//!    C        We need  the vector FROM the target TO the observer
//!    C        to compute latitude and longitude. So reverse it.
//!    C
//!             CALL VMINUS ( STATE, STATE )
//!    C
//!    C        Convert from rectangular coordinates to latitude and
//!    C        longitude, then from radians to degrees for output.
//!    C
//!             CALL RECLAT ( STATE, RADIUS, LON, LAT )
//!  
//!             WRITE (*,*)
//!             WRITE (*,*) 'Sub-observer latitude (deg): ', LAT * DPR()
//!             WRITE (*,*) '             longitude     : ', LON * DPR()
//!             WRITE (*,*)
//!             WRITE (*,*) 'Range to target (km)       : ', RADIUS
//!             WRITE (*,*) 'Light-time (sec)           : ', LT
//!             WRITE (*,*)
//!  
//!    C
//!    C        Get the next set of inputs.
//!    C
//!  
//!          END DO
//!  
//!          END
//! ```
//!
//!     
//! ###  Example 2: Faster Latitude and Longitude
//!
//!  The second example computes the same quantities as the first. However,
//!    this program assumes that the observer is always the Magellan spacecraft
//!    and the target is always Venus. It also ignores light-time from the
//!    planet to the spacecraft. These restrictions allow a more primitive
//!    reader, [SPKPV](crate::raw::spkpv), to be substituted for the more general reader, [SPKEZR](crate::raw::spkezr).
//!
//!  [SPKPV](crate::raw::spkpv) returns this same state as [SPKEZR](crate::raw::spkezr), but avoids much of the overhead
//!    associated with [SPKEZR](crate::raw::spkezr)---making the second program somewhat faster than
//!    the first.
//!
//!  However, the second program is much less flexible. For example, if the
//!    spacecraft ephemeris contains cruise data (describing the motion of the
//!    spacecraft relative to the solar system barycenter instead of the planet
//!    center), the program would produce incorrect results.
//!
//!  Furthermore, the program cannot easily be generalized to work for other
//!    orbiters. The motion of the Galileo spacecraft, for instance, would
//!    normally be known relative to the Jupiter barycenter, not to the planet
//!    itself.
//!
//!  
//!
//! ```text
//!          PROGRAM FASTER
//!  
//!    C
//!    C     SPICELIB functions
//!    C
//!          DOUBLE PRECISION  DPR
//!  
//!    C
//!    C     Definitions
//!    C
//!          INTEGER           MGN
//!          PARAMETER       ( MGN = -18 )
//!  
//!          INTEGER           VENUS
//!          PARAMETER       ( VENUS = 299 )
//!  
//!    C
//!    C     Variables
//!    C
//!          CHARACTER*(40)    SEGNAM
//!          CHARACTER*(32)    TIME
//!  
//!          DOUBLE PRECISION  DESCR  (   5 )
//!          DOUBLE PRECISION  ET
//!          DOUBLE PRECISION  LAT
//!          DOUBLE PRECISION  LON
//!          DOUBLE PRECISION  RADIUS
//!          DOUBLE PRECISION  STATE  (   6 )
//!          DOUBLE PRECISION  TIBF   ( 3,3 )
//!  
//!          INTEGER           CENTER
//!          INTEGER           HANDLE
//!  
//!          LOGICAL           FOUND
//!  
//!    C
//!    C     Load constants into the kernel pool. Two files are
//!    C     needed. The first (`leapseconds.ker') contains the dates
//!    C     of leap seconds and values for constants needed to
//!    C     compute the difference between UTC and ET at any
//!    C     epoch. The second (`venus.ker') contains IAU values
//!    C     needed to compute the transformation from inertial
//!    C     (J2000) coordinates to body-fixed (pole and prime
//!    C     meridian) coordinates for Venus.
//!    C
//!          CALL CLPOOL
//!          CALL FURNSH ( 'leapseconds.ker'  )
//!          CALL FURNSH ( 'VENUS.KER' )
//!  
//!    C     Only one ephemeris file is needed. This contains data for
//!    C     the Magellan spacecraft relative to Venus. The states of
//!    C     other bodies are not needed. Note that the file is loaded
//!    C     using lower level SPK loader, SPKLEF, because the handle
//!    C     returned by it will be needed to call other lower level SPK
//!    C     routines.
//!    C
//!          CALL SPKLEF ( 'mgn.bsp', HANDLE )
//!    C
//!    C     Inputs are entered interactively. The user enters only the
//!    C     epoch at which the sub-spacecraft point is to be computed
//!    C     (a free-format string).
//!    C
//!    C
//!    C     The epoch must be converted to ephemeris time (ET).
//!    C
//!          DO WHILE ( .TRUE. )
//!  
//!             CALL PROMPT ( 'Epoch? ', TIME )
//!             CALL STR2ET (  TIME,     ET   )
//!  
//!    C
//!    C        Because the ephemeris file might contain many segments
//!    C        for the spacecraft, we need to select the proper segment
//!    C        each time a state is computed.
//!    C
//!    C        For now, we will assume that a segment is found. A more
//!    C        careful program would check this each time. (If FOUND is
//!    C        ever false, the data needed to respond to the user's
//!    C        request are not available, and the program should take
//!    C        appropriate action.)
//!    C
//!             CALL SPKSFS ( MGN, ET, HANDLE, DESCR, SEGNAM, FOUND )
//!  
//!    C
//!    C        Compute the geometric state (uncorrected for light-time)
//!    C        of the spacecraft as seen from the planet. We can compute
//!    C        this directly because light-time is being ignored.
//!    C        Do all computations in J2000 coordinates,
//!    C
//!    C        For now, we will assume that CENTER is always Venus
//!    C        (2 or 299). A more careful program would check this
//!    C        each time.
//!    C
//!             CALL SPKPV (HANDLE, DESCR, ET, 'IAU_VENUS', STATE, CENTER)
//!  
//!    C
//!    C        Convert from rectangular coordinates to latitude and
//!    C        longitude, then from radians to degrees for output.
//!    C
//!             CALL RECLAT ( STATE, RADIUS, LON, LAT )
//!  
//!             WRITE (*,*)
//!             WRITE (*,*) 'Sub-spacecraft latitude (deg): ', LAT * DPR()
//!             WRITE (*,*) '               longitude     : ', LON * DPR()
//!             WRITE (*,*)
//!    C
//!    C        Get the next input epoch.
//!    C
//!  
//!          END DO
//!  
//!          END
//! ```
//!
//!     
//! ###  Example 3: Occultation or Transit
//!
//!  The third example determines epochs if one target body (spacecraft,
//!    planet, or satellite) is occulted by or in transit across another target
//!    body as seen from an observer at a user specified epoch. It is similar
//!    in both form and generality to the first example.
//!
//!  
//!
//! ```text
//!          PROGRAM OCCTRN
//!  
//!    C
//!    C     SPICELIB functions
//!    C
//!          DOUBLE PRECISION      SUMAD
//!          DOUBLE PRECISION      VNORM
//!          DOUBLE PRECISION      VSEP
//!  
//!    C
//!    C     Variables
//!    C
//!          CHARACTER*(32)        TIME
//!          CHARACTER*(32)        OBS
//!          CHARACTER*(32)        TARG    ( 2   )
//!  
//!          DOUBLE PRECISION      AVG
//!          DOUBLE PRECISION      D       ( 2   )
//!          DOUBLE PRECISION      ET
//!          DOUBLE PRECISION      R       ( 2   )
//!          DOUBLE PRECISION      RADII   ( 3   )
//!          DOUBLE PRECISION      S       ( 6,2 )
//!          DOUBLE PRECISION      SEP
//!  
//!          INTEGER               I
//!          INTEGER               T       (  2 )
//!  
//!          LOGICAL               FOUND
//!  
//!    C
//!    C     Load constants into the kernel pool. Two files are
//!    C     needed. The first (`leapseconds.ker') contains the dates
//!    C     of leap seconds and values for constants needed to
//!    C     compute the difference between UTC and ET at any
//!    C     epoch. The second (`radii.tpc') contains values
//!    C     for the tri-axial ellipsoids used to model the major
//!    C     major bodies of the solar system.
//!    C
//!          CALL CLPOOL
//!          CALL FURNSH ( 'leapseconds.ker' )
//!          CALL FURNSH ( 'radii.tpc' )
//!  
//!    C
//!    C     Several ephemeris files are needed. Most contain data for
//!    C     a single planetary system (`jupiter.ker', `saturn.ker',
//!    C     and so on). Some contain data for spacecraft (`vgr1.ker',
//!    C     `mgn.ker').
//!    C
//!          CALL FURNSH ( 'mercury.bsp' )
//!          CALL FURNSH ( 'venus.bsp'   )
//!          CALL FURNSH ( 'earth.bsp'   )
//!          CALL FURNSH ( 'mars.bsp'    )
//!          CALL FURNSH ( 'jupiter.bsp' )
//!          CALL FURNSH ( 'saturn.bsp'  )
//!          CALL FURNSH ( 'uranus.bsp'  )
//!          CALL FURNSH ( 'neptune.bsp' )
//!          CALL FURNSH ( 'pluto.bsp'   )
//!          CALL FURNSH ( 'vgr1.bsp'    )
//!          CALL FURNSH ( 'vgr2.bsp'    )
//!          CALL FURNSH ( 'mgn.bsp'     )
//!          CALL FURNSH ( 'gll.bsp'     )
//!  
//!    C
//!    C     Inputs are entered interactively. The user enters four
//!    C     items: the code for the observer (an integer), the codes
//!    C     for two target bodies (integers), and the epoch at which
//!    C     check for occultation or transit is to be computed
//!    C     (a free-format string).
//!    C
//!    C     The epoch must be converted to ephemeris time (ET).
//!    C
//!          DO WHILE ( .TRUE. )
//!  
//!             CALL PROMPT ( 'Observer? ', OBS     )
//!             CALL PROMPT ( 'Target 1? ', TARG(1) )
//!             CALL PROMPT ( 'Target 2? ', TARG(2) )
//!             CALL PROMPT ( 'Epoch ?   ', TIME    )
//!  
//!  
//!             CALL STR2ET ( TIME, ET )
//!  
//!             Get the ID codes associated with the targets
//!  
//!             CALL BODC2N ( TARG(1), T(1), FOUND )
//!             CALL BODC2N ( TARG(2), T(2), FOUND )
//!  
//!    C
//!    C        Get the apparent states of the target objects as seen from
//!    C        the observer. Also get the apparent radius of each object
//!    C        from the kernel pool. (Use zero radius for any spacecraft;
//!    C        use average radius for anything else.)
//!    C
//!    C           T(i)       is the ID code of the i'th target.
//!    C           S(1-6,i)   is the apparent state of the i'th target.
//!    C           D(i)       is the apparent distance to the i'th target.
//!    C           R(i)       is the apparent radius of the i'th target.
//!    C
//!    C        Function VNORM returns the Euclidean norm (magnitude) of
//!    C        a three-vector.
//!    C
//!    C        Function SUMAD returns the sum of the elements in a
//!    C        double precision array.
//!    C
//!             DO I = 1, 2
//!                CALL SPKEZR ( TARG(I), ET, 'J2000', 'LT+S', OBS,
//!         .                    S(1,I),  LT )
//!                D(I) = VNORM( S(1,I) )
//!  
//!  
//!                IF ( T(I) .LT. 0 ) THEN
//!                   R(I) = 0.D0
//!  
//!                ELSE
//!                   CALL BODVCD ( T(I), 'RADII', 3, DIM, RADII )
//!                   AVG  = SUMAD ( RADII, 3 ) / 3.D0
//!                   R(I) = ASIN  ( AVG / D(I) )
//!                END IF
//!             END DO
//!  
//!    C
//!    C        Determine the separation between the two bodies. If the
//!    C        separation between the centers is greater than the sum of
//!    C        the apparent radii, then the target bodies are clear of
//!    C        each other.
//!    C
//!    C        Function VSEP returns the angle of separation between
//!    C        two three-vectors.
//!    C
//!             SEP = VSEP ( S(1,1), S(1,2) ) - ( R(1) + R(2) )
//!  
//!             IF ( SEP .GT. 0 ) THEN
//!  
//!                WRITE (*,*)
//!                WRITE (*,*) 'Clear.'
//!  
//!    C
//!    C        Otherwise, the smaller body is either occulted or
//!    C        in transit.  We compare ranges to decide which.
//!    C
//!             ELSE IF ( R(1) .LT. R(2) ) THEN
//!                IF ( D(1) .LT. D(2) ) THEN
//!                   WRITE (*,*)
//!                   WRITE (*,*) TARG(1), ' in transit across ', TARG(2)
//!                ELSE
//!                   WRITE (*,*)
//!                   WRITE (*,*) TARG(1), ' occulted by ', TARG(2)
//!                END IF
//!  
//!             ELSE
//!                IF ( D(1) .LT. D(2) ) THEN
//!                   WRITE (*,*)
//!                   WRITE (*,*) TARG(2), ' occulted by ', TARG(1)
//!                ELSE
//!                   WRITE (*,*)
//!                   WRITE (*,*) TARG(2), ' in transit across ', TARG(1)
//!                END IF
//!             END IF
//!  
//!    C
//!    C        Get the next set of inputs.
//!    C
//!          END DO
//!  
//!          END
//! ```
//!
//!  Additional, working examples of using the principal SPK subroutines may
//!    be found in the "Cookbook" programs distributed with the SPICE
//!    Toolkit.
//!
//!  
//!
//!
//!  
//! ##  Supported Data Types
//!
//!  The following representations, or data types, are currently supported by
//!    the SPK routines in SPICELIB.
//!
//!  
//!
//! *  1. Modified Difference Arrays.
//!
//!  *  Created by the JPL Orbit Determination Program (ODP), these are used
//! primarily for spacecraft ephemerides.
//!
//!  *  2. Chebyshev polynomials (position only).
//!
//!  *  These are sets of coefficients for the x, y, and z components of the body
//! position. The velocity of the body is obtained by differentiation. This
//! data type is normally used for planet barycenters, and for satellites whose
//! orbits are integrated.
//!
//!  *  3. Chebyshev polynomials (position and velocity).
//!
//!  *  These are sets of coefficients for the x, y, and z components of the body
//! position, and for the corresponding components of the velocity. This data
//! type is normally used for satellites whose orbits are computed directly
//! from theories.
//!
//!  *  4. Reserved for future use (TRW elements for TDRS and Space Telescope).
//!
//!  *  5. Discrete states (two body propagation).
//!
//!  *  This data type contains discrete state vectors. A state is obtained for a
//! specified epoch by propagating the state vectors to that epoch according to
//! the laws of two body motion and then taking a weighted average of the
//! resulting states. Normally, this data type is used for comets and
//! asteroids, whose ephemerides are integrated from an initial state or set of
//! osculating elements.
//!
//!  *  6. Reserved for future use (Analytic Model for Phobos and Deimos).
//!
//!  *  7. Reserved for future use (Precessing Classical Elements---used by STScI).
//!
//!  *  8. Equally spaced discrete states (Lagrange interpolation)
//!
//!  *  This data type contains discrete state vectors whose time tags are
//! separated by a constant step size. A state is obtained for a specified
//! epoch by finding a set of states 'centered' at that epoch and using
//! Lagrange interpolation on each component of the states.
//!
//!  *  9. Unequally spaced discrete states (Lagrange interpolation)
//!
//!  *  This data type contains discrete state vectors whose time tags may be
//! unequally spaced. A state is obtained for a specified epoch by finding a
//! set of states 'centered' at that epoch and using Lagrange interpolation on
//! each component of the states.
//!
//!  *  10. Space Command Two-line Elements
//!
//!  *  This data type contains Space Command two-line element representations for
//! objects in Earth orbit (formally called NORAD two-line elements).
//!
//!  *  11. Reserved for future use.
//!
//!  *  12. Hermite Interpolation Uniform Spacing.
//!
//!  *  13. Hermite Interpolation Non-uniform Spacing.
//!
//!  *  14. Chebyshev polynomials non-uniform spacing (position and velocity).
//!
//!  *  This data type contains Chebyshev polynomial coefficients for the position
//! and velocity of an object. Unlike SPK Types 2 and 3, the time intervals to
//! which polynomial coefficient sets apply do not have uniform duration.
//!
//!  *  15. Precessing conic propagation.
//!
//!  *  This data type allows for first order precession of the line of apsides and
//! regression of the line of nodes due to the effects of the J2 coefficient in
//! the harmonic expansion of the gravitational potential of an oblate
//! spheroid.
//!
//!  *  16. Reserved for future use (Elements for European Space Agency's ISO
//! spacecraft).
//!
//!  *  17. Equinoctial Elements
//!
//!  *  This data type represents the motion of an object about another using
//! equinoctial elements. It provides for precession of the line of apsides and
//! regression of the line of nodes. Unlike Type 15, the mean motion,
//! regression of the nodes and precession of the line of apsides are not
//! derived from the gravitational properties of the central body, but are
//! empirical values.
//!
//!  *  18. ESOC/DDID Hermite/Lagrange Interpolation
//!
//!  *  This data type has been provided to support accurate duplication within the
//! SPK system of spacecraft ephemerides used by the European Space Agency
//! (ESA) on the Mars Express, Rosetta, SMART-1, and Venus express missions.
//!
//!  *  19. ESOC/DDID Piecewise Interpolation
//!
//!  *  SPK type 19 is an enhanced version of SPK type 18. Type 19 enables creation
//! of SPK files representing the same ephemerides that can be represented
//! using type 18, but containing far fewer segments. Data from multiple type
//! 18 segments can be stored in a single type 19 segment.
//!
//!  *  20. Chebyshev (velocity only)
//!
//!  *  SPK data type 20 contains Chebyshev polynomial coefficients for the
//! velocity of a body, relative to its center of motion, as a function of
//! time. The position of the body is obtained by integrating the velocity
//! using a specified integration constant. This data type is provided to
//! accurately represent "EPM" ephemerides developed by the Institute of
//! Applied Astronomy (IAA), Russian Academy of Sciences (RAS).
//!
//!  *  21. Extended Modified Difference Arrays
//!
//!  *  SPK data type 21 contains extended Modified Difference Arrays (MDA), also
//! called "difference lines." These data structures use the same
//! mathematical trajectory representation as SPK data type 1, but type 21
//! allows use of larger, higher-degree MDAs.
//!
//!  Because SPK files are Double Precision Array Files (DAFs), each segment
//!    is stored as an array. Each array corresponding to a particular data
//!    type has a particular internal structure. These structures (for the
//!    non-reserved types) are described below.
//!
//!  
//!
//!
//!  
//! ###  Type 1: Modified Difference Arrays
//!
//!  The first SPK data type contains Modified Difference Arrays (MDA),
//!    sometimes called 'difference lines'. This data type is normally used for
//!    spacecraft whose ephemerides are produced by JPL's principal trajectory
//!    integrator---DPTRAJ. Difference lines are extracted from the spacecraft
//!    trajectory file ('P-files' and 'PV-files') created by DPTRAJ.
//!
//!  Each segment containing Modified Difference Arrays contains an arbitrary
//!    number of logical records. Each record contains difference line
//!    coefficients valid up to some final epoch, along with the state at that
//!    epoch. The contents of the records themselves are described in \[163].
//!    The subroutine [SPKE01](crate::raw::spke01) contains the algorithm used to construct a state
//!    from a particular record and epoch.
//!
//!  The records within a segment are ordered by increasing final epoch. The
//!    final epochs associated with the records must be distinct.
//!
//!  A segment of this type is structured as follows:
//!
//!  
//!
//! ```text
//!    +-----------------------------------------+
//!    | Record 1 (difference line coefficients) |
//!    +-----------------------------------------+
//!    | Record 2 (difference line coefficients) |
//!    +-----------------------------------------+
//!      .
//!      .
//!      .
//!    +-----------------------------------------+
//!    | Record N (difference line coefficients) |
//!    +-----------------------------------------+
//!    | Epoch 1                      |
//!    +------------------------------+
//!    | Epoch 2                      |
//!    +------------------------------+
//!      .
//!      .
//!      .
//!    +------------------------------+
//!    | Epoch N                      |
//!    +------------------------------+
//!    | Epoch 100                    |   (First directory epoch)
//!    +------------------------------+
//!    | Epoch 200                    |   (Second directory epoch)
//!    +------------------------------+
//!      .
//!      .
//!      .
//!    +------------------------------+
//!    | Epoch (N/100)*100            |   (Final directory epoch)
//!    +------------------------------+
//!    | N                            |
//!    +------------------------------+
//! ```
//!
//!  The number of records in a segment, N, can be arbitrarily large.
//!
//!  Records 1 through N contain the difference line coefficients and other
//!    constants needed to compute state data. Each one of these records
//!    contains 71 double precision numbers.
//!
//!  The list of final epochs for the records is stored immediately after the
//!    last record.
//!
//!  Following the list of epochs is a second list, the 'directory',
//!    containing every 100th epoch from the previous list. If there are N
//!    epochs, there will be N/100 directory epochs. If there are fewer than
//!    100 epochs, then the segment will not contain any directory epochs.
//!    Directory epochs are used to speed up access to desired records.
//!
//!  The final element in the segment is the number of records contained in
//!    the segment, N.
//!
//!  The index of the record corresponding to a particular epoch is the index
//!    of the first epoch not less than the target epoch.
//!
//!  
//!
//!
//!  
//! ###  Type 2: Chebyshev (position only)
//!
//!  The second SPK data type contains Chebyshev polynomial coefficients for
//!    the position of the body as a function of time. Normally, this data type
//!    is used for planet barycenters, and for satellites whose ephemerides are
//!    integrated. (The velocity of the body is obtained by differentiating the
//!    position.)
//!
//!  Each segment contains an arbitrary number of logical records. Each
//!    record contains a set of Chebyshev coefficients valid throughout an
//!    interval of fixed length. The subroutine [SPKE02](crate::raw::spke02) contains the algorithm
//!    used to construct a state from a particular record and epoch.
//!
//!  The records within a segment are ordered by increasing initial epoch.
//!    All records contain the same number of coefficients. A segment of this
//!    type is structured as follows:
//!
//!  
//!
//! ```text
//!    +---------------+
//!    | Record 1      |
//!    +---------------+
//!    | Record 2      |
//!    +---------------+
//!      .
//!      .
//!      .
//!    +---------------+
//!    | Record N      |
//!    +---------------+
//!    | INIT          |
//!    +---------------+
//!    | INTLEN        |
//!    +---------------+
//!    | RSIZE         |
//!    +---------------+
//!    | N             |
//!    +---------------+
//! ```
//!
//!  A four-number 'directory' at the end of the segment contains the
//!    information needed to determine the location of the record corresponding
//!    to a particular epoch.
//!
//!  
//!
//! *  1. INIT is the initial epoch of the first record, given in ephemeris seconds
//! past J2000.
//!
//!  *  2. INTLEN is the length of the interval covered by each record, in seconds.
//!
//!  *  3. RSIZE is the total size of (number of array elements in) each record.
//!
//!  *  4. N is the number of records contained in the segment.
//!
//!  Each record is structured as follows:
//!
//!  
//!
//! ```text
//!    +------------------+
//!    | MID              |
//!    +------------------+
//!    | RADIUS           |
//!    +------------------+
//!    | X  coefficients  |
//!    +------------------+
//!    | Y  coefficients  |
//!    +------------------+
//!    | Z  coefficients  |
//!    +------------------+
//! ```
//!
//!  The first two elements in the record, MID and RADIUS, are the midpoint
//!    and radius of the time interval covered by coefficients in the record.
//!    These are used as parameters to perform transformations between the
//!    domain of the record (from MID - RADIUS to MID + RADIUS) and the domain
//!    of Chebyshev polynomials (from -1 to 1 ).
//!
//!  The same number of coefficients is always used for each component, and
//!    all records are the same size (RSIZE), so the degree of each polynomial
//!    is
//!
//!  
//!
//! ```text
//!    ( RSIZE - 2 ) / 3 - 1
//! ```
//!
//!  To facilitate the creation of Type 2 segments, a segment writing routine
//!    called [SPKW02](crate::raw::spkw02) has been provided. This routine takes as input arguments
//!    the handle of an SPK file that is open for writing, the information
//!    needed to construct the segment descriptor, and the data to be stored in
//!    the segment. The header of the subroutine provides a complete
//!    description of the input arguments and an example of its usage.
//!
//!  
//!
//!
//!  
//! ###  Type 3: Chebyshev (position and velocity)
//!
//!  The third SPK data type contains Chebyshev polynomial coefficients for
//!    the position and velocity of the body as a function of time. Normally,
//!    this data type is used for satellites for which the ephemerides are
//!    computed from analytical theories.
//!
//!  The structure of the segment is nearly identical to that of the SPK data
//!    Type 2 (Chebyshev polynomials for position only). The only difference is
//!    that each logical record contains six sets of coefficients instead of
//!    three. The subroutine [SPKE03](crate::raw::spke03) contains the algorithm used to construct a
//!    state from a particular record and epoch.
//!
//!  Each record is structured as follows:
//!
//!  
//!
//! ```text
//!    +------------------+
//!    | MID              |
//!    +------------------+
//!    | RADIUS           |
//!    +------------------+
//!    | X  coefficients  |
//!    +------------------+
//!    | Y  coefficients  |
//!    +------------------+
//!    | Z  coefficients  |
//!    +------------------+
//!    | X' coefficients  |
//!    +------------------+
//!    | Y' coefficients  |
//!    +------------------+
//!    | Z' coefficients  |
//!    +------------------+
//! ```
//!
//!  The same number of coefficients is always used for each component, and
//!    all records are the same size (RSIZE), so the degree of each polynomial
//!    is
//!
//!  
//!
//! ```text
//!    ( RSIZE - 2 ) / 6 - 1
//! ```
//!
//!  To facilitate the creation of Type 3 segments, a segment writing routine
//!    called [SPKW03](crate::raw::spkw03) has been provided. This routine takes as input arguments
//!    the handle of an SPK file that is open for writing, the information
//!    needed to construct the segment descriptor, and the data to be stored in
//!    the segment. The header of the subroutine provides a complete
//!    description of the input arguments and an example of its usage.
//!
//!  
//!
//!
//!  
//! ###  Type 5: Discrete states (two body propagation)
//!
//!  The fifth standard SPK data type contains discrete state vectors. A
//!    state is obtained from a Type 5 segment for any epoch that is within the
//!    bounds of that segment by propagating the discrete states to the
//!    specified epoch according to the laws of two body motion. Normally, this
//!    data type is used for comets and asteroids, whose ephemerides are
//!    integrated from an initial state or set of osculating elements.
//!
//!  Each segment contains of a number of logical records. Each record
//!    consists of an epoch (ephemeris seconds past J2000) and the geometric
//!    state of the body at that epoch (x, y, z, dx/dt, dy/dt, dz/dt, in
//!    kilometers and kilometers per second). Records are ordered with respect
//!    to increasing time.
//!
//!  The records that correspond to an epoch for which a state is desired are
//!    the ones whose associated epochs bracket that epoch. The state in each
//!    record is used as the initial state in a two-body propagation; a
//!    weighted average of the propagated states gives the position of the body
//!    at the specified epoch. The velocity is given by the derivative of the
//!    position. Thus the position and velocity at the specified epoch are
//!    given by:
//!
//!  
//!
//! ```text
//!    P  = W(t) * P1(t) + (1-W(t)) * P2(t)
//!  
//!    V  = W(t) * V1(t) + (1-W(t)) * V2(t) + W'(t) * ( P1(t) - P2(t) )
//! ```
//!
//!  where P1, V1, P2, and V2 are the position and velocity components of the
//!    propagated states and W is the weighting function.
//!
//!  The weighting function used is:
//!
//!  
//!
//! ```text
//!    W(t) = 0.5 + 0.5 * cos [ PI * ( t - t1 ) / ( t2 - t1 ) ]
//! ```
//!
//!  where t1 and t2 are the epochs that bracket the specified epoch t.
//!
//!  Physically, the epochs and states are stored separately, so that the
//!    epochs can be searched as an ordered array. Thus, the initial part of
//!    each segment looks like this:
//!
//!  
//!
//! ```text
//!    +--------------------+
//!    | State 1            |
//!    +--------------------+
//!             .
//!             .
//!             .
//!    +--------------------+
//!    | State N            |
//!    +--------------------+
//!    | Epoch 1            |
//!    +--------------------+
//!             .
//!             .
//!             .
//!    +--------------------+
//!    | Epoch N            |
//!    +--------------------+
//! ```
//!
//!  The number of records in a segment can be arbitrarily large. In order to
//!    avoid the file reads required to search through a large array of epochs,
//!    each segment contains a simple directory immediately after the final
//!    epoch.
//!
//!  This directory contains every 100th epoch in the epoch array. If there
//!    are N epochs, there will be N/100 directory epochs. (If there are fewer
//!    than 100 epochs, no directory epochs are stored.)
//!
//!  The final items in the segment are GM, the gravitational parameter of
//!    the central body (kilometers and seconds), and N, the number of states
//!    in the segment. Thus, the complete segment looks like this:
//!
//!  
//!
//! ```text
//!    +--------------------+
//!    | State 1            |
//!    +--------------------+
//!             .
//!             .
//!             .
//!    +--------------------+
//!    | Epoch 1            |
//!    +--------------------+
//!             .
//!             .
//!             .
//!    +--------------------+
//!    | Epoch N            |
//!    +--------------------+
//!    | Epoch 100          |           (First directory epoch)
//!    +--------------------+
//!    | Epoch 200          |
//!    +--------------------+
//!             .
//!             .
//!             .
//!    +--------------------+
//!    | Epoch (N/100)*100  |           (Final directory epoch)
//!    +--------------------+
//!    | GM                 |
//!    +--------------------+
//!    | N                  |
//!    +--------------------+
//! ```
//!
//!  To facilitate the creation of Type 5 segments, a segment writing routine
//!    called [SPKW05](crate::raw::spkw05) has been provided. This routine takes as input arguments
//!    the handle of an SPK file that is open for writing, the information
//!    needed to construct the segment descriptor, and the data to be stored in
//!    the segment. The header of the subroutine provides a complete
//!    description of the input arguments and an example of its usage.
//!
//!  
//!
//!
//!  
//! ###  Type 8: Lagrange Interpolation --- Equal Time Steps
//!
//!  The eighth SPK data type represents a continuous ephemeris using a
//!    discrete set of states and a Lagrange interpolation method. The epochs
//!    (also called 'time tags') associated with the states must be evenly
//!    spaced: there must be some positive constant STEP such that each time
//!    tag differs from its predecessor and successor by STEP seconds. For a
//!    request epoch not corresponding to the time tag of some state, the data
//!    type defines a state by interpolating each component of a set of states
//!    whose epochs are 'centered' near the request epoch. Details of how these
//!    states are selected and interpolated are given below.
//!
//!  The SPK system can also represent an ephemeris using unequally spaced
//!    discrete states and Lagrange interpolation; SPK Type 9 does this. SPK
//!    Type 9 sacrifices some run-time speed and economy of storage in order to
//!    achieve greater flexibility.
//!
//!  The states in a Type 8 segment are geometric: they do not take into
//!    account aberration corrections. The six components of each state vector
//!    represent the position and velocity (x, y, z, dx/dt, dy/dt, dz/dt, in
//!    kilometers and kilometers per second) of the body to which the ephemeris
//!    applies, relative to the center specified by the segment's descriptor.
//!    The epochs corresponding to the states are barycentric dynamical times
//!    (TDB), expressed as seconds past J2000.
//!
//!  Each segment also has a polynomial degree associated with it; this is
//!    the degree of the interpolating polynomials to be used in evaluating
//!    states based on the data in the segment. The identical degree is used
//!    for interpolation of each state component.
//!
//!  Type 8 SPK segments have the structure shown below:
//!
//!  
//!
//! ```text
//!                                        +--------+
//!                                        |  x(1)  |
//!                                    /   +--------+
//!                                   /    |  y(1)  |
//!                                  /     +--------+
//!                                 /      |  z(1)  |
//!    +-----------------------+   /       +--------+
//!    | State 1               |  <        |dx(1)/dt|
//!    +-----------------------+   \       +--------+
//!    | State 2               |    \      |dy(1)/dt|
//!    +-----------------------+     \     +--------+
//!                .                  \    |dz(1)/dt|
//!                .                       +--------+
//!                .
//!    +-----------------------+
//!    | State N               |
//!    +-----------------------+
//!    | Epoch of state 1 (TDB)|
//!    +-----------------------+
//!    | Step size             |
//!    +-----------------------+
//!    | Polynomial degree     |
//!    +-----------------------+
//!    | Number of states      |
//!    +-----------------------+
//! ```
//!
//!  In the diagram, each box representing a state vector corresponds to six
//!    double precision numbers; the other boxes represent individual double
//!    precision numbers. Since the epochs of the states are evenly spaced,
//!    they are represented by a start epoch and a step size. The number of
//!    states must be greater than the interpolating polynomial degree.
//!
//!  The Type 8 interpolation method works as follows: given an epoch at
//!    which a state is requested and a segment having coverage for that epoch,
//!    the Type 8 reader finds a group of states whose epochs are 'centered'
//!    about the epoch. The size of the group is one greater than the
//!    polynomial degree associated with the segment. If the group size N is
//!    even, then the group will consist of N consecutive states such that the
//!    request time is between the epochs of the members of the group having
//!    indices, relative to the start of the group, of N/2 and (N/2 + 1),
//!    inclusive. When N is odd, the group will contain a central state whose
//!    epoch is closest to the request time, and will also contain (N-1)/2
//!    neighboring states on either side of the central one. The Type 8
//!    evaluator will then use Lagrange interpolation on each component of the
//!    states to produce a state corresponding to the request time. For the jth
//!    state component, the interpolation algorithm is mathematically
//!    equivalent to finding the unique polynomial of degree N-1 that
//!    interpolates the ordered pairs
//!
//!  
//!
//! ```text
//!    ( epoch(i), state(j,i) ),  i = k ,  k , ... , k
//!                                    1    2         N
//! ```
//!
//!  and evaluating the polynomial at the requested epoch. Here
//!
//!  
//!
//! ```text
//!     k ,  k , ... , k
//!      1    2         N
//! ```
//!
//!  are the indices of the states in the interpolation group,
//!
//!  
//!
//! ```text
//!    epoch(i)
//! ```
//!
//!  is the epoch of the ith state and
//!
//!  
//!
//! ```text
//!    state(j,i)
//! ```
//!
//!  is the jth component of the ith state.
//!
//!  There is an exception to the state selection algorithm described above:
//!    the request time may be too near the first or last state of the segment
//!    to be properly bracketed. In this case, the set of states selected for
//!    interpolation still has size N, and includes either the first or last
//!    state of the segment.
//!
//!  To facilitate the creation of Type 8 segments, a segment writing routine
//!    called [SPKW08](crate::raw::spkw08) has been provided. This routine takes as input arguments
//!    the handle of an SPK file that is open for writing, the information
//!    needed to construct the segment descriptor, and the data to be stored in
//!    the segment. The header of the subroutine provides a complete
//!    description of the input arguments and an example of its usage.
//!
//!  
//!
//!
//!  
//! ###  Type 9: Lagrange Interpolation --- Unequal Time Steps
//!
//!  The ninth SPK data type represents a continuous ephemeris using a
//!    discrete set of states and a Lagrange interpolation method. The epochs
//!    (also called 'time tags') associated with the states need not be evenly
//!    spaced. For a request epoch not corresponding to the time tag of some
//!    state, the data type defines a state by interpolating each component of
//!    a set of states whose epochs are 'centered' near the request epoch.
//!    Details of how these states are selected and interpolated are given
//!    below.
//!
//!  The states in a Type 9 segment are geometric: they do not take into
//!    account aberration corrections. The six components of each state vector
//!    represent the position and velocity (x, y, z, dx/dt, dy/dt, dz/dt, in
//!    kilometers and kilometers per second) of the body to which the ephemeris
//!    applies, relative to the center specified by the segment's descriptor.
//!    The epochs corresponding to the states are barycentric dynamical times
//!    (TDB), expressed as seconds past J2000.
//!
//!  Each segment also has a polynomial degree associated with it; this is
//!    the degree of the interpolating polynomials to be used in evaluating
//!    states based on the data in the segment. The identical degree is used
//!    for interpolation of each state component.
//!
//!  Type 9 SPK segments have the structure shown below:
//!
//!  
//!
//! ```text
//!                                        +--------+
//!                                        |  x(1)  |
//!                                    /   +--------+
//!                                   /    |  y(1)  |
//!                                  /     +--------+
//!                                 /      |  z(1)  |
//!    +-----------------------+   /       +--------+
//!    | State 1               |  <        |dx(1)/dt|
//!    +-----------------------+   \       +--------+
//!    | State 2               |    \      |dy(1)/dt|
//!    +-----------------------+     \     +--------+
//!                .                  \    |dz(1)/dt|
//!                .                       +--------+
//!                .
//!    +-----------------------+
//!    | State N               |
//!    +-----------------------+
//!    | Epoch 1               |
//!    +-----------------------+
//!    | Epoch 2               |
//!    +-----------------------+
//!                .
//!                .
//!                .
//!    +-----------------------+
//!    | Epoch N               |
//!    +-----------------------+
//!    | Epoch 100             | (First directory)
//!    +-----------------------+
//!                .
//!                .
//!                .
//!    +-----------------------+
//!    | Epoch ((N-1)/100)*100 | (Last directory)
//!    +-----------------------+
//!    | Polynomial degree     |
//!    +-----------------------+
//!    | Number of states      |
//!    +-----------------------+
//!  
//! ```
//!
//!  In the diagram, each box representing a state vector corresponds to six
//!    double precision numbers; the other boxes represent individual double
//!    precision numbers. The number of states must be greater than the
//!    interpolating polynomial degree.
//!
//!  The set of time tags is augmented by a series of directory entries;
//!    these entries allow the Type 9 reader to search for states more
//!    efficiently. The directory entries contain time tags whose indices are
//!    multiples of 100. The set of indices of time tags stored in the
//!    directories ranges from 100 to
//!
//!  
//!
//! ```text
//!    (  (N-1) / 100  ) * 100
//! ```
//!
//!  where N is the total number of time tags. Note that if N is
//!
//!  
//!
//! ```text
//!    Q * 100
//! ```
//!
//!  then only
//!
//!  
//!
//! ```text
//!    Q - 1
//! ```
//!
//!  directory entries are stored, and in particular, if there are only 100
//!    states in the segment, there are no directories.
//!
//!  The Type 9 interpolation algorithm is virtually identical to the Type 8
//!    algorithm; see the discussion of SPK Type 8 for details. However, the
//!    Type 9 algorithm executes more slowly than the Type 8 algorithm, since
//!    the Type 9 reader must search through tables of time tags to find
//!    appropriates states to interpolate, while the Type 8 reader can locate
//!    the correct set of states to interpolate by a direct computation.
//!
//!  To facilitate the creation of Type 9 segments, a segment writing routine
//!    called [SPKW09](crate::raw::spkw09) has been provided. This routine takes as input arguments
//!    the handle of an SPK file that is open for writing, the information
//!    needed to construct the segment descriptor, and the data to be stored in
//!    the segment. The header of the subroutine provides a complete
//!    description of the input arguments and an example of its usage.
//!
//!  
//!
//!
//!  
//! ###  Type 10: Space Command Two-Line Elements
//!
//!  The SPK data Type 10 uses the SPICE concept of a generic segment to
//!    store a collection of packets each of which models the trajectory of
//!    some Earth satellite using Space Command two-line element sets (TLEs)
//!    (formerly the North American Air Defense --- NORAD). TLE propagation
//!    occurs using the algorithms as described in the Spacetrak 3 report for
//!    SGP4 and SDP4. Note: The Spacetrak 3 implementation of SDP4 contained
//!    several programming errors. The errors were corrected for SPICE
//!    implementation.
//!
//!  The SPICE generic segment software handles storage, arrangement, and
//!    retrieval of the TLEs. We review only the pertinent points about generic
//!    segments here.
//!
//!  A generic SPK segment contains several logical data partitions:
//!
//!  
//!
//! *  1. A partition for constant values to be associated with each data packet in
//! the segment.
//!
//!  *  2. A partition for the data packets.
//!
//!  *  3. A partition for epochs.
//!
//!  *  4. A partition for a packet directory, if the segment contains variable sized
//! packets.
//!
//!  *  5. A partition for an epoch directory.
//!
//!  *  6. A reserved partition that is not currently used. This partition is only for
//! the use of the NAIF group at the Jet Propulsion Laboratory (JPL).
//!
//!  *  7. A partition for the meta data which describes the locations and sizes of
//! other partitions as well as providing some additional descriptive
//! information about the generic segment.
//!
//!  ```text
//!       +============================+
//!       |         Constants          |
//!       +============================+
//!       |          Packet 1          |
//!       |----------------------------|
//!       |          Packet 2          |
//!       |----------------------------|
//!       |              .             |
//!       |              .             |
//!       |              .             |
//!       |----------------------------|
//!       |          Packet N          |
//!       +============================+
//!       |      Reference Epochs      |
//!       +============================+
//!       |      Packet Directory      |
//!       +============================+
//!       |       Epoch Directory      |
//!       +============================+
//!       |       Reserved  Area       |
//!       +============================+
//!       |     Segment Meta Data      |
//!       +----------------------------+
//! ```
//!  Each "packet" of a Type 10 segment contains a set of two-line
//!    elements, the nutations in longitude and obliquity of the Earth's pole,
//!    and the rates of these nutations. Each packet is arranged as shown
//!    below. (The notation below is taken from the description that
//!    accompanies the code available from Space Command for the evaluation of
//!    two-line elements.)
//!
//!  
//!
//! ```text
//!  
//!       A single SPK Type 10 segment packet
//!  
//!       +-------------------+
//!     1 |      NDT20        |
//!       +-------------------+
//!     2 |      NDD60        |
//!       +-------------------+
//!     3 |      BSTAR        |
//!       +-------------------+
//!     4 |      INCL         |
//!       +-------------------+
//!     5 |      NODE0        |     Two-line element packet
//!       +-------------------+
//!     6 |      ECC          |
//!       +-------------------+
//!     7 |      OMEGA        |
//!       +-------------------+
//!     8 |      MO           |
//!       +-------------------+
//!     9 |      NO           |
//!       +-------------------+
//!    10 |      EPOCH        |
//!       +-------------------+
//!    11 |      NU.OBLIQUITY |
//!       +-------------------+
//!    12 |      NU.LONGITUDE |
//!       +-------------------+
//!    13 |     dOBLIQUITY/dt |
//!       +-------------------+
//!    14 |     dLONGITUDE/dt |
//!       +-------------------+
//! ```
//!
//!  The constants partition of the Type 10 segment contains the following
//!    eight geophysical constants.
//!
//!  
//!
//! ```text
//!       +-------------------------------------------+
//!    1  |  J2 gravitational harmonic for Earth      |
//!       +-------------------------------------------+
//!    2  |  J3 gravitational harmonic for Earth      |
//!       +-------------------------------------------+
//!    3  |  J4 gravitational harmonic for Earth      |
//!       +-------------------------------------------+
//!       |  Square root of the GM for Earth where GM |
//!    4  |  is expressed in Earth radii cubed per    |
//!       |  minutes squared                          |
//!       +-------------------------------------------+
//!    5  |  High altitude bound for atmospheric      |
//!       |  model in km                              |
//!       +-------------------------------------------+
//!    6  |  Low altitude bound for atmospheric       |
//!       |  model in km                              |
//!       +-------------------------------------------+
//!    7  |  Equatorial radius of the Earth in km     |
//!       +-------------------------------------------+
//!    8  |  Distance units/Earth radius (normally 1) |
//!       +-------------------------------------------+
//! ```
//!
//!  The reference epochs partition contains an ordered collection of epochs.
//!    The i'th reference epoch is equal to the epoch in the i'th packet.
//!
//!  The "epoch directory" contains every 100th reference epoch. The epoch
//!    directory is used to efficiently locate an the reference epoch that
//!    should be associated with a two line element packet.
//!
//!  The "packet directory" is empty.
//!
//!  Access to the data should be made via the SPK Type 10 reader---[SPKR10](crate::raw::spkr10) or
//!    via the SPICELIB generic segment routines. Use the routine [SPKW10](crate::raw::spkw10) to
//!    write a Type 10 generic segment.
//!
//!  
//!
//!
//!  
//! ###  Type 12: Hermite Interpolation --- Equal Time Steps
//!
//!  The twelfth SPK data type represents a continuous ephemeris using a
//!    discrete set of states and a sliding window Hermite interpolation
//!    method. The epochs, also called "time tags," associated with the states
//!    must be evenly spaced: there must be some positive constant STEP such
//!    that each time tag differs from its predecessor by STEP seconds. For any
//!    request epoch, the data type defines a state by interpolating a set of
//!    consecutive states, or "window," centered as closely as possible to the
//!    request epoch. Interpolated position values are obtained for each
//!    coordinate by fitting a Hermite polynomial to the window's set of
//!    position and velocity values for that coordinate; interpolated velocity
//!    is obtained by differentiating the interpolating polynomials. Details of
//!    the interpolation method are given below.
//!
//!  The SPK system can also represent an ephemeris using unequally spaced
//!    discrete states and Hermite interpolation; SPK type 13 does this. SPK
//!    type 13 sacrifices some run-time speed and economy of storage in order
//!    to achieve greater flexibility.
//!
//!  The states in a type 12 segment are geometric: they do not take into
//!    account aberration corrections. The six components of each state vector
//!    represent the position and velocity (x, y, z, dx/dt, dy/dt, dz/dt, in
//!    kilometers and kilometers per second) of the body to which the ephemeris
//!    applies, relative to the center specified by the segment's descriptor.
//!    The epochs corresponding to the states are barycentric dynamical times
//!    (TDB), expressed as seconds past J2000.
//!
//!  Each segment also has a polynomial degree associated with it; this is
//!    the degree of the interpolating polynomials to be used in evaluating
//!    states based on the data in the segment. The identical degree is used
//!    for interpolation of each state component.
//!
//!  Type 12 SPK segments have the structure shown below:
//!
//!  
//!
//! ```text
//!                                        +--------+
//!                                        |  x(1)  |
//!                                    /   +--------+
//!                                   /    |  y(1)  |
//!                                  /     +--------+
//!                                 /      |  z(1)  |
//!    +-----------------------+   /       +--------+
//!    | State 1               |  <        |dx(1)/dt|
//!    +-----------------------+   \       +--------+
//!    | State 2               |    \      |dy(1)/dt|
//!    +-----------------------+     \     +--------+
//!                .                  \    |dz(1)/dt|
//!                .                       +--------+
//!                .
//!    +-----------------------+
//!    | State N               |
//!    +-----------------------+
//!    | Epoch of state 1 (TDB)|
//!    +-----------------------+
//!    | Step size             |
//!    +-----------------------+
//!    | Window size - 1       |
//!    +-----------------------+
//!    | Number of states      |
//!    +-----------------------+
//! ```
//!
//!  In the diagram, each box representing a state vector corresponds to six
//!    double precision numbers; the other boxes represent individual double
//!    precision numbers. Since the epochs of the states are evenly spaced,
//!    they are represented by a start epoch and a step size. The number of
//!    states must be greater than or equal to the window size, which is
//!    related to the polynomial degree as shown:
//!
//!  
//!
//! ```text
//!    DEGREE  =  2 * WINDOW_SIZE  -  1
//! ```
//!
//!  The type 12 interpolation method works as follows: given an epoch at
//!    which a state is requested and a segment having coverage for that epoch,
//!    the type 12 reader finds a window of states whose epochs are "centered"
//!    about the epoch. If the window size S is even, then the window will
//!    consist of S consecutive states such that the request time is between
//!    the epochs of the members of the group having indices, relative to the
//!    start of the group, of S/2 and (S/2 + 1), inclusive. When S is odd, the
//!    group will contain a central state whose epoch is closest to the request
//!    time, and will also contain (S-1)/2 neighboring states on either side of
//!    the central one. For each of the x-, y-, and z-coordinates, the type 12
//!    evaluator will fit an Hermite polynomial to the corresponding position
//!    and velocity values of the states in the selected window. Each
//!    polynomial is evaluated at the request time to yield the interpolated
//!    position components. The derivatives of these polynomials are evaluated
//!    at the request time to yield the interpolated velocity components.
//!
//!  For the jth coordinate, the interpolation algorithm is mathematically
//!    equivalent to finding the unique polynomial of degree 2*S-1 that
//!    interpolates the ordered pairs
//!
//!  
//!
//! ```text
//!    ( epoch(i), position(j,i) ),  i = k ,  k , ... , k
//!                                       1    2         S
//! ```
//!
//!  and whose derivative interpolates the ordered pairs
//!
//!  
//!
//! ```text
//!    ( epoch(i), velocity(j,i) ),  i = k ,  k , ... , k
//!                                       1    2         S
//! ```
//!
//!  and evaluating the polynomial and its derivative at the requested epoch.
//!    Here
//!
//!  
//!
//! ```text
//!     k ,  k , ... , k
//!      1    2         S
//! ```
//!
//!  are the indices of the states in the interpolation window,
//!
//!  
//!
//! ```text
//!    epoch(i)
//! ```
//!
//!  is the epoch of the ith state and
//!
//!  
//!
//! ```text
//!    position(j,i)
//!    velocity(j,i)
//! ```
//!
//!  are, respectively, the jth components of the position and velocity
//!    comprising the ith state.
//!
//!  There is an exception to the state selection algorithm described above:
//!    the request time may be too near the first or last state of the segment
//!    to be properly bracketed. In this case, the set of states selected for
//!    interpolation still has size S, and includes either the first or last
//!    state of the segment.
//!
//!  To facilitate the creation of type 12 segments, a segment writing
//!    routine called [SPKW12](crate::raw::spkw12) has been provided. This routine takes as input
//!    arguments the handle of an SPK file that is open for writing, the
//!    information needed to construct the segment descriptor, and the data to
//!    be stored in the segment. The header of the subroutine provides a
//!    complete description of the input arguments and an example of its usage.
//!
//!  
//!
//!
//!  
//! ###  Type 13: Hermite Interpolation --- Unequal Time Steps
//!
//!  The thirteenth SPK data type represents a continuous ephemeris using a
//!    discrete set of states and a sliding window Hermite interpolation
//!    method. The epochs, also called "time tags," associated with the states
//!    need not be evenly spaced. For any request epoch, the data type defines
//!    a state by interpolating a set of consecutive states, or "window,"
//!    centered as closely as possible to the request epoch. Interpolated
//!    position values are obtained for each coordinate by fitting a Hermite
//!    polynomial to the window's set of position and velocity values for that
//!    coordinate; interpolated velocity is obtained by differentiating the
//!    interpolating polynomials. Details of the interpolation method are given
//!    below.
//!
//!  The states in a type 13 segment are geometric: they do not take into
//!    account aberration corrections. The six components of each state vector
//!    represent the position and velocity (x, y, z, dx/dt, dy/dt, dz/dt, in
//!    kilometers and kilometers per second) of the body to which the ephemeris
//!    applies, relative to the center specified by the segment's descriptor.
//!    The epochs corresponding to the states are barycentric dynamical times
//!    (TDB), expressed as seconds past J2000.
//!
//!  Each segment also has a polynomial degree associated with it; this is
//!    the degree of the interpolating polynomials to be used in evaluating
//!    states based on the data in the segment. The identical degree is used
//!    for interpolation of each state component.
//!
//!  Type 13 SPK segments have the structure shown below:
//!
//!  
//!
//! ```text
//!                                        +--------+
//!                                        |  x(1)  |
//!                                    /   +--------+
//!                                   /    |  y(1)  |
//!                                  /     +--------+
//!                                 /      |  z(1)  |
//!    +-----------------------+   /       +--------+
//!    | State 1               |  <        |dx(1)/dt|
//!    +-----------------------+   \       +--------+
//!    | State 2               |    \      |dy(1)/dt|
//!    +-----------------------+     \     +--------+
//!                .                  \    |dz(1)/dt|
//!                .                       +--------+
//!                .
//!    +-----------------------+
//!    | State N               |
//!    +-----------------------+
//!    | Epoch 1               |
//!    +-----------------------+
//!    | Epoch 2               |
//!    +-----------------------+
//!                .
//!                .
//!                .
//!    +-----------------------+
//!    | Epoch N               |
//!    +-----------------------+
//!    | Epoch 100             | (First directory)
//!    +-----------------------+
//!                .
//!                .
//!                .
//!    +-----------------------+
//!    | Epoch ((N-1)/100)*100 | (Last directory)
//!    +-----------------------+
//!    | Window size - 1       |
//!    +-----------------------+
//!    | Number of states      |
//!    +-----------------------+
//!  
//! ```
//!
//!  In the diagram, each box representing a state vector corresponds to six
//!    double precision numbers; the other boxes represent individual double
//!    precision numbers. The number of states must be greater than or equal to
//!    the window size, which is related to the polynomial degree as shown:
//!
//!  
//!
//! ```text
//!    DEGREE  =  2 * WINDOW_SIZE  -  1
//! ```
//!
//!  The set of time tags is augmented by a series of directory entries;
//!    these entries allow the type 13 reader to search for states more
//!    efficiently. The directory entries contain time tags whose indices are
//!    multiples of 100. The set of indices of time tags stored in the
//!    directories ranges from 100 to
//!
//!  
//!
//! ```text
//!    (  (N-1) / 100  ) * 100
//! ```
//!
//!  where N is the total number of time tags. Note that if N is
//!
//!  
//!
//! ```text
//!    Q * 100
//! ```
//!
//!  then only
//!
//!  
//!
//! ```text
//!    Q - 1
//! ```
//!
//!  directory entries are stored, and in particular, if there are only 100
//!    states in the segment, there are no directories.
//!
//!  The type 13 interpolation algorithm is virtually identical to the type
//!    12 algorithm; see the discussion of SPK type 12 for details. However,
//!    the type 13 algorithm executes more slowly than the type 12 algorithm,
//!    since the type 13 reader must search through tables of time tags to find
//!    appropriates states to interpolate, while the type 12 reader can locate
//!    the correct set of states to interpolate by a direct computation.
//!
//!  To facilitate the creation of type 13 segments, a segment writing
//!    routine called [SPKW13](crate::raw::spkw13) has been provided. This routine takes as input
//!    arguments the handle of an SPK file that is open for writing, the
//!    information needed to construct the segment descriptor, and the data to
//!    be stored in the segment. The header of the subroutine provides a
//!    complete description of the input arguments and an example of its usage.
//!
//!  
//!
//!
//!  
//! ###  Type 14: Chebyshev Polynomials --- Unequal Time Steps
//!
//!  The SPK data Type 14 uses the SPICE concept of a generic segment to
//!    store a collection of packets each of which models the trajectory of
//!    some object with respect to another over some interval of time. Each
//!    packet contains a set of coefficients for Chebyshev polynomials that
//!    approximate the position and velocity of some object. The time intervals
//!    corresponding to each packet are non-overlapping. Moreover their union
//!    covers the interval of time spanned by the start and end times of the
//!    Type 14 segment. Unlike Types 2 and 3 the time spacing between sets of
//!    coefficients for a Type 14 segment may be non-uniform.
//!
//!  The storage, arrangement and retrieval of packets is handled by the
//!    SPICE generic segment software. That software is documented in the
//!    document genseg.req. (The document genseg.req is currently in
//!    preparation.) We only review the pertinent points about generic segments
//!    here.
//!
//!  A generic SPK segment contains several logical data partitions:
//!
//!  
//!
//! *  1. A partition for constant values to be associated with each data packet in
//! the segment.
//!
//!  *  2. A partition for the data packets.
//!
//!  *  3. A partition for epochs.
//!
//!  *  4. A partition for a packet directory, if the segment contains variable sized
//! packets.
//!
//!  *  5. A partition for an epoch directory.
//!
//!  *  6. A reserved partition that is not currently used. This partition is only for
//! the use of the NAIF group at the Jet Propulsion Laboratory (JPL).
//!
//!  *  7. A partition for the meta data which describes the locations and sizes of
//! other partitions as well as providing some additional descriptive
//! information about the generic segment.
//!
//!  ```text
//!       +============================+
//!       |         Constants          |
//!       +============================+
//!       |          Packet 1          |
//!       |----------------------------|
//!       |          Packet 2          |
//!       |----------------------------|
//!       |              .             |
//!       |              .             |
//!       |              .             |
//!       |----------------------------|
//!       |          Packet N          |
//!       +============================+
//!       |      Reference Epochs      |
//!       +============================+
//!       |      Packet Directory      |
//!       +============================+
//!       |       Epoch Directory      |
//!       +============================+
//!       |       Reserved  Area       |
//!       +============================+
//!       |     Segment Meta Data      |
//!       +----------------------------+
//! ```
//!  Only the placement of the meta data at the end of a generic segment is
//!    required. The other data partitions may occur in any order in the
//!    generic segment because the meta data will contain pointers to their
//!    appropriate locations within the generic segment.
//!
//!  In the case of Type 14 SPK segments each "packet" contains an epoch,
//!    EPOCH, an allowed time offset, OFFSET, from the epoch, and 6 sets of
//!    Chebyshev polynomial coefficients which are used to evaluate the x,y,z,
//!    dx/dt, dy/dt, and dz/dt components of the state for epochs within OFFSET
//!    seconds of the EPOCH. Each packet is organized with the following
//!    structure:
//!
//!  
//!
//! ```text
//!    ------------------------------------------------
//!    |  The midpoint of the approximation interval  |
//!    ------------------------------------------------
//!    |  The radius of the approximation interval    |
//!    ------------------------------------------------
//!    |  CHBDEG+1 coefficients for the X coordinate  |
//!    ------------------------------------------------
//!    |  CHBDEG+1 coefficients for the Y coordinate  |
//!    ------------------------------------------------
//!    |  CHBDEG+1 coefficients for the Z coordinate  |
//!    ------------------------------------------------
//!    |  CHBDEG+1 coefficients for the X velocity    |
//!    ------------------------------------------------
//!    |  CHBDEG+1 coefficients for the Y velocity    |
//!    ------------------------------------------------
//!    |  CHBDEG+1 coefficients for the Z velocity    |
//!    ------------------------------------------------
//! ```
//!
//!  The maximum degree Chebyshev representation that can currently be
//!    accommodated is 18. Packets are stored in increasing order of the
//!    midpoint of the approximation interval.
//!
//!  The "constants" partition contains a single value, the degree of the
//!    Chebyshev representation.
//!
//!  The reference epochs partition contains an ordered collection of epochs.
//!    The i'th reference epoch corresponds to the beginning of the interval
//!    for which the i'th packet can be used to determine the state of the
//!    object modeled by this segment.
//!
//!  The "epoch directory" contains every 100th reference epoch. The epoch
//!    directory is used to efficiently locate an the reference epoch that
//!    should be associated with an epoch for which a state has been requested.
//!
//!  The "packet directory" is empty.
//!
//!  As noted above the exact location of the various partitions must be
//!    obtained from the Meta data contained at the end of the segment.
//!
//!  Access to the data should be made via the SPICELIB generic segment
//!    routines.
//!
//!  Type 14 segments should be created using the routines [SPK14B](crate::raw::spk14b), [SPK14A](crate::raw::spk14a),
//!    and [SPK14E](crate::raw::spk14e). The usage of these routines is discussed in [SPK14B](crate::raw::spk14b).
//!
//!  
//!
//!
//!  
//! ###  Type 15: Precessing Conic Propagation
//!
//!  The SPK data Type 15 represents a continuous ephemeris using a compact
//!    analytic model. The object is modeled as orbiting a central body under
//!    the influence of a central mass plus first order secular effects of the
//!    J2 term in harmonic expansion of the central body gravitational
//!    potential.
//!
//!  Type 15 SPK segments have the structure shown below:
//!
//!  
//!
//! ```text
//!            +--------------------------------+
//!            | Epoch of Periapsis             |
//!            +--------------------------------+
//!            | Trajectory pole_x              |
//!            +--------------------------------+
//!            | Trajectory pole_y              |
//!            +--------------------------------+
//!            | Trajectory pole_z              |
//!            +--------------------------------+
//!            | Periapsis Unit Vector_x        |
//!            +--------------------------------+
//!            | Periapsis Unit Vector_y        |
//!            +--------------------------------+
//!            | Periapsis Unit Vector_z        |
//!            +--------------------------------+
//!            | Semi-Latus Rectum              |
//!            +--------------------------------+
//!            | Eccentricity                   |
//!            +--------------------------------+
//!            | J2 Processing Flag             |
//!            +--------------------------------+
//!            | Central Body Pole_x            |
//!            +--------------------------------+
//!            | Central Body Pole_y            |
//!            +--------------------------------+
//!            | Central Body Pole_z            |
//!            +--------------------------------+
//!            | Central Body GM                |
//!            +--------------------------------+
//!            | Central Body J2                |
//!            +--------------------------------+
//!            | Central Body Equatorial Radius |
//!            +--------------------------------+
//! ```
//!
//!  It is important to note that the epoch must be that of periapsis
//!    passage. Precession of the line of apsides and regression of the line of
//!    nodes is computed relative to this epoch.
//!
//!  The effects of the J2 term are not applied if the eccentricity is
//!    greater than or equal to 1.
//!
//!  To facilitate the creation of Type 15 segments, a segment writing
//!    routine called [SPKW15](crate::raw::spkw15) has been provided. This routine takes as input
//!    arguments the handle of an SPK file that is open for writing, the
//!    information needed to construct the segment descriptor, and the data to
//!    be stored in the segment. The header of the subroutine provides a
//!    complete description of the input arguments and an example of its usage.
//!
//!  
//!
//!
//!  
//! ###  Type 17: Equinoctial Elements
//!
//!  The SPK data Type 17 represents a continuous ephemeris using a compact
//!    analytic model. The object is following an elliptic orbit with
//!    precessing line of nodes and argument of periapse relative to the
//!    equatorial frame of some central body. The orbit is modeled via
//!    equinoctial elements.
//!
//!  Type 17 SPK segments have the structure shown below:
//!
//!  
//!
//! ```text
//!              +----------------------------------+
//!           1  | Epoch of Periapsis               |
//!              +----------------------------------+
//!           2  | Semi-Major Axis                  |
//!              +----------------------------------+
//!           3  | H term of equinoctial elements   |
//!              +----------------------------------+
//!           4  | K term of equinoctial elements   |
//!              +----------------------------------+
//!           5  | Mean longitude at epoch          |
//!              +----------------------------------+
//!           6  | P term of equinoctial elements   |
//!              +----------------------------------+
//!           7  | Q term of equinoctial elements   |
//!              +----------------------------------+
//!           8  | rate of longitude of periapse    |
//!              +----------------------------------+
//!           9  | mean longitude rate              |
//!              +----------------------------------+
//!          10  | longitude of ascending node rate |
//!              +----------------------------------+
//!          11  | equatorial pole right ascension  |
//!              +----------------------------------+
//!          12  | equatorial pole declination      |
//!              +----------------------------------+
//! ```
//!
//!  To facilitate the creation of Type 17 segments, a segment writing
//!    routine called [SPKW17](crate::raw::spkw17) has been provided. This routine takes as input
//!    arguments the handle of an SPK file that is open for writing, the
//!    information needed to construct the segment descriptor, and the data to
//!    be stored in the segment. The header of the subroutine provides a
//!    complete description of the input arguments and an example of its usage.
//!
//!  
//!
//!
//!  
//! ###  Type 18: ESOC/DDID Hermite/Lagrange Interpolation
//!
//!  SPK type 18 has been provided to support accurate duplication within the
//!    SPK system of spacecraft ephemerides used by the European Space Agency
//!    (ESA) on the Mars Express, Rosetta, SMART-1 and Venus Express missions.
//!    However, the algorithms used by SPK type 18 are very general; type 18's
//!    applicability is by no means limited to these missions.
//!
//!  Because of the possibility of evolution of the mathematical
//!    representations of ephemerides used by ESA, SPK type 18 is designed to
//!    accommodate multiple representations, thereby avoiding a proliferation
//!    of SPK data types. SPK type 18 refers to each supported mathematical
//!    representation of ephemeris data as a "subtype."
//!
//!  Currently SPK type 18 supports two subtypes:
//!
//!  
//!
//! *  1. Subtype 0
//!
//!  *  Separate sliding-window Hermite interpolation of position and velocity. The
//! ephemeris is represented by a series of 12-element "packets" and
//! associated time tags. The time tags may be unequally spaced. Each packet
//! contains three Cartesian position components, three velocity components
//! meant to be used for Hermite interpolation of the position, three velocity
//! components (not necessarily equal to the previous three), and three
//! acceleration components meant to be used with the second set of velocity
//! components for Hermite interpolation of the velocity. The position and
//! velocity resulting from this interpolation method are in principle
//! independent. The same interpolation degree is used for each position and
//! velocity component.
//!
//!  *  2. Subtype 1
//!
//!  *  Separate sliding-window Lagrange interpolation of position and velocity.
//! The ephemeris is represented by a series of 6-element "packets" and
//! associated time tags. The time tags may be unequally spaced. Each packet
//! contains three Cartesian position components and three velocity components.
//! The position components and velocity components are interpolated
//! separately. The position and velocity resulting from this interpolation
//! method are in principle independent. The same interpolation degree is used
//! for each position and velocity component.
//!
//!  The sliding-window interpolation technique used by this data type works
//!    as follows: for any request epoch, the data type defines a component of
//!    position or velocity by interpolating a set of values of that component
//!    defined on a set of consecutive time tags---a "window"---centered as
//!    closely as possible to the request epoch. The nominal window size is
//!    dictated by the degree and type (Hermite vs. Lagrange) of the
//!    interpolating polynomials. Normally the window of time tags has even
//!    size, and the window is selected so that the request time is located
//!    between the two central time tags in the window.
//!
//!  When the request time is near a segment boundary, the window is
//!    truncated if necessary on the side closest to the boundary. If a segment
//!    contains too few packets to form a window of nominal size, as many
//!    packets as are needed and available are used to construct the window. In
//!    this case the window size may be odd. In any case the window never
//!    includes more than WNDSIZ/2 time tags on either side of the request
//!    time, where WNDSIZ is the nominal window size.
//!
//!  The states in a type 18 segment are geometric: they do not take into
//!    account aberration corrections. The position and velocity components of
//!    each packet represent the position (x, y, z, in kilometers and
//!    kilometers per second) of the body to which the ephemeris applies,
//!    relative to the center specified by the segment's descriptor. The epochs
//!    corresponding to the states are barycentric dynamical times (TDB),
//!    expressed as seconds past J2000.
//!
//!  Type 18 SPK segments have the structure shown below:
//!
//!  
//!
//! ```text
//!    +-----------------------+
//!    | Packet 1              |
//!    +-----------------------+
//!    | Packet 2              |
//!    +-----------------------+
//!                .
//!                .
//!                .
//!    +-----------------------+
//!    | Packet N              |
//!    +-----------------------+
//!    | Epoch 1               |
//!    +-----------------------+
//!    | Epoch 2               |
//!    +-----------------------+
//!                .
//!                .
//!                .
//!    +-----------------------+
//!    | Epoch N               |
//!    +-----------------------+
//!    | Epoch 100             | (First directory)
//!    +-----------------------+
//!                .
//!                .
//!                .
//!    +-----------------------+
//!    | Epoch ((N-1)/100)*100 | (Last directory)
//!    +-----------------------+
//!    | Subtype code          |
//!    +-----------------------+
//!    | Window size           |
//!    +-----------------------+
//!    | Number of packets     |
//!    +-----------------------+
//!  
//! ```
//!
//!  In the diagram, each box representing a packet corresponds to either
//!    twelve or six double precision numbers; the other boxes represent
//!    individual double precision numbers. The number of states normally
//!    should be greater than or equal to the window size, which is related to
//!    the polynomial degree as shown:
//!
//!  
//!
//! ```text
//!    Subtype 0:     DEGREE  =  2 * WINDOW_SIZE  -  1
//!    Subtype 1:     DEGREE  =      WINDOW_SIZE  -  1
//! ```
//!
//!  The set of time tags is augmented by a series of directory entries;
//!    these entries allow the type 18 reader to search for states more
//!    efficiently. The directory entries contain time tags whose indices are
//!    multiples of 100. The set of indices of time tags stored in the
//!    directories ranges from 100 to
//!
//!  
//!
//! ```text
//!    (  (N-1) / 100  ) * 100
//! ```
//!
//!  where N is the total number of time tags. Note that if N is
//!
//!  
//!
//! ```text
//!    Q * 100
//! ```
//!
//!  then only
//!
//!  
//!
//! ```text
//!    Q - 1
//! ```
//!
//!  directory entries are stored, and in particular, if there are only 100
//!    states in the segment, there are no directories.
//!
//!  To facilitate the creation of type 18 segments, a segment writing
//!    routine called [SPKW18](crate::raw::spkw18) has been provided. This routine takes as input
//!    arguments the handle of an SPK file that is open for writing, the
//!    information needed to construct the segment descriptor, and the data to
//!    be stored in the segment. The header of the subroutine provides a
//!    complete description of the input arguments and an example of its usage.
//!
//!  
//!
//!
//!  
//! ###  Type 19: ESOC/DDID Piecewise Interpolation
//!
//!  As with SPK type 18, SPK type 19 has been provided to support accurate
//!    duplication by the SPK system of spacecraft ephemerides used by the
//!    European Space Agency (ESA) on the Mars Express, Rosetta, SMART-1 and
//!    Venus Express missions.
//!
//!  SPK type 19 is an enhanced version of SPK type 18. Type 19 enables
//!    creation of SPK files representing the same ephemerides that can be
//!    represented using type 18, but containing far fewer segments. Data from
//!    multiple type 18 segments can be stored in a single type 19 segment, as
//!    long as those segments satisfy certain restrictions:
//!
//!  
//!
//! * The segments are for the same body, center, and reference frame.
//!
//!  * The segments' coverage intervals, when arranged in increasing time order,
//! overlap only at their endpoints, and have no intervening gaps.
//!
//!  Within a type 19 segment, each set of data corresponding to a type 18
//!    segment is called a "mini-segment." A type 19 segment contains one or
//!    more mini-segments.
//!
//!  Each mini-segment contains a time ordered, strictly increasing sequence
//!    of epochs (no two epochs of the same mini-segment may coincide) and an
//!    associated sequence of ephemeris data sets called "packets." The
//!    composition of a packet depends on the subtype of the mini-segment to
//!    which the packet belongs; subtypes are discussed in more detail below.
//!
//!  The time coverage of a mini-segment is called an "interpolation
//!    interval." The endpoints (boundaries) of each interpolation interval
//!    must be contained in the time interval bounded by the first and last
//!    members of the epoch sequence of the corresponding mini-segment. If the
//!    Ith mini-segment's epoch sequence is
//!
//!  
//!
//! ```text
//!    E_I1, ..., E_IM
//! ```
//!
//!  and the mini-segment's interpolation interval bounds are
//!
//!  
//!
//! ```text
//!    IV_IB, IV_IE
//! ```
//!
//!  then it is required that
//!
//!  
//!
//! ```text
//!    E_I1 < IV_IB < IV_IE < E_IM
//!         -              -
//! ```
//!
//!  Mini-segments are allowed to contain "padding" epochs and packets
//!    beyond both ends of their interpolation intervals. Padding epochs on the
//!    left of an interpolation interval are less than the interval start time;
//!    padding epochs on the right exceed the interval stop time. Padding
//!    enables control of interpolation behavior at and near interpolation
//!    interval boundaries. Padding does not contribute to a type 19 segment's
//!    time coverage. The use of padding is discussed in greater detail below.
//!
//!  The interpolation intervals of a type 19 segment have no intervening
//!    gaps and overlap only at single points. The end time of each
//!    interpolation interval is the start time of the next. The start time of
//!    a type 19 segment is greater than or equal to the start time of the
//!    first interval, and the segment's end time is less than or equal to the
//!    stop time of the last interval.
//!
//!  Interpolation intervals must have strictly positive length.
//!
//!  When type 19 data are interpolated to produce a state vector for a given
//!    request time, only data from a single mini-segment whose interpolation
//!    interval contains the request time are used.
//!
//!  When a request time coincides with the boundary between two
//!    interpolation intervals, there is a choice as to which interval will
//!    provide ephemeris data. The creator of a type 19 segment can control
//!    this behavior via a parameter passed to the type 19 segment writer
//!    [SPKW19](crate::raw::spkw19). For a given type 19 segment, depending on the value of this
//!    parameter, either the earlier interval is always selected, or the later
//!    interval is always selected.
//!
//!  Because of the possibility of evolution of the mathematical
//!    representations of ephemerides used by ESA, SPK type 19 is designed to
//!    accommodate multiple representations of state data, thereby avoiding a
//!    proliferation of SPK data types. SPK type 19 refers to each supported
//!    mathematical representation of ephemeris data as a "subtype."
//!
//!  Currently SPK type 19 supports three subtypes:
//!
//!  
//!
//! *  1. Subtype 0
//!
//!  *  Separate sliding-window Hermite interpolation of position and velocity. The
//! ephemeris is represented by a series of 12-element "packets" and
//! associated time tags. The time tags may be unequally spaced. Each packet
//! contains three Cartesian position components, three velocity components
//! meant to be used for Hermite interpolation of the position, three velocity
//! components (not necessarily equal to the previous three), and three
//! acceleration components meant to be used with the second set of velocity
//! components for Hermite interpolation of the velocity. The position and
//! velocity resulting from this interpolation method are in principle
//! independent. The same interpolation degree is used for each position and
//! velocity component.
//!
//!  *  The interpolation degree of a subtype 0 mini-segment must be equivalent to
//! 3 mod 4, that is, it must be in the set
//!
//!  ```text
//!             { 3, 7, 11, ..., MAXDEG }
//! ```
//!  *  where MAXDEG is the maximum supported degree.
//!
//!  *  2. Subtype 1
//!
//!  *  Separate sliding-window Lagrange interpolation of position and velocity.
//! The ephemeris is represented by a series of 6-element "packets" and
//! associated time tags. The time tags may be unequally spaced. Each packet
//! contains three Cartesian position components and three velocity components.
//! The position components and velocity components are interpolated
//! separately. The position and velocity resulting from this interpolation
//! method are in principle independent. The same interpolation degree is used
//! for each position and velocity component.
//!
//!  *  The interpolation degree of a subtype 1 mini-segment must be odd and must
//! be in the range 1:MAXDEG, where MAXDEG is the maximum supported degree.
//!
//!  *  3. Subtype 2
//!
//!  *  Sliding-window Hermite interpolation of position and velocity. The
//! ephemeris is represented by a series of 6-element "packets" and
//! associated time tags. The time tags may be unequally spaced. Each packet
//! contains three Cartesian position components and three velocity components.
//! The position components and velocity components are interpolated together.
//!
//!  *  The interpolation degree of a subtype 2 mini-segment must be equivalent to
//! 3 mod 4, that is, it must be in the set
//!
//!  ```text
//!             { 3, 7, 11, ..., MAXDEG }
//! ```
//!  *  where MAXDEG is the maximum supported degree.
//!
//!  The sliding-window interpolation technique used by this data type works
//!    as follows: for any request epoch, the data type's state evaluation code
//!    computes a component of position or velocity by interpolating a set of
//!    values of that component defined on a set of consecutive time tags---a
//!    "window"---centered as closely as possible to the request epoch. The
//!    nominal window size is dictated by the degree and type (Hermite vs.
//!    Lagrange) of the interpolating polynomials. Normally the window of time
//!    tags has even size, and the window is selected so that the request time
//!    is located between the two central time tags in the window. When the
//!    request time is too close to an endpoint of the mini-segment's epoch
//!    sequence to permit construction of a window of nominal size, the window
//!    is truncated at that endpoint.
//!
//!  Although type 19 interpolation intervals support padding, padding is not
//!    required. Below we'll discuss the role of padding, but the reader should
//!    keep in mind that the size of the pads at either end of an interpolation
//!    interval could be zero.
//!
//!  In SPK type 19, interpolation interval padding boundaries (the start
//!    time of the padding preceding the interval's coverage and the stop time
//!    of the padding following the coverage) affect interpolation in the same
//!    way that segment boundaries affect type 18 interpolation. When the
//!    request time is near a padding boundary, the window is truncated if
//!    necessary on the side closest to the boundary. If an interpolation
//!    interval, including padding, contains too few packets to form a window
//!    of nominal size, as many packets as are needed and available are used to
//!    construct the window. In this case the window size may be odd. In any
//!    case the window never includes more than WNDSIZ/2 time tags on either
//!    side of the request time, where WNDSIZ is the nominal window size.
//!
//!  The mini-segments of a type 19 segment need not use the same subtypes
//!    and interpolation degrees.
//!
//!  The states in a type 19 segment are geometric: they do not take into
//!    account aberration corrections. The position and velocity components of
//!    each packet represent the position (x, y, z, in kilometers and
//!    kilometers per second) of the body to which the ephemeris applies,
//!    relative to the center specified by the segment's descriptor. The epochs
//!    corresponding to the states are barycentric dynamical times (TDB),
//!    expressed as seconds past J2000.
//!
//!  Type 19 SPK segments have the structure shown below:
//!
//!  
//!
//! ```text
//!    +--------------------------------+
//!    | Interval 1 mini-segment        |
//!    +--------------------------------+
//!                    .
//!                    .
//!                    .
//!    +--------------------------------+
//!    | Interval N mini-segment        |
//!    +--------------------------------+
//!    | Interval 1 start time          |
//!    +--------------------------------+
//!                    .
//!                    .
//!                    .
//!    +--------------------------------+
//!    | Interval N start time          |
//!    +--------------------------------+
//!    | Interval N stop time           |
//!    +--------------------------------+
//!    | Interval start 100             | (First interval directory)
//!    +--------------------------------+
//!                    .
//!                    .
//!                    .
//!    +--------------------------------+
//!    | Interval start (N/100)*100     | (Last interval directory)
//!    +--------------------------------+
//!    | Mini-segment 1 start pointer   |
//!    +--------------------------------+
//!                    .
//!                    .
//!                    .
//!    +--------------------------------+
//!    | Mini-segment N start pointer   |
//!    +--------------------------------+
//!    | Mini-segment N stop pointer    |
//!    +--------------------------------+
//!    | Boundary choice flag           |
//!    +--------------------------------+
//!    | Number of intervals            |
//!    +--------------------------------+
//! ```
//!
//!  Below we first describe the overall segment structure, then we cover the
//!    mini-segment structure.
//!
//!  The array of interval boundaries contains the start time of each
//!    interval, plus the stop time of the final interval.
//!
//!  The list of interpolation interval boundary times has its own directory,
//!    which has the same structure as the time tag directories of type 18
//!    segments. Let the interval count be N. As with time tag directories, the
//!    start time directory contains boundary times whose indices are multiples
//!    of 100, except that if N+1 is a multiple of 100, the last boundary time
//!    is not included.
//!
//!  The array of mini-segment pointers contains a pointer to the start of
//!    each mini-segment, plus a final "stop" pointer for the final
//!    mini-segment. The stop pointer points to the location immediately
//!    following the last address of the final mini-segment.
//!
//!  The mini-segment pointers are 1-based indices relative to the start
//!    address of the segment. For example, a pointer value of 1 indicates the
//!    first address of the segment.
//!
//!  Following the mini-segment pointers is the interval selection flag. When
//!    this flag has the value 1.D0, the later interpolation interval is used
//!    when a request time falls on the common boundary between two
//!    interpolation intervals. If the selection flag is 0, the earlier
//!    interval is used.
//!
//!  Each mini-segment has the structure of a type 18 SPK segment. The
//!    structure is shown below:
//!
//!  
//!
//! ```text
//!    +-----------------------+
//!    | Packet 1              |
//!    +-----------------------+
//!                .
//!                .
//!                .
//!    +-----------------------+
//!    | Packet M              |
//!    +-----------------------+
//!    | Epoch 1               |
//!    +-----------------------+
//!                .
//!                .
//!                .
//!    +-----------------------+
//!    | Epoch M               |
//!    +-----------------------+
//!    | Epoch 100             | (First time tag directory)
//!    +-----------------------+
//!                .
//!                .
//!                .
//!    +-----------------------+
//!    | Epoch ((M-1)/100)*100 | (Last time tag directory)
//!    +-----------------------+
//!    | Subtype code          |
//!    +-----------------------+
//!    | Window size           |
//!    +-----------------------+
//!    | Number of packets     |
//!    +-----------------------+
//!  
//! ```
//!
//!  In the mini-segment diagram, each box representing a packet corresponds
//!    to either twelve or six double precision numbers; the other boxes
//!    represent individual double precision numbers. The number of packets
//!    normally should be greater than or equal to the window size, which is
//!    related to the polynomial degree as shown:
//!
//!  
//!
//! ```text
//!    Subtype 0:     DEGREE  =  2 * WINDOW_SIZE  -  1
//!    Subtype 1:     DEGREE  =      WINDOW_SIZE  -  1
//!    Subtype 2:     DEGREE  =  2 * WINDOW_SIZE  -  1
//! ```
//!
//!  The mini-segment's set of time tags is augmented by a series of
//!    directory entries; these entries allow the type 19 reader to search for
//!    packets more efficiently. The directory entries contain time tags whose
//!    indices are multiples of 100. The set of indices of time tags stored in
//!    the directories ranges from 100 to
//!
//!  
//!
//! ```text
//!    (  (M-1) / 100  ) * 100
//! ```
//!
//!  where M is the total number of time tags. Note that if M is
//!
//!  
//!
//! ```text
//!    Q * 100
//! ```
//!
//!  then only
//!
//!  
//!
//! ```text
//!    Q - 1
//! ```
//!
//!  directory entries are stored, and in particular, if there are only 100
//!    states in the segment, there are no directories.
//!
//!  Following the time tag directory are three parameters associated with
//!    the mini-segment: the subtype, the interpolation window size, and the
//!    packet count.
//!
//!  To facilitate the creation of type 19 segments, a segment writing
//!    routine called [SPKW19](crate::raw::spkw19) has been provided. This routine takes as input
//!    arguments the handle of an SPK file that is open for writing, the
//!    information needed to construct the segment descriptor, and the data to
//!    be stored in the segment. The header of the subroutine provides a
//!    complete description of the input arguments and an example of its usage.
//!
//!  
//!
//!
//!  
//! ###  Type 20: Chebyshev (velocity only)
//!
//!  SPK data type 20 contains Chebyshev polynomial coefficients for the
//!    velocity of a body, relative to its center of motion, as a function of
//!    time. The position of the body is obtained by integrating the velocity
//!    using a specified integration constant.
//!
//!  This data type is provided to accurately represent "EPM" ephemerides
//!    developed by the Institute of Applied Astronomy (IAA), Russian Academy
//!    of Sciences (RAS).
//!
//!  Each type 20 segment contains an arbitrary number of logical records.
//!    Each record contains a set of Chebyshev coefficients valid throughout an
//!    interval of fixed length. Each record also contains a position vector
//!    applicable at the midpoint of its coverage interval.
//!
//!  The records within a segment are ordered by increasing initial epoch.
//!    All records contain the same number of coefficients. A segment of this
//!    type is structured as
//!
//!  
//!
//! ```text
//!    +---------------+
//!    | Record 1      |
//!    +---------------+
//!    | Record 2      |
//!    +---------------+
//!      .
//!      .
//!      .
//!    +---------------+
//!    | Record N      |
//!    +---------------+
//!    | DSCALE        |
//!    +---------------+
//!    | TSCALE        |
//!    +---------------+
//!    | INITJD        |
//!    +---------------+
//!    | INITFR        |
//!    +---------------+
//!    | INTLEN        |
//!    +---------------+
//!    | RSIZE         |
//!    +---------------+
//!    | N             |
//!    +---------------+
//! ```
//!
//!  A set of seven parameters at the end of the segment provides the
//!    information needed to determine the location of the record corresponding
//!    to a particular epoch and to determine the units associated with the
//!    data:
//!
//!  
//!
//! *  1. DSCALE is the distance scale used for both position and velocity; DSCALE
//! has units of km. For example, if the distance units are AU, then DSCALE is
//! the value of the AU in km.
//!
//!  *  2. TSCALE is the time scale used for velocity; TSCALE has units of TDB
//! seconds. For example, if the time units of the velocity data are TDB Julian
//! days, then TSCALE is 86400.
//!
//!  *  3. INITJD is the integer part of the TDB Julian date of the initial epoch of
//! the first record. INITJD has units of Julian days. INITJD may be less than,
//! equal to, or greater than the initial epoch.
//!
//!  *  4. INITFR is the fractional part of the TDB Julian date of the initial epoch
//! of the first record. INITFR has units of Julian days. INITFR has magnitude
//! strictly less than 1 day. The sum INITJD + INITFR equals the TDB Julian
//! date of the initial epoch of the first record.
//!
//!  *  5. INTLEN is the length of the interval covered by each record, in TDB Julian
//! days.
//!
//!  *  6. RSIZE is the total size of (number of array elements in) each record. The
//! same number of coefficients is always used for each component, and all
//! records are the same size. RSIZE is 3 + 3*(DEGP+1), where DEGP is the
//! common degree of the Chebyshev expansions for each velocity component.
//!
//!  *  7. N is the number of records contained in the segment.
//!
//!  Each record is structured as follows:
//!
//!  
//!
//! ```text
//!    +------------------+
//!    | X  data          |
//!    +------------------+
//!    | Y  data          |
//!    +------------------+
//!    | Z  data          |
//!    +------------------+
//! ```
//!
//!  where each data section for coordinate I contains
//!
//!  
//!
//! ```text
//!    +-------------------------------------------------+
//!    | Chebyshev coefficients for velocity component I |
//!    +-------------------------------------------------+
//!    | Position component I at interval midpoint       |
//!    +-------------------------------------------------+
//! ```
//!
//!  The velocity coefficients have units of DSCALE km/TSCALE seconds:
//!    multiplying a Chebyshev expansion's value by DSCALE/TSCALE converts
//!    velocity to units of km/s.
//!
//!  The position at a record's midpoint epoch is given in units of DSCALE
//!    km: multiplying the position by DSCALE converts the position to units of
//!    km.
//!
//!  Type 20 data are used to compute states as follows: for a given time T
//!    seconds past J2000 TDB, let MID and RADIUS be the midpoint and radius,
//!    expressed as seconds past J2000 TDB, of the record coverage interval
//!    that contains T: the coverage interval is the time span
//!
//!  
//!
//! ```text
//!    MID - RADIUS : MID + RADIUS
//! ```
//!
//!  The velocity at T of the body relative to its center of motion is given
//!    by the value of the corresponding record's Chebyshev expansions at S,
//!    where
//!
//!  
//!
//! ```text
//!    S = (T - MID) / RADIUS
//! ```
//!
//!  The position of the body relative to its center of motion at T is given
//!    by
//!
//!  
//!
//! ```text
//!                                          S
//!    (Position at MID) +  RADIUS*( Integral ( Velocity ) )
//!                                          0
//! ```
//!
//!  The subroutine [SPKE20](crate::raw::spke20) contains the algorithm used to construct a state
//!    from a particular logical record.
//!
//!  To facilitate the creation of Type 20 segments, a segment writing
//!    routine called [SPKW20](crate::raw::spkw20) has been provided. This routine takes as input
//!    arguments the handle of an SPK file that is open for writing, the
//!    information needed to construct the segment descriptor, and the data to
//!    be stored in the segment. The header of the subroutine provides a
//!    complete description of the input arguments and an example of its usage.
//!
//!  
//!
//!
//!  
//! ###  Type 21: Extended Modified Difference Arrays
//!
//!  SPK data type 21 contains extended Modified Difference Arrays (MDA),
//!    also called "difference lines." These data structures use the same
//!    mathematical trajectory representation as SPK data type 1, but type 21
//!    allows use of larger, higher-degree MDAs.
//!
//!  This data type is normally used for spacecraft whose ephemerides are
//!    produced by JPL's principal trajectory integrator---DPTRAJ. Difference
//!    lines are extracted from spacecraft trajectory files ("P-files" and
//!    "PV-files") created by DPTRAJ.
//!
//!  Each segment containing Modified Difference Arrays contains an arbitrary
//!    number of logical records. Each record contains difference line
//!    coefficients applicable over a time interval containing a reference
//!    epoch, along with the state at that epoch. The time intervals of
//!    adjacent records overlap at their common endpoints.
//!
//!  The contents of the records themselves are described in \[163]. The
//!    subroutine [SPKE21](crate::raw::spke21) contains the algorithm used to construct a state from
//!    a particular record and epoch.
//!
//!  The records within a segment are ordered by increasing final epoch. The
//!    final epochs associated with the records must be distinct.
//!
//!  A segment of this type is structured as follows:
//!
//!  
//!
//! ```text
//!    +-----------------------------------------+
//!    | Record 1 (difference line coefficients) |
//!    +-----------------------------------------+
//!    | Record 2 (difference line coefficients) |
//!    +-----------------------------------------+
//!      .
//!      .
//!      .
//!    +-----------------------------------------+
//!    | Record N (difference line coefficients) |
//!    +-----------------------------------------+
//!    | Epoch 1                      |
//!    +------------------------------+
//!    | Epoch 2                      |
//!    +------------------------------+
//!      .
//!      .
//!      .
//!    +------------------------------+
//!    | Epoch N                      |
//!    +------------------------------+
//!    | Epoch 100                    |   (First directory epoch)
//!    +------------------------------+
//!    | Epoch 200                    |   (Second directory epoch)
//!    +------------------------------+
//!      .
//!      .
//!      .
//!    +------------------------------+
//!    | Epoch (N/100)*100            |   (Final directory epoch)
//!    +------------------------------+
//!    | Difference line size         |
//!    +------------------------------+
//!    | N                            |
//!    +------------------------------+
//! ```
//!
//!  The number of records in a segment, N, can be arbitrarily large.
//!
//!  Records 1 through N contain the difference line coefficients and other
//!    constants needed to compute state data. Each one of these records
//!    contains DLSIZE double precision numbers, where DLSIZE is in the range
//!
//!  
//!
//! ```text
//!    71 : (4*MAXTRM) + 1
//! ```
//!
//!  inclusive. MAXTRM is declared in the SPICELIB include file spk21.inc.
//!
//!  A list of the final epochs of the records is stored immediately after
//!    the last record.
//!
//!  Following the list of epochs is a second list, the "directory,"
//!    containing every 100th epoch from the previous list. If there are N
//!    epochs, there will be N/100 directory epochs. If there are fewer than
//!    100 epochs, then the segment will not contain any directory epochs.
//!    Directory epochs are used to speed up access to desired records.
//!
//!  The penultimate element of the segment is the difference line size. The
//!    final element in the segment is the number of records contained in the
//!    segment, N.
//!
//!  The index of the record providing ephemeris data for a user-specified
//!    epoch is the index of the first epoch in the segment's epoch list not
//!    less than the specified epoch.
//!
//!  
//!
//!
//!  
//! #  Appendix A --- Summary of SP-kernel Routines
//!
//!  
//!
//!
//!  
//! ##  Summary of Mnemonics
//!
//!  SPICELIB contains a family of subroutines that are designed specifically
//!    for use with SPK files. The name of each routine begins with the letters
//!    'SPK', followed by a two- or three-character mnemonic. For example, the
//!    routine that returns the state of one body with respect to another is
//!    named [SPKEZ](crate::raw::spkez), pronounced 'S-P-K-E-Z'.
//!
//!  Many of the routines listed are entry points of another routine. If a
//!    routine is an entry point, the parent routine's name will be listed
//!    inside brackets preceding the mnemonic translation.
//!
//!  The following is a complete list of mnemonics and translations, in
//!    alphabetical order.
//!
//!  
//!
//! ```text
//!    FURNSH             ( Load kernel file                     )
//!  
//!    SPK14A             ( S/P-kernel, add to a Type 14 segment )
//!    SPK14B             ( S/P-kernel, begin  a Type 14 segment )
//!    SPK14E             ( S/P-kernel, end    a Type 14 segment )
//!  
//!    SPKACS             ( S/P Kernel, aberration corrected state )
//!    SPKAPO             ( S/P-Kernel, "apparent" position only )
//!    SPKAPS             ( S/P-kernel, apparent state           )
//!  
//!    SPKCLS             ( S/P-kernel, close after write        )
//!    SPKCOV             ( S/P-kernel, coverage for a body      )
//!  
//!    SPKCPO             ( SPK, constant position observer state )
//!    SPKCPT             ( SPK, constant position target state )
//!    SPKCVO             ( SPK, constant velocity observer state )
//!    SPKCVT             ( SPK, constant velocity target state  )
//!  
//!    SPKE01             ( S/P-kernel, Evaluate record, Type 01 )
//!    SPKE02             ( S/P-kernel, Evaluate record, Type 02 )
//!    SPKE03             ( S/P-kernel, Evaluate record, Type 03 )
//!    SPKE05             ( S/P-kernel, Evaluate record, Type 05 )
//!    SPKE08             ( S/P-kernel, Evaluate record, Type 08 )
//!    SPKE09             ( S/P-kernel, Evaluate record, Type 09 )
//!    SPKE10             ( S/P-kernel, Evaluate record, Type 10 )
//!    SPKE12             ( S/P-kernel, Evaluate record, Type 12 )
//!    SPKE13             ( S/P-kernel, Evaluate record, Type 13 )
//!    SPKE14             ( S/P-kernel, Evaluate record, Type 14 )
//!    SPKE15             ( S/P-kernel, Evaluate record, Type 15 )
//!    SPKE17             ( S/P-kernel, Evaluate record, Type 17 )
//!    SPKE18             ( S/P-kernel, Evaluate record, Type 18 )
//!    SPKE19             ( S/P-kernel, Evaluate record, Type 19 )
//!    SPKE20             ( S/P-kernel, Evaluate record, Type 20 )
//!    SPKE21             ( S/P-kernel, Evaluate record, Type 21 )
//!  
//!    SPKEZ              ( S/P-kernel, Easy state                 )
//!    SPKEZP             ( S/P Kernel, easy position              )
//!    SPKEZR             ( S/P-kernel, Easier state               )
//!    SPKGEO             ( S/P-kernel, Geometric state            )
//!    SPKGPS             ( S/P Kernel, geometric position         )
//!    SPKLEF    [SPKBSR] ( S/P-kernel, Load ephemeris file        )
//!    SPKLTC             ( S/P Kernel, light time corrected state )
//!    SPKOBJ             ( S/P Kernel, bodies in a file           )
//!    SPKOPA             ( S/P-kernel, open for addition          )
//!    SPKOPN             ( S/P-kernel, open new file              )
//!    SPKPDS             ( S/P-kernel, pack descriptor            )
//!    SPKPOS             ( S/P Kernel, position                   )
//!    SPKPV              ( S/P-kernel, Position, velocity         )
//!    SPKPVN             ( S/P-kernel, Position, velocity---native)
//!  
//!    SPKR01             ( S/P-kernel, Read record, Type 01     )
//!    SPKR02             ( S/P-kernel, Read record, Type 02     )
//!    SPKR03             ( S/P-kernel, Read record, Type 03     )
//!    SPKR05             ( S/P-kernel, Read record, Type 05     )
//!    SPKR08             ( S/P-kernel, Read record, Type 08     )
//!    SPKR09             ( S/P-kernel, Read record, Type 09     )
//!    SPKR10             ( S/P-kernel, Read record, Type 10     )
//!    SPKR12             ( S/P-kernel, Read record, Type 12     )
//!    SPKR13             ( S/P-kernel, Read record, Type 13     )
//!    SPKR14             ( S/P-kernel, Read record, Type 14     )
//!    SPKR15             ( S/P-kernel, Read record, Type 15     )
//!    SPKR17             ( S/P-kernel, Read record, Type 17     )
//!    SPKR18             ( S/P-kernel, Read record, Type 18     )
//!    SPKR19             ( S/P-kernel, Read record, Type 19     )
//!    SPKR20             ( S/P-kernel, Read record, Type 20     )
//!    SPKR21             ( S/P-kernel, Read record, Type 21     )
//!  
//!    SPKS01             ( S/P-kernel, Subset data, Type 01     )
//!    SPKS02             ( S/P-kernel, Subset data, Type 02     )
//!    SPKS03             ( S/P-kernel, Subset data, Type 03     )
//!    SPKS05             ( S/P-kernel, Subset data, Type 05     )
//!    SPKS08             ( S/P-kernel, Subset data, Type 08     )
//!    SPKS09             ( S/P-kernel, Subset data, Type 09     )
//!    SPKS10             ( S/P-kernel, Subset data, Type 10     )
//!    SPKS12             ( S/P-kernel, Subset data, Type 12     )
//!    SPKS13             ( S/P-kernel, Subset data, Type 13     )
//!    SPKS14             ( S/P-kernel, Subset data, Type 14     )
//!    SPKS15             ( S/P-kernel, Subset data, Type 15     )
//!    SPKS17             ( S/P-kernel, Subset data, Type 17     )
//!    SPKS18             ( S/P-kernel, Subset data, Type 18     )
//!    SPKS19             ( S/P-kernel, Subset data, Type 19     )
//!    SPKS20             ( S/P-kernel, Subset data, Type 20     )
//!    SPKS21             ( S/P-kernel, Subset data, Type 21     )
//!  
//!    SPKSFS    [SPKBSR] ( S/P-kernel, file and segment         )
//!    SPKSSB             ( S/P-kernel, Solar system barycenter  )
//!    SPKUDS             ( S/P-kernel, Unpack descriptor        )
//!    SPKUEF    [SPKBSR] ( S/P-kernel, Unload ephemeris file    )
//!    SPKSUB             ( S/P-kernel, Subset a segment         )
//!    SPKW02             ( S/P-kernel, Write segment, Type 02   )
//!    SPKW03             ( S/P-kernel, Write segment, Type 03   )
//!    SPKW05             ( S/P-kernel, Write segment, Type 05   )
//!    SPKW08             ( S/P-kernel, Write segment, Type 08   )
//!    SPKW09             ( S/P-kernel, Write segment, Type 09   )
//!    SPKW10             ( S/P-kernel, Write segment, Type 10   )
//!    SPKW12             ( S/P-kernel, Write segment, Type 12   )
//!    SPKW13             ( S/P-kernel, Write segment, Type 13   )
//!    SPKW15             ( S/P-kernel, Write segment, Type 15   )
//!    SPKW17             ( S/P-kernel, Write segment, Type 17   )
//!    SPKW18             ( S/P-kernel, Write segment, Type 18   )
//!    SPKW19             ( S/P-kernel, Write segment, Type 19   )
//!    SPKW20             ( S/P-kernel, Write segment, Type 20   )
//!    SPKW21             ( S/P-kernel, Write segment, Type 21   )
//!  
//!    UNLOAD             ( Unload kernel file                   )
//! ```
//!
//!     
//! ##  Summary of Calling Sequences
//!
//!  The calling sequences for the SPK subroutines are summarized below. The
//!    subroutines are grouped by function.
//!
//!  High level routines for loading, unloading files:
//!
//!  
//!
//! ```text
//!    FURNSH ( FNAME )
//!    UNLOAD ( FNAME )
//! ```
//!
//!  Lower level routines for loading, unloading files:
//!
//!  
//!
//! ```text
//!    SPKLEF ( FNAME, HANDLE )
//!    SPKUEF (        HANDLE )
//! ```
//!
//!  Getting coverage summary:
//!
//!  
//!
//! ```text
//!    SPKOBJ ( <file>, IDS )
//!    SPKCOV ( <file>, <idcode>, COVER )
//! ```
//!
//!  Computing states and positions:
//!
//!  
//!
//! ```text
//!    SPKEZR ( TNAME,  ET, REF,        ABERR, ONAME, STATE, LT )
//!    SPKPOS ( TNAME,  ET, REF,        ABERR, ONAME, POSTN, LT )
//!    SPKEZ  ( TARGET, ET, REF,        ABERR, OBS,   STATE, LT )
//!    SPKEZP ( TARGET, ET, REF,        ABERR, OBS,   POSTN, LT )
//!    SPKAPO ( TARGET, ET, REF, STOBS, ABERR,        POSTN, LT )
//!    SPKSSB ( TARGET, ET, REF,                      STATE     )
//!    SPKGEO ( TARGET, ET, REF,               OBS,   STATE, LT )
//!    SPKGPS ( TARGET, ET, REF,               OBS,   POSTN, LT )
//!  
//!    SPKPVN ( HANDLE, DESCR, ET, REF, STATE, CENTER )
//!    SPKPV  ( HANDLE, DESCR, ET, REF, STATE, CENTER )
//! ```
//!
//!  Low-level routines for computing states and positions:
//!
//!  
//!
//! ```text
//!    SPKACS ( TARG,  ET,     REF,   ABCORR,
//!             OBS,   STARG,  LT,    DLT     )
//!  
//!    SPKAPS ( TARG,  ET,     REF,   ABCORR,
//!             STOBS, ACCOBS, STARG, LT,     DLT )
//!  
//!    SPKLTC ( TARG,  ET,     REF,   ABCORR,
//!             STOBS, STARG,  LT,    DLT     )
//! ```
//!
//!  Computing states using constant-velocity or constant-position objects:
//!
//!  
//!
//! ```text
//!    SPKCPO ( TARGET, ET,     OUTREF, REFLOC, ABCORR,
//!             OBSPOS, OBSCTR, OBSREF, STATE,  LT     )
//!  
//!    SPKCPT ( TRGPOS, TRGCTR, TRGREF, ET,     OUTREF,
//!             REFLOC, ABCORR, OBSRVR, STATE,  LT     )
//!  
//!    SPKCVO ( TARGET, ET,     OUTREF, REFLOC, ABCORR,
//!             OBSSTA, OBSEPC, OBSCTR, OBSREF, STATE,  LT )
//!  
//!    SPKCVT ( TRGSTA, TRGEPC, TRGCTR, TRGREF, ET,
//!             OUTREF, REFLOC, ABCORR, OBSRVR, STATE,  LT )
//! ```
//!
//!  Selecting files, segments:
//!
//!  
//!
//! ```text
//!    SPKSFS ( TARGET, ET, HANDLE, DESCR, IDENT, FOUND )
//! ```
//!
//!  Reading, evaluating records:
//!
//!  
//!
//! ```text
//!    SPKR01 ( HANDLE, DESCR, ET, RECORD        )
//!    SPKE01 (                ET, RECORD, STATE )
//!  
//!    SPKR02 ( HANDLE, DESCR, ET, RECORD        )
//!    SPKE02 (                ET, RECORD, STATE )
//!  
//!    SPKR03 ( HANDLE, DESCR, ET, RECORD        )
//!    SPKE03 (                ET, RECORD, STATE )
//!  
//!    SPKR05 ( HANDLE, DESCR, ET, RECORD        )
//!    SPKE05 (                ET, RECORD, STATE )
//!  
//!    SPKR08 ( HANDLE, DESCR, ET, RECORD        )
//!    SPKE08 (                ET, RECORD, STATE )
//!  
//!    SPKR09 ( HANDLE, DESCR, ET, RECORD        )
//!    SPKE09 (                ET, RECORD, STATE )
//!  
//!    SPKR10 ( HANDLE, DESCR, ET, RECORD        )
//!    SPKE10 (                ET, RECORD, STATE )
//!  
//!    SPKR12 ( HANDLE, DESCR, ET, RECORD        )
//!    SPKE12 (                ET, RECORD, STATE )
//!  
//!    SPKR13 ( HANDLE, DESCR, ET, RECORD        )
//!    SPKE13 (                ET, RECORD, STATE )
//!  
//!    SPKR14 ( HANDLE, DESCR, ET, RECORD        )
//!    SPKE14 (                ET, RECORD, STATE )
//!  
//!    SPKR15 ( HANDLE, DESCR, ET, RECORD        )
//!    SPKE15 (                ET, RECORD, STATE )
//!  
//!    SPKR17 ( HANDLE, DESCR, ET, RECORD        )
//!    SPKE17 (                ET, RECORD, STATE )
//!  
//!    SPKR18 ( HANDLE, DESCR, ET, RECORD        )
//!    SPKE18 (                ET, RECORD, STATE )
//!  
//!    SPKR19 ( HANDLE, DESCR, ET, RECORD        )
//!    SPKE19 (                ET, RECORD, STATE )
//!  
//!    SPKR20 ( HANDLE, DESCR, ET, RECORD        )
//!    SPKE20 (                ET, RECORD, STATE )
//!  
//!    SPKR21 ( HANDLE, DESCR, ET, RECORD        )
//!    SPKE21 (                ET, RECORD, STATE )
//! ```
//!
//!  Writing segments to files:
//!
//!  
//!
//! ```text
//!    SPKPDS ( BODY,   CENTER, FRAME,  TYPE,   FIRST, LAST,  DESCR )
//!  
//!    SPKW02 ( HANDLE, BODY,   CENTER, FRAME,  FIRST, LAST,  SEGID,
//!             INTLEN, N,      POLYDG, CDATA,  BTIME              )
//!  
//!    SPKW03 ( HANDLE, BODY,   CENTER, FRAME,  FIRST, LAST,  SEGID,
//!             INTLEN, N,      POLYDG, CDATA,  BTIME              )
//!  
//!    SPKW05 ( HANDLE, BODY,   CENTER, FRAME,  FIRST, LAST,  SEGID,
//!             GM,     N,      STATES, EPOCHS                     )
//!  
//!    SPKW08 ( HANDLE, BODY,   CENTER, FRAME,  FIRST, LAST,  SEGID,
//!             DEGREE, N,      STATES, EPOCH1, STEP               )
//!  
//!    SPKW09 ( HANDLE, BODY,   CENTER, FRAME,  FIRST, LAST,  SEGID,
//!             DEGREE, N,      STATES, EPOCHS                     )
//!  
//!    SPKW10 ( HANDLE, BODY,   CENTER, FRAME,  FIRST, LAST,
//!             SEGID,  CONSTS, N,      ELEMS,  EPOCHS      )
//!  
//!    SPKW12 ( HANDLE, BODY,   CENTER, FRAME,  FIRST, LAST,  SEGID,
//!             DEGREE, N,      STATES, EPOCH1, STEP               )
//!  
//!    SPKW13 ( HANDLE, BODY,   CENTER, FRAME,  FIRST, LAST,  SEGID,
//!             DEGREE, N,      STATES, EPOCHS                     )
//!  
//!    SPK14B ( HANDLE, SEGID,  BODY,   CENTER, FRAME,
//!             FIRST,  LAST,   CHBDEG  )
//!  
//!    SPK14A ( HANDLE, NCSETS, COEFFS, EPOCHS )
//!  
//!    SPK14E ( HANDLE )
//!  
//!    SPKW15 ( HANDLE, BODY,   CENTER, FRAME,  FIRST, LAST,  SEGID,
//!             EPOCH,  TPOLE,  PERI,   P,      ECC,   J2FLG, CPOLE,
//!             GM,     J2,     RADIUS                              )
//!  
//!    SPKW17 ( HANDLE, BODY,   CENTER, FRAME,  FIRST, LAST,
//!             SEGID,  EPOCH,  EQEL,   RAPOL,  DECPOL      )
//!  
//!    SPKW18 ( HANDLE, SUBTYP, BODY,   CENTER,  FRAME,  FIRST, LAST,
//!             SEGID,  DEGREE, N,      PACKTS,  EPOCHS              )
//!  
//!    SPKW19 ( HANDLE, BODY,   CENTER, FRAME,  FIRST,  LAST,
//!             SEGID,  NINTVL, NPKTS,  SUBTPS, DEGRES, PACKTS,
//!             EPOCHS, IVLBDS, SELLST                         )
//!  
//!    SPKW20 ( HANDLE, BODY,   CENTER, FRAME,  FIRST, LAST,
//!             SEGID,  INTLEN, N,      POLYDG, CDATA, DSCALE,
//!             TSCALE, INITJD, INITFR                        )
//!  
//!    SPKW21 ( HANDLE, BODY,   CENTER, FRAME,  FIRST, LAST,
//!             SEGID,  N,      DLSIZE, DLINES, EPOCHS      )
//! ```
//!
//!  Examining segment descriptors:
//!
//!  
//!
//! ```text
//!    SPKUDS ( DESCR, BODY, CENTER, FRAME, TYPE,
//!             FIRST, LAST, BEGIN,  END          )
//!  
//! ```
//!
//!  Extracting subsets of data from a segment:
//!
//!  
//!
//! ```text
//!    SPKS01 ( HANDLE, BADDR, EADDR, BEGIN, END )
//!    SPKS02 ( HANDLE, BADDR, EADDR, BEGIN, END )
//!    SPKS03 ( HANDLE, BADDR, EADDR, BEGIN, END )
//!    SPKS05 ( HANDLE, BADDR, EADDR, BEGIN, END )
//!    SPKS08 ( HANDLE, BADDR, EADDR, BEGIN, END )
//!    SPKS09 ( HANDLE, BADDR, EADDR, BEGIN, END )
//!    SPKS10 ( HANDLE, BADDR, EADDR, BEGIN, END )
//!    SPKS12 ( HANDLE, BADDR, EADDR, BEGIN, END )
//!    SPKS13 ( HANDLE, BADDR, EADDR, BEGIN, END )
//!    SPKS14 ( HANDLE, BADDR, EADDR, BEGIN, END )
//!    SPKS15 ( HANDLE, BADDR, EADDR, BEGIN, END )
//!    SPKS17 ( HANDLE, BADDR, EADDR, BEGIN, END )
//!    SPKS18 ( HANDLE, BADDR, EADDR, BEGIN, END )
//!    SPKS19 ( HANDLE, BADDR, EADDR, BEGIN, END )
//!    SPKS20 ( HANDLE, BADDR, EADDR, BEGIN, END )
//!    SPKS21 ( HANDLE, BADDR, EADDR, BEGIN, END )
//!  
//!    SPKSUB ( HANDLE, DESCR, IDENT, BEGIN, END, NEWH )
//! ```
//!
//!  To write new or append segments to SPK files:
//!
//!  
//!
//! ```text
//!    SPKOPN ( NAME, IFNAME, NCOMCH, HANDLE )
//!    SPKOPA ( FILE, HANDLE                 )
//!    SPKCLS ( HANDLE                       )
//! ```
//!
//!     
//! #  Appendix B --- A Template for SPK Comments
//!
//!  An undocumented ephemeris is in many respects worse than undocumented
//!    source code. With source code you can at least read the code and perhaps
//!    discern the function of the source code. An ephemeris on the other hand
//!    is a binary file. All it contains are numbers. It's very difficult to
//!    determine the purpose of an ephemeris simply from the state information
//!    it contains. For this reason, any ephemeris created for use by anyone
//!    other than yourself needs documentation.
//!
//!  If you create SPK files NAIF strongly recommends that you include
//!    descriptive documentation in the comments portion of the SPK file. You
//!    can use the utility program COMMNT to insert comments into the file, or
//!    you may use the routines in the SPC family to insert the comments when
//!    you create the SPK file. (See [commnt.ug](crate::raw::commnt.ug) or [spc.req](crate::required_reading::spc) for further details.)
//!
//!  This appendix addresses the contents of your comments. What will others
//!    (or yourself) want to know about the SPK file weeks, months or years
//!    after it has been created? Providing this information can be a
//!    challenge. It's difficult to know in advance all the questions someone
//!    might ask about an ephemeris you've created. To assist with this task
//!    NAIF has devised a "template" that you may wish to use as a starting
//!    point when creating the comments for an SPK file.
//!
//!  
//!
//!
//!  
//! ##  Constraints
//!
//!  The comments you place in an SPK file must be plain ASCII text. Each
//!    line of text must consist of 80 or fewer characters. The text must
//!    contain only printing characters (ASCII characters 32 through 126).
//!
//!  
//!
//!
//!  
//! ##  The Basic Template
//!
//!  Here's one way to create the comments for an SPK file.
//!
//!  
//!
//!
//!  
//! ###  Objects in the Ephemeris
//!
//!  List the names and NAIF ID codes for the objects in the file.
//!
//!  
//!
//!
//!  
//! ###  Approximate Time Coverage
//!
//!  Provide a summary of the time for which states are available for the
//!    objects in the file. If you use UTC times in this summary and the
//!    ephemeris extends more than 6 months into the future, you should
//!    probably state that the times are approximate. You don't know when
//!    leapseconds will occur more than a few months in advance, so you can't
//!    know the exact UTC time boundaries for the ephemeris if it extends years
//!    into the future.
//!
//!  
//!
//!
//!  
//! ###  Status
//!
//!  Provide the "status" of the ephemeris. Tell the user why this
//!    ephemeris was created and for whom it is intended. For example, if this
//!    is the second in a series of ephemerides that will be produced for some
//!    object tell which ephemeris this one supersedes. Tell the user when the
//!    next ephemeris in the series will be available. Is the ephemeris
//!    suitable only for preliminary studies? Is it good for all Earth based
//!    observations? Is this an official operational product? Are there
//!    situations for which the ephemeris is not suitable?
//!
//!  
//!
//!
//!  
//! ###  Pedigree
//!
//!  Provide a production summary for the ephemeris. Tell when the ephemeris
//!    was produced (the system time stamp may not port if the file is copied
//!    to other systems). Say who produced the ephemeris; what source products
//!    were used in the production; what version of the producing program was
//!    used in the creation of the ephemeris. If the ephemeris is based on a
//!    set of recent observations, say so. In short give the user the pedigree
//!    of this ephemeris. This information is mostly for your benefit. If a
//!    problem arises with the ephemeris, you will know how the problem was
//!    created and have a better chance of fixing the problem.
//!
//!  
//!
//!
//!  
//! ###  Usage
//!
//!  Provide information the user will need to effectively use the ephemeris.
//!    Tell the user what other SPICE kernels are needed to use this ephemeris.
//!    For example, if the ephemeris contains only the state of an asteroid
//!    relative to the sun, the user will probably need a planetary ephemeris
//!    to effectively use the one you've created. Recommend a planetary
//!    ephemeris to use with your SPK file. If the ephemeris contains states of
//!    objects relative to non-inertial frames, the user will probably need
//!    other kernels so that various state transformations can be performed.
//!    Recommend which of these kernels the user should use with your SPK file.
//!
//!  
//!
//!
//!  
//! ###  Accuracy
//!
//!  If possible give some estimate as to the accuracy of your SPK file. Use
//!    numbers. Words such as "this is the best available" do not convey how
//!    much you know about the ephemeris.
//!
//!  
//!
//!
//!  
//! ###  Special Notes
//!
//!  Provide a description of any special properties of this ephemeris. For
//!    example, if some observation seems to be in conflict with this ephemeris
//!    you should probably point this out.
//!
//!  
//!
//!
//!  
//! ###  References
//!
//!  List any references that may be relevant to the understanding of the
//!    ephemeris. For example, if the ephemeris is based upon observations
//!    contained in the literature, site the appropriate articles. If there is
//!    some technical memorandum or private communication that addresses
//!    certain aspects of this ephemeris list it. This will allow you to more
//!    easily answer questions about the ephemeris.
//!
//!  
//!
//!
//!  
//! ###  Contacts
//!
//!  List your phone number, mail or e-mail address so that users of the
//!    ephemeris will be able to get in touch with you to ask questions or
//!    offer praise.
//!
//!  
//!
//!
//!  
//! #  Appendix C---Revision History
//!
//!  
//!
//!
//!  
//! ###  August 31, 2021
//!
//!  Corrected severe documentation error in SPK type 10 (TLE) listing of
//!    geophysical constants. Table entries 5, "High altitude bound for
//!    atmospheric model in km," and 7, "Equatorial radius of the Earth in km"
//!    were switched.
//!
//!  Removed "(Short Period Orbits)" from TLE description.
//!
//!  
//!
//!
//!  
//! ###  March 29, 2017
//!
//!  Updated to describe subtype 2 of data type 19. Miscellaneous typos were
//!    corrected.
//!
//!  
//!
//!
//!  
//! ###  July 14, 2014
//!
//!  Updated to describe data types 19, 20, and 21. Updated to describe
//!    constant position and constant velocity state computation routines.
//!
//!  The light time computation section was updated.
//!
//!  The discussion of frame classes was updated to include a description of
//!    dynamic frames.
//!
//!  C wrappers for [SPKSFS](crate::raw::spksfs) and [SPKPVN](crate::raw::spkpvn) are now mentioned. Added mention of
//!    [SXFORM](crate::raw::sxform) and [STLABX](crate::raw::stlabx).
//!
//!  Removed discussion of C wrapper for [SPKPV](crate::raw::spkpv).
//!
//!  
//!
//!
//!  
//! ###  April 15, 2009
//!
//!  Updated to describe [SPKOBJ](crate::raw::spkobj) and [SPKCOV](crate::raw::spkcov).
//!
//!  Added a note about the SPICE file identification word for SPK files.
//!
//!  
//!
//!
//!  
//! ###  February 28, 2008
//!
//!  Removed references to [SPKAPP](crate::raw::spkapp); added [SPKACS](crate::raw::spkacs), [SPKAPS](crate::raw::spkaps), and [SPKLTC](crate::raw::spkltc) to
//!    mnemonics list.
//!
//!  Deleted entire subsection on low-level readers.
//!
//!  An entry for type 18 was added to the list of supported data types. (The
//!    description of type 18 was already present.)
//!
//!  The discussion of SPK file structure now states that segments need not
//!    be listed in increasing time order.
//!
//!  
//!
//!
//!  
//! ###  November 17, 2005
//!
//!  Abstract was added.
//!
//!  Calls/references to the deprecated routine [BODVAR](crate::raw::bodvar) were replaced with
//!    calls/references to [BODVCD](crate::raw::bodvcd). [BODVRD](crate::raw::bodvrd) is mentioned as another routine
//!    superseding [BODVAR](crate::raw::bodvar).
//!
//!  C examples showing incorrect calling sequences for prompt_c were
//!    corrected.
//!
//!  
//!
//!
//!  
//! ###  December 22, 2004
//!
//!  Calls/references to lower level loader/unloader routines -- [LDPOOL](crate::raw::ldpool),
//!    [SPKLEF](crate::raw::spklef), and [SPKUEF](crate::raw::spkuef) -- were replaced with calls to the current high level
//!    generic loader routines -- [FURNSH](crate::raw::furnsh) and [UNLOAD](crate::raw::unload) -- throughout the document.
//!
//!  
//!
//!
//!  
//! ###  February 2, 2004
//!
//!  In the diagram of the type 1 segment layout, the label on the final
//!    directory epoch was corrected. In addition, labeling of directory epochs
//!    was made consistent with similar diagrams for other SPK data types.
//!
//!  Performed a spell-check on text.
//!
//!  Edited description of type 10 segments.
//!
//!  
//!
//!
//!  
//! ###  September 04, 2002
//!
//!  Updated to reflect addition of SPK type 18.
//!
//!  Added a brief discussion of the DAF run-time binary file format
//!    translation capability now present in the SPICE Toolkit.
//!
//!  
//!
//!
//!  
//! ###  July 21, 2001
//!
//!  A few typos were corrected.
//!
//!  Because of the substantial changes made in this revision of the Fortran
//!    edition of the SPK Required Reading document, the description of those
//!    changes is included here.
//!
//!  
//!
//!
//!  
//! ###  March 1, 2000
//!
//!  This version describes the Hermite data types 12 and 13.
//!
//!  
//!
//!
//!  
//! ###  October 14, 1999
//!
//!  The routines
//!
//!  
//!
//! ```text
//!    SPKPOS
//!    SPKEZP
//!    SPKGPS
//!    SPKAPO
//! ```
//!
//!  were added with version N0050 of the SPICE Toolkit. These routines are
//!    the "position only" equivalents of state routines
//!
//!  
//!
//! ```text
//!    SPKEZR
//!    SPKEZ
//!    SPKGEO
//!    SPKAPP
//! ```
//!
//!  respectively. The calling sequences of the position only routines are
//!    identical to the state routines. However, where the state routines
//!    return 6-vectors (position and velocity), the position only routines
//!    return a 3-vector (just position). Moreover, the positions returned by
//!    the position only routines agree with the positions returned by the
//!    state routines.
//!
//!  Although the position only routines do not return as much information as
//!    the state routines (they don't return velocity), they are in some
//!    respects more general than the state routines. This is due to the link
//!    between the frame system and the SPK system. Some reference frames do
//!    not contain rate information. Consequently when a state is requested
//!    relative to such a frame, the state routines cannot perform
//!    transformations on the velocity components of the state. However, since
//!    the position only routines are not sensitive to the rate information,
//!    they can still perform position transformations and return the requested
//!    position.
//!
//!  
//!
//!
//!  
//! ###  March 2, 1998
//!
//!  This version contains corrections of typographical errors and
//!    miscellaneous format changes. A note has been added on porting SPK files
//!    between SPICELIB and CSPICE (the ANSI C version of SPICELIB).
//!
//!  
//!
//!
//!  
//! ###  June 24, 1997
//!
//!  This version of this document is a major reorganization and expansion of
//!    the material presented in the December 1994 version.
//!
//!  Because of the substantial changes made in this revision, the
//!    description of those changes is retained here.
//!
//!  When the SPK system was introduced, states of objects (positions and
//!    velocities) were stored relative to inertial frames and retrieved
//!    relative to inertial frames. Beginning with version 41 of the SPICE
//!    Toolkit, states can be stored relative to both inertial and non-inertial
//!    frames. Moreover, states may be retrieved relative to both inertial and
//!    non-inertial frames. Non-inertial frames may be tied to the rotation of
//!    a planet, the orientation of some structure on a spacecraft, an Earth
//!    based telescope, etc. By expanding the SPK system in this way,
//!    computation that previously required dozens lines of code may now be
//!    reduced to three or four lines of code.
//!
//!  This version of the "SPK Required Reading" documents for the first
//!    time this important expansion of the SPK system.
//!
//!  Also in this version, we document:
//!
//!  
//!
//! *  1. the ability to request states of objects by name instead of by object ID
//! codes;
//!
//!  *  2. the addition of SPK data Type 10 which allows the incorporation of NORAD
//! "two-line" elements for Earth orbiters into the SPK system;
//!
//!  *  3. the addition of SPK data Type 14 which supports Chebyshev interpolation
//! over non-uniformly spaced time intervals;
//!
//!  *  4. the addition of SPK data Type 17 which supports the inclusion of
//! equinoctial elements into the SPK system.
//!
//!  The complete list of routines that are documented for the first time is:
//!
//!  
//!
//! ```text
//!    LTIME
//!    SPKEZR
//!    SPKPVN
//!    SPKE10
//!    SPKE14
//!    SPKE17
//!    SPKR10
//!    SPKR14
//!    SPKR17
//!    SPKS10
//!    SPKS14
//!    SPKS17
//!    SPKW10
//!    SPK14A
//!    SPK14B
//!    SPK14E
//!    SPKW17
//! ```
//!
//!