rmjarvis / TreeCorr

Code for efficiently computing 2-point and 3-point correlation functions. For documentation, go to
http://rmjarvis.github.io/TreeCorr/
Other
98 stars 37 forks source link

#123 Make things work when almost all patches have no data. #126

Closed rmjarvis closed 3 years ago

rmjarvis commented 3 years ago

@joezuntz ran into a couple cases where things fail catastrophically when doing patch-based calculations.

  1. If only one patch has any data in it for one of the catalogs being correlated. This kind of a fundamental problem for jackknife, but now it gracefully gives a warning and does the best it can for the case where that patch is left out.
  2. If all the counts in a run are zero. Then things like jackknife should just give zero for the variance estimate, rather than an error, which is what used to happen.

Both of these would normally only be the result of user error, but now they at least don't crash, and instead do something sensible.