Showing posts with label Marc Davis. Show all posts
Showing posts with label Marc Davis. Show all posts

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

Monday, November 2, 2009

Populating Randoms

I talked to Nic Ross and Mark Davis about this issue of populating the random declinations in the correlation functions. They both said that this is a well known issue and that (obviously) I want to populate the random declinations with a cosine function. Nic doesn't think this should matter much with my Stripe 82 3D correlation functions because the dec range is small and therefore is ~flat. Still, I am going to see if this matters.

Nic also recommended that I print out the individual elements of the correlation function to see if there is one in particular that isn't behaving properly. By "elements" mean that the 3D correlation function is calculated in the following way:

xi = (dd-2*dr+rr)/(rr);

where dd is the data correlated with itself, dr is the data correlated with the randoms and rr is the randoms correlated with themselves, so I am doing that now too.