ryanscranton / astro-stomp

Automatically exported from code.google.com/p/astro-stomp
3 stars 3 forks source link

pair-count correlation functions possibly broken for small data-sets #5

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Calculating pair-based correlation functions on small data sets (~1000s of 
objects) results in a 
correlation function that flattens out at medium angular scales (~0.1 degrees). 
 It's unclear exactly 
why this is happening, if it's due to a bug in the code or insufficient random 
points or what.

Original issue reported on code.google.com by ryan.scr...@gmail.com on 17 May 2010 at 10:54

GoogleCodeExporter commented 9 years ago
This appears to be due to a problem in the RegionMap class, specifically the 
method that initializes a set of regions based on the regions in another 
BaseMap.  The unstated assumption in this method is that the Coverage pixels 
for both BaseMaps will be identical, leading to a one-to-one mapping between 
one RegionMap and another.

The problem here is a confluence of factors.  The small area of the Map and 
relatively large number of angular bins leads to a large number of requested 
regions in order to calculate the errors on the correlation function.  This 
requires a relatively high resolution for the regionation.  That same 
resolution is used to create the BaseNodes for the TreeMap used in the 
pair-based estimator.  As a result, the number of BaseNodes required to cover 
the survey area can end up being more than the number of galaxies used to build 
the TreeMap.  This means that the Coverage from the TreeMap will end up being 
incomplete, resulting in an an incomplete RegionMap.  

When this TreeMap is used to calculate the galaxy-random pairs, there will be 
misses because of these gaps in the RegionMap, leading to a smaller 
galaxy-random term than one would expect.  As the angular scale approaches the 
size of the survey area, this problem is more and more apparent, leading to the 
observed flattening.  This undersampling of the expected BaseNodes in the 
TreeMap explains why this problem seems to solve itself when the density 
increases.  For larger areas but equal galaxy densities, the problem doesn't 
manifest because the angular size of the BaseNodes is large enough that all of 
the BaseNodes are likely to be created when objects are added to the TreeMap.

The fix to this bug is to use the Coverage from the input BaseMap to create the 
RegionMap.  This solves the particular problem here, but it does lead to the 
somewhat paradoxical case that a BaseMap derived class could end up with a 
RegionMap that doesn't match its geometry.  However, given that the usage of 
this method implies that both BaseMaps should have nearly the same geometry, 
this is a reasonable solution to the problem.  A warning of what could happen 
if the method is used improperly has been added to the comments above this 
method's listing in stomp_base_map.h.

Original comment by ryan.scr...@gmail.com on 11 Jun 2010 at 5:39