DLA Required Reading |
Table of ContentsDLA Required Reading Abstract Intended audience Related Documents Introduction DLA Files DLA File Structure The DLA File Record DLA Comment Area DLA Format Version DLA Forward and Backward Pointers DLA Segment Descriptors DLA Segment Layout DLA Procedures Summary of DLA Mnemonics Summary of DAS Mnemonics Summary of Calling Sequences Appendix A: Revision History 2017 APR 03 by N. J. Bachman DLA Required Reading
Abstract
Intended audience
It may also be of interest to SPICE users who wish to access the segment-oriented procedures of the DSK subsystem; however, such users may find adequate guidance in the code examples provided in API documentation of those DSK procedures and of the DLA procedures referenced by DSK documentation. Users of DSK files can find documentation of the DSK interface procedures in the DSK Required Reading file, dsk.req. Related Documents
Introduction
The DLA file format is an instance of the DAS architecture. DLA files enable user application software to view the data in a DAS file as a doubly linked list of virtual arrays, usually called ``segments,'' where each segment may contain character, double precision, and integer components. DLA segments provide a mechanism for grouping related data. For example, in the SPICE DSK format, which is a specialization of the DLA format, data are grouped into segments; each DSK segment is a DLA segment as well. DSK segments contain data representing shapes of extended objects. Such representations may use both integer and double precision data. For example, in DSK data type 2, segments contain double precision numbers that represent the vertex coordinates of triangular plates, and integers that indicate which vertices belong to each plate. DLA files may be thought of as a functional generalization of DAF files: DAF arrays contain only double precision data; DLA segments contain data of multiple types. However, there are some differences that prevent either format from being a special case of the other:
Support for backward searches is provided in the Fortran and C versions of SPICE, and may be provided in later versions of the IDL and MATLAB Toolkits. In the Icy Toolkit, functionality that makes use of DLA segments' data is provided by higher-level code, as is the case for the DSK subsystem. DLA Files
DLA File Structure
The underlying DAS architecture, in its segregated form, is:
File component Record count ============== ============ +------------------------+ | file record | ( 1 ) +------------------------+ | reserved records | ( variable ) +------------------------+ | comment records | | | ( variable ) | | +------------------------+ | first data directory | ( 1 ) +------------------------+ | character data records | | | ( variable ) | | +------------------------+ | d.p. data records | | | ( variable ) | | +------------------------+ | integer data records | | | ( variable ) | | +------------------------+The DLA format presents a higher-level view of the DAS architecture. For most purposes, DLA files can be thought of as having the following logical components:
+----------------------------+ | file record | +----------------------------+ | comment area | | | | | +----------------------------+ | DLA format version | +----------------------------+ | DLA forward and backward | | pointers | +----------------------------+ | DLA descriptors | +----------------------------+ | first virtual DLA segment | +----------------------------+ | second virtual DLA segment | | | | | +----------------------------+ ... +----------------------------+ | last virtual DLA segment | | | +----------------------------+The diagram above does not show the physical order of the segments, since segment data are distributed across the character, double precision, and integer records of the file, and since DLA descriptors are interleaved with DLA segments' integer components. Details of these components are discussed below. The DLA File Record
DAS/xxxxwhere the pattern
xxxxrepresents up to four printing characters identifying the file type. For example, in DSK files, the ID word is
DAS/DSKIn general the portion of the ID word indicating file type need not indicate explicitly that the file is a DLA file. That fact can be derived from the file type string if the type is known to the SPICE system. DLA Comment Area
DLA Format Version
SPICE identifies DLA files using a combination of three attributes:
DLA Forward and Backward Pointers
DLA Segment Descriptors
DLA descriptors are also data structures used as input and output arguments of DLA procedures. They are also used extensively as arguments to DSK procedures; the DSK subsystem is currently the only other SPICE subsystem where they're used. In the Fortran, IDL, and MATLAB SPICE Toolkits, DLA descriptors are implemented as arrays. In the CSPICE Toolkit, DLA descriptors are implemented by the structure SpiceDLADescr. The DLA segment descriptor members are:
+---------------+ | BACKWARD PTR | Linked list backward pointer +---------------+ | FORWARD PTR | Linked list forward pointer +---------------+ | BASE INT ADDR | Base DAS integer address +---------------+ | INT COMP SIZE | Size of integer segment component +---------------+ | BASE DP ADDR | Base DAS d.p. address +---------------+ | DP COMP SIZE | Size of d.p. segment component +---------------+ | BASE CHR ADDR | Base DAS character address +---------------+ | CHR COMP SIZE | Size of character segment component +---------------+The ``base address'' of a segment component of a given data type is the address, in the DAS address space of that type, preceding the first element of that component. All DAS addresses are 1-based. The general form of the doubly linked list layout in DAS integer address space is:
+------------------------------+ | Pointer to first descriptor | ----+ +------------------------------+ | +-------------| Pointer to last descriptor | | | +------------------------------+ | | | | +------------------------------+ | | NULL <---- | Backward pointer | <---+ First node | +---> | | | | +------------------------------+ | | | Forward pointer | ----+ | | +------------------------------+ | | | | Rest of DLA Descriptor 1 | | | | +------------------------------+ | | | | Segment 1 integer component | | | | +------------------------------+ | | +---- | Backward pointer | <---+ Second node | +---> | | | | +------------------------------+ | | | Forward pointer | ----+ | | +------------------------------+ | | | | Rest of DLA Descriptor 2 | | | | +------------------------------+ | | | | Segment 2 integer component | | | | +------------------------------+ | | pointer from third node <---+ Third node | . | . | . | pointer to node N-1 pointer from node N-1 | | | | | +------------------------------+ | +---> +---- | Backward pointer | <---+ Final (Nth) node +------------------------------+ | Forward pointer | ----> NULL +------------------------------+ | Rest of DLA Descriptor N | +------------------------------+ | Segment N integer component | +------------------------------+While this diagram shows the presence of multiple segments, a DLA file need not contain more than one segment. It is valid, but usually not useful, for a DLA file to have no segments. DLA Segment Layout
The segments of a DLA file consist of components in the respective DAS character, double precision, and integer address spaces. The components occupy contiguous address ranges in the respective address spaces. The general form of the DLA segment layout is:
Character space Double precision space Integer space +-------------+ +--------------------+ |Segment 1 | |Segment 1 | +------------+ |character | |double precision | |Segment 1 | |component | |component | |integer | +-------------+ | | |component | |Segment 2 | | | | | |character | +--------------------+ | | |component | |Segment 2 | +------------+ | | |double precision | +-------------+ |component | +------------+ +--------------------+ |Segment 2 | |integer | |component | +------------+ ... ... ...In the diagram above, the first integer segment component is displaced downward slightly to indicate that the first component starts at an integer address greater than 1: that component is preceded by other information. DLA descriptors lie between consecutively numbered integer components, so those components are not contiguous. Any of the segment components may be empty, but the DAS integer address space is never empty. In a segregated DLA file, all segment components of a given type are stored sequentially in the DAS address space of that type. DLA Procedures
In all languages supported by SPICE, the DLA subsystem provides procedures for traversing DLA segment lists. Although the term is somewhat inaccurate, this is usually referred to as ``searching'' the lists. Procedures of the DAS subsystem enable applications to open a DLA file for read access, close a DLA file, and extract comments from a DLA file's comment area. In the Fortran and C SPICE Toolkits, DAS procedures can open an existing DLA file for write access and delete or write to a DLA file's comment area. In the Fortran SPICE Toolkit, DLA procedures are provided to open a new DLA file and to start and finish new DLA segments. DAS procedures are provided to write data to DLA segments, read data from DLA segments, and update data in existing DLA segments. Summary of DLA Mnemonics
bfs Begin forward search fns Find next segment Summary of DAS Mnemonics
cls Close file ec Extract comments from file opr Open file for read access Summary of Calling Sequences
The following procedures are intended for use by both Icy users' application programs and by Icy procedures. Opening and closing files:
cspice_dascls, handle cspice_dasopr, fname, handleSearching for segments:
cspice_dlabfs, handle, descr, found cspice_dlafns, handle, descr, nxtdsc, foundAccessing the comment area:
cspice_dasec, handle, bufsiz, linlen, n, buffer, done Appendix A: Revision History2017 APR 03 by N. J. Bachman
|