RAW binary files

I have a dataset that I created from python using numpy.save() on a large array with dimensions 1200x1200x400 (It is a contour type of array where the value of the array at each spatial point represents Vortex strength). I stored it as a .npy file, and then I tried using the following commands to visualise it using Vapor:
vdccreate -dimension 1200x1200x400 -vars3d sw1 swirl.vdc
raw2vdc -varname sw1 swirl.vdc \path\swirl1.npy

But when I used the Volume renderer, the values of the array are completely wrong as indicated by the opacity and data values in the ‘Appearance’ tab. I think the issue is with the loading of the binary file itself. Any help regarding this would be great.
I have attached the file in this google drive link.

That’s correct, Vapor is looking for raw binary files with raw2vdc. That means file that only contain a series of floating point values, for example.

Using something like array.astype(numpy.float32).tofile(filename) would achieve this, but the ordering of your array may need to be modified beforehand. Vapor expects XYZ ordering from its raw files (fastest to slowest dimension).

That worked correctly, thank you!

1 Like