Closed rmjarvis closed 10 months ago
Update: I figured out how to get the spherical projections to work right. Rather than rely on the Gn(n-3) thing to rotate all three shears, I just project the shears at points 2 and 3 properly and include them that way in the Gn array. Then I use n-1 and n+1 in the formulas to apply exp(-2i phi) to g1.
Now the spherical tests for GGG go out to 100 degrees and pass at 1.e-5 tolerance, so I think that's all good now.
This PR has the implementation of the multipole algorithm for doing 3pt correlation functions.
It's nominally a new BinType, LogMultipole, but the point of it is to run that for the measurement and then convert to LogSAS binning, using the method
corr.toSAS()
.This method is several orders of magnitude faster than the normal tree-based 3pt calculation (which in turn is many orders of magnitude faster than the naive brute force algorithm). The GGG test of Map^3 takes many hours to run with the regular LogSAS binning, but takes under two minutes on my laptop using LogMultipole. This is using 10 threads, and a little over 1 GB of memory, so not unreasonable.
There are a few additional features I'd like to add related to this still, but the code on this branch is functional if people want to start trying it out.
Still TBD (on other PRs):
process
likealgorithm='multipole'
which would make the appropriate LogMultipole object, run that, and then convert back usingtoSAS
. Maybe even have this be the default for LogSAS, since I suspect this is what everyone will want to use normally. The old recursion will likely be of historical interest at most now.For now, the only patch based calculation it can currently handle is if cat1 has patches, and cats 2,3 do not. So to do an auto-correlation with patches, you need to make two copies of the catalog, one with patches and the other not. Then run it as a cross-correlation. E.g.
This will work, and it can produce patch-based covariances. But it won't really work for a lowmem application. Indeed it uses more memory than if you didn't use patches.