Cosmus homepage  
Home Page Downloads Projects Tech Notes About Us

Partiview Scripts and Utilities

Here are some perl scripts we've written that other Partiview-users may find useful.

Flypathmaker : fancy script for creating flypaths and asyncable snap files for mono/stereo/dome environments.

subsample.pl can be used to subsample a speck file, selecting a fraction of data points and/or only selected columns. The headers (i.e. datavar lines) are appropriately corrected.

     perl subsample.pl F inspeck [outspeck] [col1 ... colN]

pvutils.pm : general Partiview-related utilities

  • speckfilename : adds .speck to input string if not present already
  • makecmap : creates CMAP file for N random numbers
  • arccos, arcsin : work with radians
  • getDataVarNames : given .speck file, returns list and hash of datavariables
  • statsSpeck : finds number of points and columns (including x y z columns) in a speck file

  • subSampleSpeck : creates speck file with random fraction of data points of input speck file
  • subColsSpeck : creates speck file with only selected columns of input speck file
  • subSampleColsSpeck : creates speck file with only selected columns of random fraction of input speck file

  • line2speckFH : outputs a line, with optional colour and width, to a speck file specified by a filehandle
  • mesh2speckFH : outputs a mesh (ie quadrogon), with optional color, to a speck file specified by a filehandle
  • path2speckFH : outputs a path with N points and N-1 edges given by a Nx3 matrix, to a speck file specified by a filehandle

  • vd2roll : finds roll given Partiview jump parameters x y z rx ry rz

drsutils.pm

  • isNumeric : checks if input is a number
  • isInt : checks if input is an integer
  • isPosInt : checks if input is a positve integer
  • isNegInt : checks if input is a negative integer
  • isNonNegInt : checks if input is 0 or a positive integer

  • stripComment : strips input line of comments
  • isComment : checks if input line is wholly a comment
  • arrayEq : checks if two arrays of numbers are identical
  • arrayEqSTR : checks if two arrays of strings are identical
  • indexFirstOf : searches for occurrence of number in array
  • indexFirstOfSTR : searches for occurrence of string in array
  • diffArray : finds differences of successive elements of array of numbers
  • copyArrayRef : makes copy of array given a reference to it

  • numdp : finds minimum number of decimal places to represent input number
  • num2string : creates a formatted string to represent a number
  • numarray2string : returns string of formatted input array of numbers
  • array2string : returns string with elements input array

  • array2FH : outputs input array to file handle
  • array2stdout : outputs input array to screen
  • printArray : outputs array with many options
  • nearZero : checks if input is close to zero

  • makeLog : returns array of real numbers from 0 to 1 that increase logarithmically
  • makeExp : returns array of real numbers from 0 to 1 that increase exponentially

  • mag : returns magnitude of input vector
  • normalize : returns normalized version of input vector
  • gramschmidt : finds orthonormal basis of n input d-dim vectors (n<=d)

  • makeFileExtExists : splits (or adds) file name into parts

tfm.pm. Ok, this isn't ours, but we use it a lot. It's a renamed (.pl -> .pm) file of Stuart Levy that can be found in partiview's CVS folder partiview/scripts.


Contact Mark or Dinoj if you have any questions.
©2007