Table of contents
CSPICE_WNFETD fetches (returns) a particular interval from a
double precision window.
Given:
window SPICE window containing zero or more intervals.
[2n,1] = size(window); double = class(window)
n index of a particular interval within the window.
[1,1] = size(n); int32 = class(n)
Indices range from 1 to `n', where `n' is the number of
intervals in the window:
n = size(window,1)/2
the call:
[left, right] = cspice_wnfetd( window, n )
returns:
left,
right values defining the left and right endpoints of the nth
interval in the input `window'.
[1,1] = size(left); int32 = class(left)
[1,1] = size(right); int32 = class(right)
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) Given a SPICE window of cardinality 6, fetch the left and right
endpoints of each of its 3 interval intervals.
Example code begins here.
function wnfetd_ex1()
%
% Let `window' contain the intervals
%
window = [ [ 1; 3 ]; [ 7; 11 ]; [ 23; 27 ]; ];
%
% Output the intervals. Number of intervals equals
% half the number of elements for the Nx1 `window'.
%
disp( 'Window contents:')
for i=1:cspice_wncard( window )
[left, right] = cspice_wnfetd( window, i );
fprintf( '%12.5f %12.5f\n', left, right)
end
When this program was executed on a Mac/Intel/Octave6.x/64-bit
platform, the output was:
Window contents:
1.00000 3.00000
7.00000 11.00000
23.00000 27.00000
None.
1) If `n' is less than one, the error SPICE(NOINTERVAL) is
signaled by a routine in the call tree of this routine.
2) If the interval does not exist, i.e. n > cspice_card(window)/2, the
error SPICE(NOINTERVAL) is signaled by a routine in the call
tree of this routine.
3) The cardinality of the input `window' must be even. Left
endpoints of stored intervals must be strictly greater than
preceding right endpoints. Right endpoints must be greater
than or equal to corresponding left endpoints. Invalid window
data are not diagnosed by this routine and may lead to
unpredictable results.
4) If any of the input arguments, `window' or `n', is undefined,
an error is signaled by the Matlab error handling system.
5) If any of the input arguments, `window' or `n', is not of the
expected type, or it does not have the expected dimensions and
size, an error is signaled by the Mice interface.
None.
None.
MICE.REQ
WINDOWS.REQ
None.
J. Diaz del Rio (ODC Space)
E.D. Wright (JPL)
-Mice Version 1.1.0, 13-AUG-2021 (EDW) (JDR)
Edited the header and corrected error message format
to comply with NAIF standard. Added example's problem statement.
Added -Parameters, -Exceptions, -Files, -Restrictions,
-Literature_References and -Author_and_Institution sections.
Eliminated use of "lasterror" in rethrow.
Removed reference to the function's corresponding CSPICE header from
-Required_Reading section.
-Mice Version 1.0.1, 11-JUN-2013 (EDW)
-I/O descriptions edits to conform to Mice documentation format.
-Mice Version 1.0.0, 24-JUL-2007 (EDW)
fetch an interval from a d.p. window
|