SUBPT is a `cookbook' example program that illustrates the use of SPICELIB
Toolkit software for solving a typical geometrical problem --- computing the
apparent sub-observer point on a target body using light time corrections.
The `sub-observer point' is defined to be the point on the target body that is closest to the observer. The state of the target body at time t-Tau is the state of the target seen by the observer at time t, where Tau is the light time from the target body to the observer. The `apparent sub-observer point' is the point on the target body at time t-Tau that is closest to the observer at time t.
SUBPT will prompt you for the NAIF IDs for a target body and an observing body, the endpoints of a time interval, and a number, N. The program divides the time interval into N equally spaced times. Then, the planetocentric coordinates of the apparent sub-observer point on the target body are computed and printed on the terminal screen for each of the times in the interval.
To run SUBPT, you need to have a binary SPK ephemeris file and know for which bodies and during what time interval it has data. Also, you must know where a leapseconds kernel file and a planetary constants kernel file are on your system.
Note that the utility program called SPACIT converts an SPK file in text format to binary format and summarizes a binary SPK file. Refer to NAIF IDs Required Reading for a list of body names and integer codes.
SUBPT can be used with any SPK file. The following is a sample session which uses SUBPT to calculate the latitude and longitude of the nearest point on the Earth to the Sun through a single day.
( It is assumed that all of the necessary files are in the current directory. This particular session was run on a Sun using the UNIX operating system. )
subpt Welcome to SUBPT This program demonstrates the use of SPICELIB in computing the apparent sub-observer point on a target body. The computations make use of light time corrections. Enter the name of leapseconds kernel file: cookbook.tls Enter the name of a planetary constants kernel file: cookbook.tpc Enter the name of a binary SPK file: cookbook.bsp Working ... Please wait Enter the NAIF ID for the observing body: 10 Enter the NAIF ID for the target body: 399 Enter the beginning UTC time: jul 1 1990 Enter the ending UTC time: jul 2 1990 Enter the number of points to be calculated: 24 Planetocentric coordinates for the nearest point on the target body to the observing body (deg). Target body: 399 Observing body: 10 UTC Time Lat Lon ---------------------------------------------- 1990 JUL 01 00:00:00 23.00157 -176.91995 1990 JUL 01 00:49:39 22.99937 170.66794 1990 JUL 01 01:39:18 22.99716 158.25583 1990 JUL 01 02:28:57 22.99494 145.84372 1990 JUL 01 03:18:37 22.99272 133.43161 1990 JUL 01 04:08:16 22.99049 121.01950 1990 JUL 01 04:57:55 22.98825 108.60739 1990 JUL 01 05:47:35 22.98600 96.19527 1990 JUL 01 06:37:14 22.98375 83.78316 1990 JUL 01 07:26:53 22.98149 71.37104 1990 JUL 01 08:16:33 22.97921 58.95892 1990 JUL 01 09:06:12 22.97694 46.54680 1990 JUL 01 09:55:51 22.97465 34.13468 1990 JUL 01 10:45:31 22.97235 21.72256 1990 JUL 01 11:35:10 22.97005 9.31044 1990 JUL 01 12:24:49 22.96774 -3.10169 1990 JUL 01 13:14:28 22.96542 -15.51382 1990 JUL 01 14:04:08 22.96310 -27.92594 1990 JUL 01 14:53:47 22.96076 -40.33807 1990 JUL 01 15:43:26 22.95842 -52.75020 1990 JUL 01 16:33:06 22.95607 -65.16234 1990 JUL 01 17:22:45 22.95371 -77.57447 1990 JUL 01 18:12:24 22.95134 -89.98660 1990 JUL 01 19:02:04 22.94897 -102.39874 1990 JUL 01 19:51:43 22.94659 -114.81088 1990 JUL 01 20:41:22 22.94420 -127.22302 1990 JUL 01 21:31:02 22.94180 -139.63516 1990 JUL 01 22:20:41 22.93939 -152.04730 1990 JUL 01 23:10:20 22.93698 -164.45944 1990 JUL 02 00:00:00 22.93456 -176.87159 Continue? (Enter Y or N) n