Closed EiffL closed 3 years ago
Let me know what you think @dlanzieri but I think this may be a full validation against lenstools. Now the only thing that remains to be seen is whether we can recover a reasonable power spectrum....
Thank you @dlanzieri :-D since you approve these modifications, I'll go ahead and merge to the lensing branch.
This PR changes a little bit how we are doing things in the lensing branch, but it should validate almost all we care about.
cutPlaneGaussianGrid
of lentools, and validated it intests/test_raytracing.py:test_density_plane
This makes sure that we are in 100% agreement at the level of the density planesconvergenceBorn
function that works similarly to the lenstools one, and this one is validated intests/test_raytracing.py:test_convergence_Born
which compares the convergence maps for a given set of density planes.You can see an example of this proposed new API here: https://github.com/DifferentiableUniverseInitiative/flowpm/blob/u/EiffL/lensing/notebooks/lensing.ipynb
And I have also added a dev notebook to see the outputs of these test functions here: https://github.com/DifferentiableUniverseInitiative/flowpm/blob/u/EiffL/lensing/notebooks/dev/test_raytracing.ipynb
Highlights of comparisons
Density planes
This is comparison of the density planes from the same snapshot, note that the high freq are slightly different because of the different painting schemes, but the residuals are clean. After smoothing, we validate these maps pixel-wise at a maximum relative error of 2%, their smoothed power spectra are also good:
Convergence maps
This is the output of running an LPT simulation, cutting it in density planes using FlowPM, and then doing the ray tracing from these planes in both lenstools and FlowPM. Very good match, validated at an absolute tolerance of 5e-4