Wednesday, January 23, 2013

Kaggling Dark Halos

Success! I scored higher than Lenstool!

This was one of those Kaggle competitions that I had no right to compete in. My goal was to beat the benchmark, which was a state of the art program in 2007. I will be the first to admit this wasn't the most ambitious goal. However, the closest I have ever been to an astronomy class was an episode of The Magic School Bus - it was the one where they explored all nine planets. Though my best method ranked 121 out of 357, I still consider it a victory (Lenstool ranked 201 out of 357.) My victory definitely exemplifies how childish logic can be successfully used in place of cosmological knowledge.

I imagined that galaxies would look perfectly circular without any dark matter influence. This also means that one galaxy has no influence over another galaxy. When dark matter is introduced, some force will cause the galaxies to look elongated or elliptical. 

The python script I wrote to find the coordinates of dark halos reflects this logic. Random points are selected and used to calculate the force of elongation on each galaxy. The difference between the observed ellipticity and the calculated force of elongation is taken. Then the differences are squared and summed. By my childish logic, the lowest calculated value from the selected random points should be where the dark halo is located. For multiple dark halos, the elongation cause by the previously found dark halo(s) should be taken into account before further calculations.

For the competition, I created various potentials and regressed for coefficients using the training data. For this blog post, I chose a potential with a double power-law density distribution and randomly picked coefficients. This random potential actually works pretty well as shown below with the data from training skies 1, 101, and 201. The blue circles show where dark halos are located and the red circles are the estimated positions from my python script.

Training sky 1 with one dark halo

Training sky 101 with two dark halos

Training sky 201 with three dark halos

To run the script I have written please download it and the competition's training data from here and make sure you have Python 2.7, emcee, and NumPy installed. Thanks should be given to David Harvey and Thomas Kitching for creating the training data to the Observing Dark Worlds Competition. I encourage you to download the data and as Ms. Frizzle says, "Take chances, make mistakes, and get messy."

No comments:

Post a Comment