Table of contents
CSPICE_CELLI creates an integer Icy data cell of defined
size.
Given:
size the number of elements in the cell's integer data array.
help, size
LONG = Scalar
the call:
cell = cspice_celli( size )
returns:
cell an integer SPICE cell with `size' elements available in the
cell's data array.
help, cell, /struct
** Structure <id>, 10 tags, length=L, data length=L-1, refs=1:
OFFSET LONG Array[9]
DTYPE LONG 2
LENGTH LONG 0
SIZE LONG size
CARD LONG 0
ISSET BYTE 1
ADJUST BYTE 0
INIT BYTE 0
BASE DOUBLE Array[DATA+size]
DATA LONG 6
where L = 84 + size * 4.
The scalar IDL structure is composed of fields corresponding to
a SPICE cell:
OFFSET A 9-vector of IDL_MEMINT offsets for each of the
structure fields with respect to the beginning of the
structure.
Element 0 of the array contains the offset to the DTYPE
field; element 1 of the array contains the offset to
the LENGTH field, etc.
This array has no function in a cell sense.
The SPICE cell implementation uses the OFFSET
values to locate data fields within the IDL structure.
DTYPE Data type of cell: an integer scalar defining the type
of data stored in the cell data array.
LENGTH For character cells, the integer scalar declared length
of the cell's string array.
SIZE An integer scalar defining the maximum number of data
items that can be stored in the cell's data array.
CARD The cell's "cardinality": the integer scalar defining
the number of data items currently present in the cell
Note CARD <= SIZE.
This field has value 0 after cell creation.
ISSET A boolean scalar flag indicating whether the cell is a
SPICE set. Sets have no duplicate data items, and their
data items are stored in increasing order.
ADJUST A boolean scalar flag indicating whether the cell's
data area has adjustable size. Adjustable size cell
data areas are not currently implemented.
INIT A boolean scalar flag indicating whether the cell is
initialized.
BASE The array of type DTYPE with SIZE + DATA elements
(an N-vector, N = SIZE + DATA)
DATA The offset from the first element of the BASE array
to the cell data. This field has value
SPICE_CELL_CTRLSZ (defined in SpiceCel.h), referred to
as the control segment size.
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) Create a cell containing an integer 8-vector, insert numbers in it and
display its contents.
Example code begins here.
PRO celli_ex1
;;
;; Create a cell containing an integer 8-vector.
;;
cell = cspice_celli( 8 )
;;
;; Insert the list of integer numbers into the cell. If the item
;; is an element of the cell, the cell is not changed.
;;
items = [ 0L, 1L, 1L, 2L, 3L, 5L, 8L, 13L ]
cspice_insrti, items, cell
;;
;; Where `array' has cardinality CARD, non-zero
;; for this example.
;;
data_start = cell.data
data_end = data_start + cell.card - 1
array = cell.base[ data_start:data_end]
print, 'Integer numbers in SPICE cell:'
print, array
;;
;; Display the structure information.
;;
print
print, 'SPICE cell information:'
help, cell, /struct
END
When this program was executed on a Mac/Intel/IDL8.x/64-bit
platform, the output was:
Integer numbers in SPICE cell:
0 1 2 3 5
8 13
SPICE cell information:
** Structure <1b10eb4>, 10 tags, length=116, data length=115, refs=1:
OFFSET LONG Array[9]
DTYPE LONG 2
LENGTH LONG 0
SIZE LONG 8
CARD LONG 7
ISSET BYTE 1
ADJUST BYTE 0
INIT BYTE 1
BASE LONG Array[14]
DATA LONG 6
Note the length of the BASE field equals the defined SIZE, 8,
plus the value of the DATA offset, 6.
Access to the cell data array is best done using the Icy calls, but
if necessary a user can directly access the data.
A cell as used in Icy is a structure similar to the CSPICE expression
of a cell; all fields present in the CSPICE structure exist in the Icy
version.
The DATA field defines the offset from the start of the BASE array to
the beginning of the cell array data. The first DATA elements of BASE
serve as control information.
1) If the input argument `size' is undefined, an error is
signaled by the IDL error handling system.
2) If the input argument `size' is not of the expected type, or
it does not have the expected dimensions and size, an error is
signaled by the Icy interface.
None.
None.
ICY.REQ
CELLS.REQ
None.
J. Diaz del Rio (ODC Space)
E.D. Wright (JPL)
-Icy Version 1.0.3, 26-AUG-2021 (JDR)
Added arguments' type and size information in -I/O section.
Edited the header to comply with NAIF standard. Added complete code
example using existing fragments.
Added -Parameters, -Exceptions, -Files, -Restrictions,
-Literature_References and -Author_and_Institution sections.
-Icy Version 1.0.2, 19-JAN-2009 (EDW)
Edited -Examples sections to show use of the cardinality field,
".card," (correct) instead of the size field, ".size," (incorrect).
Eliminated the code showing direct writes to the cell data field.
Users should call Icy routines to change cell data.
-Icy Version 1.0.1, 12-SEP-2006 (EDW)
Correct Required Reading citation cell.req to cells.req.
-Icy Version 1.0.0, 01-AUG-2004 (EDW)
create an integer cell
|