cspice_dskx02 |
|||

## AbstractCSPICE_DSKX02 determines the plate ID and body-fixed coordinates of the intersection of a specified ray with the surface defined by a type 2 DSK plate model. For important details concerning this module's function, please refer to the CSPICE routine dskx02_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. vertex is the vertex of a ray. `vertex' is expressed relative to the body fixed reference frame associated with the target body. This reference frame is the same frame relative to which the vertices of the plate model are expressed. Units are km. The vertex is required to be outside the target body. raydir is the ray's direction vector. `raydir' is expressed relative to the body fixed reference frame associated with the target body. 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 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 DSKX02_T, dsk ;; ;; IcyUser globally defines DSK parameters. ;; For more information, please see DSKIcyUser.m and ;; DSKIcyUser02.m. ;; @IcyUser NLAT = 9 NLON = 9 TOL = 1.d-12 ;; ;; 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. ;; message, 'SPICE(NODATA): No segment found in file '+ dsk endif ;; ;; If we made it this far, DLADSC is the ;; DLA descriptor of the first segment. ;; ;; We're going to generate the intercept points ;; using a set of rays which point toward the ;; origin and whose vertices are on a ;; specified lat/lon grid. To start out we ;; must pick a reasonable range from the origin ;; for the vertices: the range must be large ;; enough so that the vertices are guaranteed ;; to be outside the target body but small ;; enough that we don't lose too much precision ;; in the surface intercept computation. ;; ;; We'll look up the upper bound for the target ;; radius, then use 2 times this value as the ;; vertex magnitude. ;; cspice_dskgd, handle, dladsc, dskdsc maxr = dskdsc[ SPICE_DSK_MX3IDX] r = 2.d0 * maxr ;; ;; Now generate the intercept points. We generate ;; intercepts along latitude bounds, working from ;; north to south. Latitude ranges ;; from +80 to -80 degrees. Longitude ;; ranges from 0 to 320 degrees. The increment ;; is 20 degrees for latitude and 40 degrees for ;; longitude. ;; for i=0, (NLAT-1) do begin lat = cspice_rpd() * ( 80.0 - 20.0*i ) for j=0, (NLON-1) do begin lon = cspice_rpd() * 40.0*j ;; ;; Produce a ray vertex for the current ;; lat/lon value. Negate the vertex to ;; produce the ray's direction vector. ;; cspice_latrec, r, lon, lat, vertex raydir = -vertex ;; ;; Find the surface intercept for this ;; ray. ;; ## ParticularsThis routine solves the ray-surface intercept problem for a specified ray and a surface represented by triangular plate model. The surface representation is provided by data in a type 2 segment of a DSK file. This routine does not assume that the segment from which the surface model data are read represents the entire surface of the target body. A program could call this routine repeatedly to find the surface intercept of a ray and a shape model partitioned into multiple segments. In general, this routine should be expected to run faster when used with smaller shape models. ## Required ReadingICY.REQ DAS.REQ DSK.REQ ## Version-Icy Version 1.0.0, 14-DEC-2016, ML (JPL), EDW (JPL) ## Index_Entriesplate and plate model point intersected by ray intersection of ray and surface |

Wed Apr 5 17:58:00 2017