This program ingests images into SPC, building the sumfiles and nominals.
make_sumfiles reads metadata about the images from make_sumfiles.in, the position and pointing data from the kernels, and camera metadata from make_sumfiles.txt to generate body-fixed spacecraft position and pointing. It does the following:
Generates <filename>.SUM in SUMFILES
Generates <filename>.NOM in NOMINALS
Appends the image name onto PICTLIST.TXT
All the vectors in the sumfiles and nominals are in a body fixed frame with the origin at the center of the target body. The origin might be off a little bit, which means you may have to use shift eventually.
The ck and spk kernel names in make_sumfiles.txt must cover the time span of all the images being ingested. Otherwise, make_sumfiles will not work.
This program is non-standard. It frequently requires different versions for different missions to get the data in a form usable by SPC. Although the goal is to make a single version that does it all, each mission has a different image format.
If the image name is already listed in PICTLIST.TXT, make_sumfiles will not make NOMINALS or SUMFILES when you select option "0". (See below)
Changes from the ECR for 3.0.1
- Put in COM offset for the spacecraft -- See 15 June 2017 document from Brishen Hawkins and Coralie Jackman -
- Requirement SOR.5013 - account for the offset from the spacecraft center of mass of each camera
SCOBJ_SHIFT.TXT maintains the current required shift between the center of mass of the OREx spacecraft and the camera focal plane. There is one line per camera consisting of camera number, delta X, delta Y, delta Z. Units are in meters. The coordinate frame is _. If the file isn't present, then this processing step will just be skipped.
1 0 0 0 2 0 0 0 3 2000 3000 4000 4 1 1 30000 5 1 1 30000
1 0.d0 0.14351D-02 0.d0 mapcam 2 0.d0 0.64241D-04 0.d0 samcam 3 0.d0 -0.79251D-02 0.d0 polcam 4 0.d0 0.14540D-03 0.d0 navcam 5 0.d0 0.14508D-03 0.d0 nftcam
- Spice kernel file (SPICE)
make_sumfiles.txt - list of SPICE kernels
SCOBJ_SHIFT.TXT - adjustment for spacecraft center of mass to focal plane
TMP2FOCLEN.TXT - adjustment of focal length based on temperature
BIAS.TXT - a simple shift of the spacecraft position.
IFRAME.TXT - picture properties
PICTLIST.TXT - list of pictures
NOMINALS - nominal navigation information and uncertainties
SUMFILES - camera properties and navigation information
RandV.TXT - File comtaining s/c inertial position and velocity ordered by time.
When new images have been run through process_fits, then you can finish the ingestion by running make_sumfiles. Option 0 brings in new images. Typically, you will have to update make_script.txt to include SPK and CK kernels that cover these new images. Typically, you want to wait until the reconstructed kernels have been published (although you can use predicted kernels and then update them using make_sumfiles, option 1).
Option 1 is used when there is an update to the kernels (typically updated CK or SPK). It can also be used to update that starting sigma for the NOMINALS, but dynamics is a better tool for that because updating the NOMINALS will update everything to the same value.
Option 2 must be used with care. This changes the existing SUMFILES, and it allows you to tweak specific parts. Care is needed because you don't want to overwrite anything that had been done by hand and is believed to be correct (most specifically, geometry).
The following sample shows the standard inputs and the list of options for make_sumfiles:
~/bin/e.make_sumfiles Use B-Frame? (y/n) n 0. Create SUMFILES & NOMINALS and .. 1. Update old NOMINALS and .. 2. Update old SUMFILES 0
Usually, the B-Frame is not selected. The author has never selected it.
Enter the appropriate option:
0 Create SUMFILES & NOMINALS and .. - Completes both operations and ends.
1 Update old NOMINALS and .. - Completes NOMINALS operation and ends.
2 Update old SUMFILES - Issues the following prompts:
Update UTC? (y/n) Update image thresholds? (y/n) Update camera parameters? (y/n) Reset geometry? (y/n) Reset sigmas? (y/n)
Update UTC - Updates time a picture was taken.
Update image thresholds - Changes image constraints.
Update camera parameters - Changes the camera focal length, K-matrix, etc.
Reset geometry - Resets position and pointing back to nominal.
Reset sigmas - Resets uncertainty back to nominal.
Combines the converted image file with the image number, spacecraft state, spacecraft position & velocity and pointing information along with the associated calculated errors (Sigmas).
Option 0 creates .SUM and .NOM files for any new images but leaves all others C unchanged. Additionally, option 1 updates all .NOM files. Option 2 dies all of the C above and makes changes in all .SUM files. The possible changes, specified in new C entries in make_sumfiles.txt, are: C C Update UTC? (y/n) C Update image thresholds? (y/n) C Update camera parameters? (y/n) C Reset geometry? (y/n) C Reset sigmas? (y/n) C C The procedure first uses SPKEZ to calculate the spcaecraft - object vector SCOBJ and C the unit vector to the Sun in inertial space at the ephemeris time ET of an image. C It also determines the light time LT from the s/c to the target. It then determines C the transformation matrix from the camera frame (INST) to inertial space (TTVI) at C time ET using the SPICELIB routine PXFORM. Now all relevant quantities are available in C inertial space. In SPC all these quantities are used in the body-fixed frame, so we again C use PXFORM to translate from inertial to body-fixed (TIPM). We do this not at ET but at C ET-LT, since this is when the light forming the image left the target body.
(Compiled by KD)