CSPICE_DAFAC adds comments from a buffer of character strings to the
comment area of a binary DAF, appending them to any comments which
are already present in the file's comment area.
For important details concerning this module's function, please refer to
the CSPICE routine dafac_c.
handle the scalar integer referring to a DAF opened with
write access. This handle refers to the DAF to
which add the contents of 'buffer' as comments.
length the scalar integer defining the maximum length of
the string buffer rows.
buffer a string vector containing comments which to write into
the comment area of the binary DAF attached to 'handle'.
Each element of 'buffer' should contain one comment line.
cspice_dafac, handle, length, buffer
The call adds the contents of 'buffer' to the DAF referred
to by 'handle'.
Any numerical results shown for this example may differ between
platforms as the results depend on the SPICE kernels used as input
and the machine specific arithmetic implementation.
;; Create a comment text block. Use the list
;; of bodies in the SPK for this example.
comments = [ 'Body list', $
'1 MERCURY BARYCENTER', $
'2 VENUS BARYCENTER ', $
'3 EARTH BARYCENTER ', $
'4 MARS BARYCENTER ', $
'5 JUPITER BARYCENTER', $
'6 SATURN BARYCENTER ', $
'7 URANUS BARYCENTER ', $
'8 NEPTUNE BARYCENTER', $
'9 PLUTO BARYCENTER ', $
'10 SUN ', $
'199 MERCURY ', $
'299 VENUS ', $
'301 MOON ', $
'399 EARTH ', $
'401 PHOBOS ', $
'402 DEIMOS ', $
'499 MARS ', $
'501 IO ', $
'502 EUROPA ', $
'503 GANYMEDE ', $
'504 CALLISTO ', $
'599 JUPITER ', $
'603 TETHYS ', $
'604 DIONE ', $
'605 RHEA ', $
'606 TITAN ', $
'607 HYPERION ', $
'608 IAPETUS ', $
'699 SATURN ', $
'701 ARIEL ', $
'702 UMBRIEL ', $
'703 TITANIA ', $
'704 OBERON ', $
'705 MIRANDA ', $
'799 URANUS ', $
'801 TRITON ', $
'802 NEREID ', $
'899 NEPTUNE ', $
'901 CHARON ', $
'999 PLUTO ', $
'301001 ', $
'399001 GOLDSTONE ', $
'399002 CANBERRA ', $
'399003 MADRID ', $
'401001 ' ]
;; Define the SPK file to which add the 'comments' text.
SPK = 'test.spk'
;; Open for writing the 'SPK'; return the corresponding
;; file handle to 'handle'.
cspice_dafopw, SPK, handle
;; Add the comments to the 'SPK', use a default line length
;; of 80 characters.
cspice_dafac, handle, 80L, comments
;; SAFELY close the file.
Assuming 'SPK' originally lacked comments, the file now
contains the comments:
1 MERCURY BARYCENTER
2 VENUS BARYCENTER
3 EARTH BARYCENTER
4 MARS BARYCENTER
5 JUPITER BARYCENTER
6 SATURN BARYCENTER
7 URANUS BARYCENTER
8 NEPTUNE BARYCENTER
9 PLUTO BARYCENTER
If 'SPK' contained comments before running the program, the comments
defined in 'comments' are appended to the existing comments.
A binary DAF contains a data area which is reserved for storing
annotations or descriptive textual information about the data
contained in a file. This area is referred to as the ``comment
area'' of the file. The comment area of a DAF is a line oriented
medium for storing textual information. The comment area preserves
leading or embedded white space in the line(s) of text which are
stored so that the appearance of the information will be unchanged
when it is retrieved (extracted) at some other time. Trailing
blanks, however, are NOT preserved, due to the way that character
strings are represented in standard Fortran 77.
This routine will take a buffer of text lines and add (append) them
to the comment area of a binary DAF. If there are no comments in the
comment area of the file, then space will be allocated and the text
lines in `buffer' will be placed into the comment area. The text lines
may contain only printable ASCII characters (decimal values 32 -
There is NO maximum length imposed on the significant portion of a
text line that may be placed into the comment area of a DAF. The
maximum length of a line stored in the comment area should be
reasonable, however, so that they may be easily extracted. A good
maximum value for this would be 255 characters, as this can easily
accommodate ``screen width'' lines as well as long lines which may
contain some other form of information.
-Icy Version 1.0.1, 11-NOV-2013, EDW (JPL)
Edits to Examples text. Added Particulars section text.
-Icy Version 1.0.0, 22-FEB-2008, EDW (JPL)
add comments to a binary DAF
append comments to a DAF comment area