Saturday, August 28, 2010

A good programming project -- Geant4 Blender Script

So I've developed several particle simulations for our group now, based on Geant4. I'm a little concerned about what will happen when I leave -- there will be no-one around to do simulations! I think people should be able to do them themselves.

Geant4 is a beautiful toolkit, but not particularly easy to use -- a simulation takes several weeks to develop (just learning the interface, setting up commands etc.) and requires a decent working knowledge of C++.

I've also had a reasonable amount of experience with Blender, which has an excellent interface designed for 3D modelling.

I think someone (perhaps me if I find the time) should integrate the two, and distribute a package that allows someone to install it and have complex simulations running within a few hours.

The Geant4 python interface seems like the easiest (if slowest) way to do so, and would be good for a first attempt.

Geometry would be created in Blender, and then the Geant4 Blender Script would send the geometry to Geant4 and run simulations. The results would then either be displayed by Geant4's OGLIX (probably easier) or on the Blender model by creating new objects.

One important option for the Geant4 Blender Script would be a length scale, i.e. "One Blender unit = X metres in Geant4", with options from nanometres to kilometres. Something else that needs careful thought is the results system. How would the results of the simulation be displayed in a scientifically useful fashion? The easiest thing to do would be just to export the particle endpoints (and possibly final energy, direction, energy deposition points, etc. via options) and let the user do the plotting themselves. This is good and bad from a usability point of view -- it makes the interface simpler. The user can use whatever data analysis package they are used to and competent with. For simple plots, such as a final energy spectra, it should be possible to use matplotlib to generate something directly from the script.

I predict that this project would take several months of work. It would likely release a deb package that installed all the requirements (dependency on Blender, the (compiled?) Geant4 libraries (in a separate package?), the script itself.

I would be hesitant about making a Windows version because I don't think it's easy to compile Geant4 for Windows. It's not as though Ubuntu is hard to install anyway, and scientists who need the capability shouldn't mind and probably have access to an Ubuntu machine anyway, or can ask their IT department for a server to run simulations on.

Saturday, August 21, 2010

The Australian Election

So I voted today.

It's quite sad to watch the two largest parties dragging each other down. I prefer to vote for someone with ideals (other than spin and getting elected).

The Liberals seem to be interested almost exclusively in businesses, which tend to be a bit sociopathic in my experience.

Labor are depressing -- they seem confused and quite right-wing. Malcolm Turnbull probably would have saved them, he impressed me on the Chaser last week -- quite statesmanlike, and catching the train! He's not a puppet. Tony Abbott is a bit ridiculous.

The Greens have ideals, but no-one really knows what they'd be like in government.

With any luck Conroy will be dumped.

Friday, August 20, 2010

Where are the aliens?

So I've come up with a few possible reasons why we haven't seen any aliens yet, despite the ridiculous amounts of time they've had to get here.
  1. There aren't any. Intelligent life realises how pointless existence is, and dies out. Evolution keeps intelligence levels just below this critical level until their resources are exhausted, and they die out without migrating to other planets.
  2. Interstellar travel is impossible. The energy cost is just too high, or interstellar radiation destroys organized molecules before they get anywhere.
  3. Interstellar travel is too slow. Travelling 1000 light years (1/100th of the galaxy's diameter) at 1% of lightspeed takes 100000 years, and when you get to the next habitable system you have to spend some time setting up (at least) fuel refineries etc. Intergalactic travel is right out.
  4. They know we're here, and they're leaving us alone. Not much else to say about this one.
  5. We're the first. Life just hasn't appeared anywhere else, because conditions are not right on other planets.