Index of Functions: A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 
Index Page
cspice_wncond

Table of contents
Abstract
I/O
Parameters
Examples
Particulars
Exceptions
Files
Restrictions
Required_Reading
Literature_References
Author_and_Institution
Version
Index_Entries


Abstract


   CSPICE_WNCOND contracts each interval of a double
   precision window.

I/O


   Given:

      left     the scalar, double precision amount to add to the left endpoint
               of each interval in the input window.

               help, left
                  DOUBLE = Scalar

      right    the scalar, double precision amount to subtract to the right
               endpoint of each interval in the input window.

               help, right
                  DOUBLE = Scalar

      window   the scalar window to contract.

               help, window
                  STRUCT = cspice_celld(2*N)

               `window' must be created as a window structure via a
               cspice_celld call.

   the call:

      cspice_wncond, left, right, window

   returns:

      window   the scalar output of `window', containing zero or more
               intervals, with each of its intervals contracted by `left'
               units on the left and `right' units on the right.

               help, window
                  STRUCT = cspice_celld(2*N)

Parameters


   None.

Examples


   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 double precision window, containing the following four
      intervals:

         [ 1.0, 3.0 ], [ 7.0, 11.0 ], [ 23.0, 27.0 ], [ 29.0, 29.0 ]

      contract each interval by 2.0 units on the left and 1.0 on the
      right endpoints, then by -2.0 units on the left and 2.0 units on
      the right, and finally -2.0 units on the left and -1.0 units on
      the right.

      Example code begins here.


      PRO wncond_ex1

         ;;
         ;; Create a cell containing a double precision
         ;; 8-vector.
         ;;
         win1 = cspice_celld( 8 )

         ;;
         ;; Define a window with four intervals.
         ;;
         darray = [ [ 1.d, 3.0], [ 7.0, 11.0], [23.0, 27.0], [29.0, 29.0] ]

         ;;
         ;; Add the window data to the cell.
         ;;
         for i=0, 3 do begin

            cspice_wninsd, darray[0,i], darray[1,i], win1

         endfor

         ;;
         ;; Do the contraction.
         ;;
         left  = 2.d
         right = 1.d
         cspice_wncond, left, right, win1

         ;;
         ;; Calculate the number of intervals in the
         ;; return window 'win1'.
         ;;
         no_intervals = cspice_wncard(win1)

         ;;
         ;; Output the intervals.
         ;;
         print, '1: Contracted window by  2 (left) and  1 (right):'
         for i= 0, (no_intervals -1 ) do begin

            cspice_wnfetd, win1, i, left, right
            print, left, right

         endfor

         ;;
         ;; Do the contraction with -2 and 2
         ;;
         cspice_wncond, -2.d, 2.d, win1

         print, '2: Contracted window by -2 (left) and  2 (right):'
         for i= 0, (cspice_wncard(win1) -1 ) do begin

            cspice_wnfetd, win1, i, left, right
            print, left, right

         endfor

         ;;
         ;; Do the contraction with -2 and -1
         ;;
         cspice_wncond, -2.d, -1.d, win1

         print, '3: Contracted window by -2 (left) and -1 (right):'
         for i= 0, (cspice_wncard(win1) -1 ) do begin

            cspice_wnfetd, win1, i, left, right
            print, left, right

         endfor

      END


      When this program was executed on a Mac/Intel/IDL8.x/64-bit
      platform, the output was:


      1: Contracted window by  2 (left) and  1 (right):
             9.0000000       10.000000
             25.000000       26.000000
      2: Contracted window by -2 (left) and  2 (right):
             7.0000000       8.0000000
             23.000000       24.000000
      3: Contracted window by -2 (left) and -1 (right):
             5.0000000       9.0000000
             21.000000       25.000000


      Note that intervals may be "contracted" by negative amounts.
      In the example above, the second case shifts each interval to
      the left, while the third case undoes the effect of the first
      call (without restoring the destroyed intervals).

      Note also that the third case is exactly equivalent to the
      call:

         cspice_wnexpd, 2.d, 1.d, window

Particulars


   The user must create any needed window structures with
   cspice_celld prior to use regardless of whether the routine
   uses the window as input or returns it as output.

   This routine contracts (shortens) each of the intervals in
   the input window. The adjustments are not necessarily symmetric.
   That is, left units are added to the left endpoint of each
   interval, and right units are subtracted from the right endpoint
   of each interval, where left and right may be different.

   Intervals are dropped when they are contracted by amounts
   greater than their measures.

Exceptions


   1)  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.

   2)  If any of the input arguments, `left', `right' or `window', is
       undefined, an error is signaled by the IDL error handling
       system.

   3)  If any of the input arguments, `left', `right' or `window', is
       not of the expected type, or it does not have the expected
       dimensions and size, an error is signaled by the Icy
       interface.

Files


   None.

Restrictions


   None.

Required_Reading


   ICY.REQ
   CELLS.REQ
   WINDOWS.REQ

Literature_References


   None.

Author_and_Institution


   J. Diaz del Rio     (ODC Space)
   E.D. Wright         (JPL)

Version


   -Icy Version 1.0.3, 10-AUG-2021 (JDR)

       Edited the header to comply with NAIF standard. Added
       example's problem statement and extended example.

       Extended -Particulars section.

       Added -Parameters, -Exceptions, -Files, -Restrictions,
       -Literature_References and -Author_and_Institution sections.

       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.2, 26-NOV-2007 (EDW)

       Implemented use of cspice_wncard function in the example code to
       return window cardinality.

   -Icy Version 1.0.1, 12-SEP-2006 (EDW)

       Correct Required Reading citation cell.req to cells.req.

   -Icy Version 1.0.0, 08-AUG-2004 (EDW)

Index_Entries


   contract the intervals of a d.p. window



Fri Dec 31 18:43:09 2021