Tuesday, February 9, 2010

Davis to the Rescue

I was at the cosmology seminar today and I was complaining to Nic Ross about my correlation function woos and Marc Davis happened to be in earshot and told me that I was thinking about this all wrong. Basically what I should do is take my galaxies with coordinates of Ra and Dec and calculate their x,y,z coordinates (projecting them onto a unit sphere). Then I can calculate the 3D correlation function on these objects (which I already have code to do), where I can translate between their physical separation in x, y, z coordinates to their angular separation by the following:

Ra1, Dec1 → x1, y1, z1
Ra2, Dec2 → x2, y2, z2

Separation of objects (s) in Cartesian coordinates:
s = [(x1 - x2)2 + (y1 - y2)2 + (z1 - z2)2]½

Geometry relates the separation angle (γ) to Cartesian separation (s):
s = 2sin(γ/2)

or using the dot product of the two vectors:
x1x2 + y1y2 + z1z2 = cos( γ)

Therefore, the only change I need to make is after I grid objects, and select which objects are 'close by' using above conversion from s to γ, is to convert the 3D separation of the objects to the angular separation. This shouldn't be very difficult to do using the 3D code I already have.

Thank you Marc Davis for making my life a lot better today!

Useful links for writing equations in HTML (used above):
http://www.w3schools.com/tags/ref_entities.asp
http://www.tizag.com/htmlT/htmlsuperscript.php
http://htmlhelp.com/reference/html40/entities/symbols.html

No comments:

Post a Comment