Friday, October 9, 2009

Working Mask

After banging my head against the wall for an hour (and talking to Alexia) I figured out the problem with my mask/conversion from yesterday. I was using a definition I found here to do the conversion from ra, dec, redshift to x, y, z for the Sloan data. However on the mock data, I was using a simple coordinate change from spherical to Cartesian as found in most physics text books like here. This was because I don't actually need to get redshifts (we want ra, dec and comoving distance) and therefore the conversion is less complicated. I had changed this function in my python code, but not in the correlation function code (which is in C) and so one set of code was doing one conversion and the other was doing something different.

I also had an issue that I was putting the data into a box of dimensions 1x1x1 (because this is what the correlation function was expecting) but had forgotten to do the same thing to the randoms. This is probably what was causing the correlation function to be way off.

I have corrected both these problem, and now my random data falls in the same region as my masked data. Woo hoo!



The correlation function matches (sort of), there seems to be an issue with the boxsides matching up, I need to figure this out:


If I divide my correlation function binning by the size of my box then they match up pretty well. I think this comes down to the fact that Alexia's code thinks the boxside is 1Mpc, and my code thinks the boxside is ~1000Mpc, I need to fix this in the code itself, but for now this makes me happy that they seem to match up well:


Remaining Problems/To dos:
  • You'll notice that the random data has negative values. This is probably due to the randoms covering a slightly larger area than the actual data, and thus when I try to fit it into a 1X1X1 box (which sides are determined by the actual data) it spills out slightly and thus goes slightly negative. This will cause problems when calculating the correlation function because the calculation expects the data to be in a 1X1X1 box which goes from 0 to 1. I need to fix this in both the randoms and the data, perhaps by shifting them both slightly?
  • The x-axis of the correlation functions aren't matching, this is probably due to different versions of the code thinking the size of the box is different. This needs to be corrected.
  • I am currently populating the random redshifts uniformly within the redshift range. However, because the density of objects evolves with redshift, I should actually be populating the random data with the same redshift function as the data. I had this implemented in an older version of the code, but it was never tested, so now I need to add that back into the code here.

No comments:

Post a Comment