Finally we venture into new territory in Houdini: Python! With the help of our very talented friend Niklas Rosenstein we’ll have a look at how to import actual satellite data from ESA’s Gaia mission into Houdini and use it to render our very own star map.
On the way we’re gonna learn how to get started in Python including installing and setting up a very lightweight development environment (and even that is an exaggeration). After learning how to download bigger data sets from the internet, we’ll talk about how to import the actual data into Houdini, how to speed up successive load times and how to actually turn our data into something that resembles a map of the stars in a night sky.
Niklas also published a more in-depth version of this tutorial on his site.
Download Project File (.hipnc)
Niklas’ Useful Links
The Gaia Archive (ESA)
How To Measure Distance Using Parallax
Nice one! Ive been looking for an excuse to start working with Python and this was a great intro. As an aside, I was not able to find anything resembling temperature or color in that TGAS data. I know of a smaller data-set (about 110,000 stars) that has some extra information that could be useful for those doing a pretty render: https://astronexus.com/node/34
It might be nice to match up this information (using RA and Dec to place the star and then referencing the Spectrum and ColorIndex).
Thank you very much! Yes, unfortunately there does not appear to be color information in the TGAS or GAIA dataset. I was searching for it, too.
Maybe I misunderstand you. I don’t think you need to match the data from the HYG dataset with the TGAS data. You should be able to create a starmap out of the HYG data alone. Getting usable color values out of the data available in this set would indeed be interesting! You should be able to use Houdini’s Table Import node in this case, since it’s just a single CSV file.
Ah yes, I was a little vague. I meant that if you wanted to combine this 100k data with the TGAS data, things would match up so you’d probably have some duplicate stars (since the TGAS data has many more stars than the HYG).
An awesome and very detailed video which clearly explained the entire workflow and infact I’ve picked up several cool python tips and pointers based on the programming style of Niklas using generators, gzip module and comprehensions. And finally blending the power of python with the power of Houdini was amazing. Loved it!
Thank you very much!
Thanks, this was amazing!
For those using Python 3…
“xrange” is replaced with “range”
print commands need parenthesis
ex: print(“Downloading”, filename)
I’ve noticed the data field parallax contains negative values, How is that possible and what does it mean?
usually this is due to measurement errors. For a more in-depth explanation and the answer to the question why they haven’t been corrected / left out – here’s a nice post about it: https://celestiaproject.net/forum/viewtopic.php?f=7&t=11381
Am fairly new to python, but not Houdini,
Am getting this error…
Error: Python error: IndentationError: (‘unindent does not match any outer indentation level’, (”, 25, 9, ‘ main()\n’))
Any thoughts as to why?
node = hou.pwd()
geo = node.geometry()
directory = node.evalParm(‘directory’)
maxrows = node.evalParm(‘maxrows’)
if not directory: return
if not os.path.isdir(directory): return
files = 
for name in oslistdir(directory):
Never mind, had a space before main()
Great tutorial. However when running your example file “load_values_into_houdini_01.hipnc” in 16.0.736 Apprentice, i get this error:
Python error: Traceback (most recent call last):
File “”, line 37, in
File “”, line 25, in main
All the gz files are in the $HIP dir
Got the same error when i tried to follow the video last night.
Can you speak languages other than python?
phyton is basic pogram. i like