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. ## I/OGiven: handle the handle of a DSK file containing a type 2 segment from which data are to be fetched. [1,1] = size(handle); int32 = class(handle) dladsc the DLA descriptor associated with the segment from which data are to be fetched. [SPICE_DLA_DSCSIZ,1] = size(dladsc) int32 = class(dladsc) 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. [3,1] = size(vertex); double = class(vertex) 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. [3,1] = size(raydir); double = class(raydir) the call: [ plid, xpt, found] = ## 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. Example (1): 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. function dskx02_t( dsk ) % % MiceUser globally defines DSK parameters. % For more information, please see DSKMiceUser.m and % DSKMice02.m. % MiceUser NLAT = 9; NLON = 9; TOL = 1.e-12; % % Open the DSK file for read access. % We use the DAS-level interface for % this function. % handle = cspice_dasopr( dsk ); % % Begin a forward search through the % kernel, treating the file as a DLA. % In this example, it's a very short % search. % [dladsc, found] = cspice_dlabfs( handle ); if ~found % % We arrive here only if the kernel % contains no segments. This is % unexpected, but we're prepared for it. % txt = sprintf( ['SPICE(NODATA): ' ... 'No segments found in DSK file %s.\n'], dsk ); error( txt ) end % % 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. % dskdsc = cspice_dskgd( handle, dladsc ); maxr = dskdsc( SPICE_DSK_MX3IDX); r = 2.0 * 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) lat = cspice_rpd() * ( 80.0 - 20.0*i ); for j = 0:(NLON-1) 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. % vertex = cspice_latrec ( r, lon, lat ); raydir = -vertex; % % Find the surface intercept for this % ray. % [plid, xpt, found] = ## 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 ReadingFor important details concerning this module's function, please refer to the CSPICE routine dskx02_c. MICE.REQ DAS.REQ DSK.REQ ## Version-Mice Version 1.0.0, 30-MAR-2014, EDW (JPL), NJB (JPL) ## Index_Entriesplate and plate model point intersected by ray intersection of ray and surface |

Wed Apr 5 18:00:31 2017