cspice_dskn02 |
|||

## AbstractCSPICE_DSKN02 returns the unit normal vector for a specified plate from a type 2 DSK segment. For important details concerning this module's function, please refer to the CSPICE routine dskn02_c. ## I/OGiven: handle the handle of a DSK file containing a type 2 segment from which data are to be fetched. dladsc the DLA descriptor associated with the segment from which data are to be fetched. plid a plate ID. Plate IDs range from 1 to NP (the number of plates in the segment identified by `dladsc'). the call: ## ExamplesAny 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. Look up all the vertices associated with each plate of the model contained in a specified type 2 segment. For each plate, display the plate's vertices and normal vector. For this example, we'll show the context of this look-up: opening the DSK file for read access, traversing a trivial, one-segment list to obtain the segment of interest. PRO DSKZ02_T, dsk ;; ;; Declare DSK Mice parameters for use in API calls. ;; @IcyUser ;; ;; Constants ;; PBUFSIZ = 10000L ;; ;; Initial values ;; verts = dblarr(3,3) ;; ;; Open the DSK file for read access. ;; We use the DAS-level interface for ;; this function. ;; cspice_dasopr, dsk, handle ;; ;; Begin a forward search through the ;; kernel, treating the file as a DLA. ;; In this example, it's a very short ;; search. ;; cspice_dlabfs, handle, dladsc, found if ( ~found ) then begin ;; ;; We arrive here only if the kernel ;; contains no segments. This is ;; unexpected, but we're prepared for it. ;; warning, 'No segments found in DSK file ' + dsk endif ;; ;; If we made it this far, `dladsc' is the ;; DLA descriptor of the first segment. ;; ;; Get segment vertex and plate counts. ;; cspice_dskz02, handle, dladsc, nv, np print print, 'Number of vertices: ', nv print, 'Number of plates: ', np ;; ;; Display the vertices of each plate. ;; remain = np start = 1 while (remain gt 0 ) do begin ;; ;; `nread' is the number of plates we"ll read on this ;; loop pass. Set `nread' to the minimum of PBUFSIZ ;; and `remain'. ;; nread = min( [PBUFSIZ, remain]) cspice_dskp02, handle, dladsc, start, nread, plates for i = 1, nread do begin plix = start + i - 1 ;; ;; Read the vertices of the current plate. ;; for j = 1, 3 do begin cspice_dskv02, handle, dladsc, plates[j-1,i-1], 1, v verts[*,j-1] = v endfor ;; ;; Display the vertices of the ith plate: ;; print print, 'Plate number: ', i for j = 1, 3 do begin print, ' Vertex :', j, verts[*,j-1] endfor ;; ;; Display the normal vector of the current plate: ;; ## ParticularsNone. ## Required ReadingICY.REQ DAS.REQ DSK.REQ ## Version-Icy Version 1.0.0, 13-DEC-2016, ML (JPL), EDW (JPL) ## Index_Entriescompute normal vector for a type 2 dsk plate compute normal vector from dsk type 2 plate id |

Wed Apr 5 17:58:00 2017