coordinate
count
datatype
dimension
format
header
label
link
missing
ooc
rank
sequence
shape
slot
step
unit
x" and "y" for use
in the examples below:
% nap "x = 0 .. 2 ... 0.5" ::NAP::58-58 % nap "y = x ** 2" ::NAP::61-61 % $y val -format %0.3f 0.000 0.250 1.000 2.250 4.000
coordinate coordinate ?dim_name|dim_number? ?dim_name|dim_number? …
This returns the OOC-names of the coordinate variables of selected dimensions.
If no dimensions are specified then the effect is the same as:
ooc_name coo 0 1 2 … rank-1"
Example:
% $y set coo x % $y coo ::NAP::58-58 % [$y coo] 0 0.5 1 1.5 2
count
ooc_name count
-keep
This returns the reference count.
Example (using x defined in previous example):
% $x count 2Note that the reference count is 2 because this NAO is referenced by both
x
::NAP::61-61
datatype
ooc_name datatype
This returns the data-type.
Example:
% [nap "'hello'"] dat c8
dimension
ooc_name dimension ?dim_number? ?dim_number? …
This returns
the dimension names.
ooc_name di
is equivalent to:
ooc_name di 0 1 2 … rank-1"
Example (again continuing above example):
% $y dim x
format
ooc_name format
This returns the C format for printing the NAO.
Example:
% $y set format %.4f % $y format %.4f % $y value 0.0000 0.2500 1.0000 2.2500 4.0000
header
ooc_name header
-keep
This returns similar information to the following
(but using a different format):
ooc_name ooc
ooc_name datatype
ooc_name missing
ooc_name count
ooc_name unit
ooc_name shape
ooc_name dimension
ooc_name coordinate
Example (continuing above example):
% $y header ::NAP::61-61 f64 MissingValue: NaN References: 1 Unit: (NULL) Dimension 0 Size: 5 Name: x Coordinate-variable: ::NAP::58-58 %
label
ooc_name label
This returns the label (title, etc.) of the NAO.
Example:
% $y set label "areas of squares" % $y label areas of squares
link
ooc_name link
This returns the OOC-name of the link NAO.
Example:
% $y set link [nap 42] % [$y link] 42
missing
ooc_name missing
This returns the missing value. This is the value used to indicate null or undefined data.
Example:
% $y miss NaN
ooc
ooc_name ooc
-keep
This returns the OOC-name of the NAO.
Example:
$y ooc ::NAP::61-61
rank
ooc_name rank
This returns the rank (number of dimensions).
Example:
% $y rank 1
sequence
ooc_name sequence
-keep
This returns
the sequence number of the NAO. E.g. 42 for nao.42-9
-keep: Do not delete NAO with reference count of 0
Example:
% $y seq 61
shape
ooc_name shape
This returns the shape, which is a vector of dimension sizes.
Example:
% $y shape 5
slot
ooc_name slot
-keep
This returns
the slot number of the NAO. E.g. 9 for nao.42-9
Example:
% $y sl 61
step
ooc_name step
This returns a code which indicates whether step sizes of a vector are equal, and if not, their sign. NAP uses this information for efficiency. It indicates whether a vector (not relevant for other ranks) is monotonically ascending/descending, and if so whether it is an arithmetic progression (AP). The result code is one of following strings:
+-": at least one positive step and one negative step
>= 0": all steps >= 0
<= 0": all steps <= 0
AP": equal steps (except final one which may be shorter)
Example:
% [nap "{3 5 7 7.1}"] step
AP
unit
ooc_name unit
This returns the unit of measure. This may be used in the future to support arithmetic with automatic unit conversion, but at the moment it is just descriptive information.
Example:
% $y set unit seconds % $y unit seconds