C-SAFE Home

Information/Instructions/Making nrrd

From C-SAFE Wiki

Jump to: navigation, search

Contents

Creating NRRD files from UDA datasets

  • Note, this section used to contain information on how to use RTRT to generate a NRRD containing particle data. You no longer need to do this, as uda2nrrd now works for particles. (If for some reason you need to get this information, it exists in the history tab of this page.)

Use the 'uda2nrrd' application, found in your Uintah Package at this location:

.../SCIRun/inferno32opt/Packages/Uintah/StandAlone/tools/uda2nrrd/

Creating Particle NRRDs

> uda2nrrd -p -uda <path to uda>

This will create one nrrd (consisting of two files, the data and header) for each timestep. Eg:

particles_t054038.nhdr
particles_t054038.raw

Particle Radius

If your UDA originally saved p.volume, then this variable will be used to determine the radius of each particle sphear as displayed by the ray tracer.

However, if you don't have the volume variable saved, you can still create a radius value to use. To do this, you must run the radius_maker program (SCIRun/bin/Packages/Uintah/StandAlone/tools/radiusMaker/) and specify which variable (usually mass) you wish to use to derive the radius of the particle from. Radius_maker will read in the original NRRD and create a new one with an added parameter (radius).

radius_maker -i spherefile.raw.nhdr -o spherefile-radius.raw.nhdr -var 4 1.0

For multiple files: (using tcsh)

foreach file (*.nhdr)
  radius_maker -i $file -o `basename $file .raw.nhdr`-radius.nhdr -var 4 1.0
end

(The above command line assumes that p.mass is the 5th (0-indexed) variable.)

Extracting Volume Field (eg: Fire)

You can only visualize one grid variable at a time in the ray tracer. For the most part we choose to visualize the temperature field. However, there are other fields that you could use:

To get a list of the variables in the UDA you might be interested in:

puda -listvariables ../../disks.uda

Once you know the variable you wish to extract from the UDA, run this command:

  • uda2nrrd -v temp_CC -uda <path to uda>

(In this case, "temp_CC" is the temperature cell-centered variable.)

This will create a file like this:

temp_CC_t054038.nrr

Validation

For Particle NRRDs

You can use the 'unu' command (which can be found in the SCIRun Thirdparty bin directory) to query the min and max of each field in the nrrd you have created. If you look at the NRRD header (.nhdr) you will see something like this:

p.particleID index:=0
p.x (x) index:=1
p.x (y) index:=2
p.x (z) index:=3
p.temperature index:=4

The above says that the 4th position is the 'temperature' field. To find the min/max of temperature (for the above nrrd), you would do:

> unu  slice -i particles_t000001.nhdr -a 0 -p 4 | unu minmax -

min: 298
max: 298

If you wanted to see the X coordinate min/max, you would do:

> unu  slice -i particles_t000001.nhdr -a 0 -p 1 | unu minmax -

min: 0.0125
max: 2.4875

Volume NRRDs

It is actually even easier for volume NRRDs as they contain only one variable:

> unu minmax tempIN_t006023.nrrd

min: 298
max: 1912.673218


Running these commands and verifying that the min/max are within a valid range will give you confidence that your NRRD has not been corrupted.

RTRT Scene

  • Use the RTRT scene named 'tstdemo'.



Main:Information:Instructions:RTRT