Importing Your Data
Importing Your Data into Partiview
If you have your own data and would like to display it in Partiview, follow these steps and you'll be flying in no time.
To display your data in Partiview follow these basic steps:
- Prepare your data in the Partiview data format and write that to a .speck file.
- If you want labels on the points, include these in your .speck file or create a .label file.
- Create a config (.cf) file with the desired Partiview commands to initialize the display of your data as well as the Partiview session.
- If you desire automatic data loading upon starting Partiview, create a start-up file (.bat file for Windows, .command for Macintosh, .sh for Linux and IRIX).
- Run the startup file and your data should be displayed in Partiview.
Now, let's look at each of these steps in detail.
- Prepare Your Data
- The Partiview data format can be as simple as a file of x, y, z data. However, there are more complex data formats that result in more powerful data display and manipulation. Generally, the data format takes the form:
x y z datavar0 datavar1 datavar2 ... datavarN
If you have data variables in addition to the positional data, they must be defined at the top of the file. For example, if you have color data associated with each point, you can define that as datavar 0 using a datavar command at the top of the file, like
datavar 0 color
Or, if you have 20 different textures that you want to associate with your data and column 6 in your data file indicates which texture to use for that data point, then put the commands
datavar 3 texnum
texturevar 3The first command tells Partiview to associate the data variable called texnum with column 6 (the first three columns are always x, y, z, so column zero in Partiview is always column 4 in the data file). The second command explicitly associates column 6 as the texture variable via the texturevar command. The best way to explore the file formats is to explore the supplied data sets and those of the Digital Universe.
- Create a Label File (if desired)
- The .label file takes the form:
x y z text yourlabel
where the text command is used to tell Partiview that anything after it should be printed at that specified point. The yourlabel label can have spaces and punctuation. For example, a typical line may look like the following:
20 30 40 text Alpha Ori
Then, Partiview would place the label “Alpha Ori” at the location (x, y, z) = (20, 30, 40). Note that you can place label data in the .speck file, but it will increase the number of data points that Partiview thinks exists since each line is counted as a data point.
- Create a Config File
- Create a configuration file to set the properties of the Partiview session as well as the properties of the data display. The properties of the Partiview session are set using the global display commands outlined in “Global View Attributes” and include settings made with commands like fov, interest, censize, and jump, to name a few. The data display properties are set using the group display commands and include commands to set the particle luminosity, the color of the data set, as well as starting with the points or polygons on or off. In addition, some other commands will be needed to read the files and set the correct file path. Please see the config files in the mandata directory for examples.
- Create a Startup File
- The startup file will launch Partiview and load data sets as well as your configuration commands. This is done by a one-line file which contains the name of the Partiview executable followed by the name of the config file. The startup file must be in the same directory as the Partiview executable. For Windows, this file must have the extension .bat. So, the yourdata.bat file might look like this:
partiview ./data/yourdatafolder/yourdata.cf
For Macintosh users, the file must end with the .command extension and be executable. The format looks like:
./partiview ./data/yourdatafolder/yourdata.cf
For Linux and IRIX users, the file may have any name but must be made into an executable via the chmod command. The file might look something like this:
./partiview ./data/yourdatadirectory/yourdata.cf
- Launch Partiview
- Run the startup file you just created to launch Partiview and your data. If your data do not appear in the display, a number of things could be wrong.
© 2002-2005 American Museum of Natural History
Last Modified: 2006-04-28 by Brian Abbott
