cspice_dskmi2 |
|||

## AbstractCSPICE_DSKMI2 makes a spatial index for type 2 DSK segment. ## I/OGiven: vrtces is an array of coordinates of the vertices. The Ith vertex occupies elements [1:3,I] of this array. [3,m] = size(vrtces); double = class(vrtces) plates is an array representing the triangular plates of a shape model. The elements of `plates' are vertex indices; vertex indices are 1-based. The vertex indices of the Ith plate occupy elements [1:3,I] of this array. [3,n] = size(plates); int32 = class(plates) finscl is the fine voxel scale. [1,1] = size(finscl); double = class(finscl) This scale determines the edge length of the cubical voxels comprising the fine voxel grid: the edge length `voxsiz' is approximately finscl * {average plate extent} where the extents of a plate are the respective differences between the maximum and minimum coordinate values of the plate's vertices. The relationship between `voxsiz' and the average plate extent is approximate because the `voxsiz' is adjusted so that each dimension of the fine voxel grid is an integer multiple of the coarse voxel scale. See the Particulars section below for further information on voxel scales. corscl is the coarse voxel scale. This integer scale is the ratio of the edge length of coarse voxels to that of fine voxels. The coarse scale must be large enough so that the total number of coarse voxels does not exceed SPICE_DSK02_MAXCGR (see DSKMice02.m). [1,1] = size(corscl); int32 = class(corscl) worksz is the second dimension of the workspace array `work'. [1,1] = size(worksz); int32 = class(worksz) `worksz' must be at least as large as the greater of - the number of fine voxel-plate associations This number is equal to np * {average number of fine voxels intersected by each plate} - the number of vertex-plate associations, if the vertex-plate mapping is constructed. This number is equal to nv + ( 3 * np ) voxpsz is the size of the fine voxel-plate pointer array. [1,1] = size(voxpsz); int32 = class(voxpsz) This array maps fine voxels to lists of plates that intersect those voxels. `voxpsz' must be at least as large as 3 corscl * {number of non-empty coarse voxels} voxlsz is the size of the fine voxel-plate list array. [1,1] = size(voxpsz); int32 = class(voxpsz) This array contains, for each non-empty fine voxel, the count of plates that intersect that voxel and the IDs of those plates. `voxlsz' must be at least as large as `np' * {average number of fine voxels intersected by each plate} + {number of non-empty fine voxels} makvtl is a logical flag that, when set to true, indicates that a vertex-plate association list is to be constructed. [1,1] = size(makvtl); logical = class(makvtl) The amount of workspace that is needed may depend on whether a vertex-plate association list is constructed. When this list is constructed, the size of the integer component of the spatial index is increased by the size of the list and the size of a vertex-plate pointer array; the total of these sizes is ( 2 * nv ) + ( 3 * np ) spxisz is the declared size of the output array SPAIXI. [1,1] = size(voxpsz); int32 = class(voxpsz) This size must be at least as large as the sum of - the fixed-size part of the integer component of the index, which includes the coarse voxel grid; this value is SPICE_DSK02_IDXFIX - the size `voxpsz' of the voxel-plate pointer array - the size `voxlsz' of the voxel-plate association list plus, if the vertex-plate association list is constructed, - the size `nv' of the vertex-plate pointer array - the size of the vertex-plate association list; this size is nv + ( 3 * np ) the call: [spaixd, spaixi] = ## 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): function dskmi2_t % % MiceUser globally defines DSK parameters. % For more information, please see DSKMiceUser.m and % DSKMice02.m. % MiceUser NSEG = 3; cornam = { 'radius', 'Z-coordinate', 'Z-coordinate', 'altitude'}; % % Assign names of input and output DSK files. % indsk = '/kernels/gen/dsk/phobos_3_3.bds'; dsk = 'phobos_3_3_3seg.bds'; if ( exist( dsk, 'file' ) == 2 ) delete( dsk ) end % % Open input DSK for read access; find first segment. % inhan = cspice_dasopr( indsk ); [dladsc, found] = cspice_dlabfs( inhan ); % % Fetch vertices and plates from input DSK file. % % Note that vertex and plate indices are 1-based. % disp( 'Reading input data...' ) vrtces = cspice_dskv02( inhan, dladsc, 1, SPICE_DSK02_MAXVRT ); plates = cspice_dskp02( inhan, dladsc, 1, SPICE_DSK02_MAXPLT ); disp( 'Done.' ) % % Set input array sizes required by ## ParticularsNone. ## Required ReadingFor important details concerning this module's function, please refer to the CSPICE routine dskmi2_c. MICE.REQ DAS.REQ DSK.REQ ## Version-Mice Version 1.0.0, 04-FEB-2016, EDW (JPL), NJB (JPL) ## Index_Entriesmake spatial index for type 2 dsk segment |

Wed Apr 5 18:00:30 2017