FITS in Blender : Method 1 


My first approach to viewing FITS files takes one of the most obvious approaches. Each pixel in a FITS file can be imported as a vertex and given a halo material that corresponds to (say) the flux or intensity value of that pixel. This works well enough if you only want to render the cube for a pretty movie. It's only moderately useful if you want to view a cube in realtime, however. Single vertex halos can't be given any kind of realtime material in Blender, so if you need to display every pixel, all you'll see in the realtime view is a huge 3D grid of black dots. Looks pretty nice when rendered, but nearly useless for realtime.

Images of the same data cube imported into Blender, shown from different angles. Left : realtime appearance. Right : rendered output.


Things are better if you're able to use some cut when importing the cube. For the data sets I work with, most of the data is noise, and the only interesting features are almost always unresolved (an example image is below, this was used on a poster I presented in the AAS, Boston 2011). In this case this method is not too bad. But for cases where there are very extended structures present, it's really not up to the task of realtime display.

You can find the script here. You'll need to have the numpy and pyfits modules installed. This method is the least memory-intensive technique for importing files, but even so there are still some limitations. To decrease memory usage the script doesn't import each pixel as its own mesh object with its own unique material. Instead, pixels of similar intensity (you can specify how precise you want this to be) are imported into the same mesh. Good results are typically achieved with 2000 meshes, corresponding to 2000 different colours.

rhysy.net | feedback@rhysy.net