Table of contents
CSPICE_EKCII returns the attribute information of a column
in an EK table, specifying the column by table name
and column index.
Given:
table the scalar string name of a loaded table.
help, table
STRING = Scalar
cindex the scalar integer index, within the table's column attribute
table, of the column whose attributes are to be found.
help, cindex
LONG = Scalar
The indices of the column table entries range from 0 to
CCOUNT-1, where CCOUNT is the value returned by the routine
cspice_ekccnt.
the call:
cspice_ekcii, table, cindex, column, attdsc
returns:
column the name of the column corresponding to index `cindex'.
help, column
STRING = Scalar
attdsc the attribute information of `column'.
help, attdsc
STRUCT = CSPICE_EKATTDSC
The members of CSPICE_EKATTDSC consist of:
CCLASS integer column class code
DTYPE integer data type code
STRLEN integer string length
SIZE integer column entry size, has value
SPICE_EK_VARSIZ (-1) for variable size entries
INDEXD boolean flag, true if column is indexed
NULLOK boolean flag, true if column value
allows nulls
None.
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.
1) Dump the names and attributes of the columns in each loaded
table.
Example code begins here.
PRO ekcii_ex1
;;
;; Local variables
;;
ek = ''
;;
;; Assign character arrays to translate index values.
;;
typstrs = [ "CHR", "DP", "INT", "TIME" ]
indexed = [ "FALSE", "TRUE" ]
null = [ "FALSE", "TRUE" ]
;;
;; Prompt for the EK file name.
;;
read, ek, PROMPT = 'Enter name of EK to examine > '
cspice_furnsh, ek
;;
;; How many loaded tables in the active EK?
;;
cspice_ekntab, num_table
print, 'Number of tables in EK: ', num_table
print, '------------------------------' + $
'------------------------------'
;;
;; Loop over the number of tables.
;;
for i=0, (num_table - 1 ) do begin
;;
;; Retrieve the name of each table.
;;
cspice_ektnam, i, table_name
;;
;; Retrieve the number of columns for each table.
;;
cspice_ekccnt, table_name, num_cols
print
print, ' Table: ', table_name, ' number of columns: ', num_cols
for j=0, (num_cols-1) do begin
;;
;; Retrieve the column name corresponding to the
;; index j and the structure of column attributes.
;;
cspice_ekcii, table_name, j, column_name, attdsc
print
print, ' Column: ', column_name
print, ' class: ', attdsc.cclass
print, ' type: ', typstrs[attdsc.dtype]
;;
;; If a character column, return the value of the
;; string length.
;;
if ( typstrs[attdsc.dtype] EQ "CHR" ) then begin
print, ' length: ', attdsc.strlen
endif
print, ' size: ', attdsc.size
print, ' indexed: ', indexed[attdsc.indexd]
print, ' null ok: ', null[attdsc.nullok]
endfor
endfor
;;
;; Unload the kernel.
;;
cspice_unload, ek
END
When this program was executed on a Mac/Intel/IDL8.x/64-bit
platform, using the EK file named vo_sedr.bdb to load the
Viking Orbiter Image SEDR Data, the output was:
Enter name of EK to examine > vo_sedr.bdb
Number of tables in EK: 1
------------------------------------------------------------
Table: VIKING_SEDR_DATA number of columns: 14
Column: IMAGE_ID
class: 9
type: CHR
length: 6
size: 1
indexed: TRUE
null ok: TRUE
Column: IMAGE_NUMBER
class: 7
type: INT
size: 1
indexed: TRUE
null ok: TRUE
Column: SPACECRAFT_ID
class: 9
type: CHR
length: 3
size: 1
indexed: TRUE
null ok: TRUE
Column: IMAGE_TIME
class: 8
type: TIME
size: 1
indexed: TRUE
null ok: TRUE
Column: INSTRUMENT_ID
class: 9
type: CHR
length: 4
size: 1
indexed: TRUE
null ok: TRUE
Column: GAIN_MODE_ID
class: 9
type: CHR
length: 4
size: 1
indexed: FALSE
null ok: TRUE
Column: FLOOD_MODE_ID
class: 9
type: CHR
length: 3
size: 1
indexed: FALSE
null ok: TRUE
Column: OFFSET_MODE_ID
class: 9
type: CHR
length: 3
size: 1
indexed: FALSE
null ok: TRUE
Column: FILTER_ID
class: 7
type: INT
size: 1
indexed: TRUE
null ok: TRUE
Column: EXPOSURE_DURATION
class: 8
type: DP
size: 1
indexed: TRUE
null ok: TRUE
Column: PLATFORM_IN_MOTION
class: 9
type: CHR
length: 3
size: 1
indexed: FALSE
null ok: TRUE
Column: PLATFORM_CONE
class: 8
type: DP
size: 1
indexed: FALSE
null ok: TRUE
Column: PLATFORM_CLOCK
class: 8
type: DP
[...]
Warning: incomplete output. Only 100 out of 110 lines have been
provided.
This routine is a utility that allows a calling routine to
determine the attributes of the currently loaded columns.
1) If the specified table is not loaded, the error
SPICE(TABLENOTLOADED) is signaled by a routine in the call
tree of this routine.
2) If the input argument `cindex' is out of range, the error
SPICE(INVALIDINDEX) is signaled by a routine in the call tree
of this routine.
3) If any of the input arguments, `table' or `cindex', is
undefined, an error is signaled by the IDL error handling
system.
4) If any of the input arguments, `table' or `cindex', is not of
the expected type, or it does not have the expected dimensions
and size, an error is signaled by the Icy interface.
5) If any of the output arguments, `column' or `attdsc', is not a
named variable, an error is signaled by the Icy interface.
This routine reads binary "sequence component" EK files.
In order for a binary EK file to be accessible to this routine,
the file must be "loaded" via a call to the routine cspice_eklef.
Text format EK files cannot be used by this routine; they must
first be converted by binary format by the NAIF Toolkit utility
SPACIT.
None.
ICY.REQ
EK.REQ
None.
J. Diaz del Rio (ODC Space)
E.D. Wright (JPL)
-Icy Version 1.0.1, 31-MAY-2021 (JDR)
Edited the header to comply with NAIF standard. Added complete code
example from existing fragment.
Added -Parameters, -Exceptions, -Files, -Restrictions,
-Literature_References and -Author_and_Institution sections, and
completed -Particulars section.
Removed reference to the routine's corresponding CSPICE header from
-Abstract section.
Added arguments' type and size information in the -I/O section.
-Icy Version 1.0.0, 16-JUN-2003 (EDW)
return information on loaded EK column specified by index
|