Table of contents
CSPICE_WNINTD returns the window array intersection of two double
precision window arrays.
Given:
a SPICE window containing zero or more intervals.
[2l,1] = size(a); double = class(a)
b SPICE window containing zero or more intervals.
[2m,1] = size(b); double = class(b)
the call:
[c] = cspice_wnintd( a, b )
returns:
c the double precision window intersection (in the SPICE sense)
of `a' and `b'
[2n,1] = size(c); double = class(c)
`c' can overwrite `a' or `b'.
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 set of SPK files, identify the periods where
ephemeris data for the Earth system barycenter is available in
both files.
Use the SPK kernel below as input for Earth system barycenter's
ephemeris data covering from 01 Jan 1996 to 02 Jan 2111.
de403.bsp
Use the SPK kernel below as input for Earth system barycenter's
ephemeris data covering from 01 Jan 1050 to 01 Jan 2050.
de405.bsp
Example code begins here.
function wnintd_ex1()
SPK1 = 'de403.bsp';
SPK2 = 'de405.bsp';
%
% Retrieve the coverage for body 3 from SPK1
%
cov1 = cspice_spkcov( SPK1, 3, 10 );
fprintf( '%s coverage:\n', SPK1 )
fprintf( ' %25.12f %25.12f\n', cov1)
%
% Retrieve the coverage for body 3 from SPK2
%
cov2 = cspice_spkcov( SPK2, 3, 10 );
fprintf( '%s coverage:\n', SPK2 )
fprintf( ' %25.12f %25.12f\n', cov2)
%
% Perform a windows array intersection on 'cov1' and 'cov2'
%
cov3 = cspice_wnintd( cov1, cov2 );
fprintf( '\nOverlapping coverage:\n' )
fprintf( ' %25.12f %25.12f\n', cov3)
%
% The output can overwrite the input.
%
cov1 = cspice_wnintd( cov1, cov2 );
fprintf( '\nOverlapping coverage (overwriting input):\n' )
fprintf( ' %25.12f %25.12f\n', cov1)
When this program was executed on a Mac/Intel/Octave6.x/64-bit
platform, the output was:
de403.bsp coverage:
-126273537.816086068749 3502872062.183888912201
de405.bsp coverage:
-1577879958.816058635712 1577880064.183913230896
Overlapping coverage:
-126273537.816086068749 1577880064.183913230896
Overlapping coverage (overwriting input):
-126273537.816086068749 1577880064.183913230896
The intersection of two windows contains every point contained
both in the first window and in the second window.
1) The cardinality of the input windows 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.
2) If any of the input arguments, `a' or `b', is undefined, an
error is signaled by the Matlab error handling system.
3) If any of the input arguments, `a' or `b', 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)
S.C. Krening (JPL)
E.D. Wright (JPL)
-Mice Version 1.1.0, 10-AUG-2021 (EDW) (JDR)
Edited the -Examples section to comply with NAIF standard. Added
example's problem statement and modified code example to produce
formatted output.
Added -Parameters, -Exceptions, -Files, -Restrictions,
-Literature_References and -Author_and_Institution sections, and
completed -Particulars section.
Eliminated use of "lasterror" in rethrow.
Removed reference to the function's corresponding CSPICE header from
-Required_Reading section.
-Mice Version 1.0.1, 12-MAR-2012 (EDW) (SCK)
Edited -I/O section to conform to NAIF standard for Mice
documentation.
-Mice Version 1.0.0, 09-JUL-2007 (EDW)
intersect two d.p. windows
|