healpy/healpy — Issue #31: synfast does not handle keyword lmax properly, and may have serious trouble when cls is shorter than lmax.
Author: becamedark
Created: 2012-02-19 09:31:01+00:00
State: open

The documentation for synfast says that the keyword lmax determines the maximum ell used in creating the simulated map. This is, unfortunately, false: it seems that it's the *index* of the maximum ell-value, counting up from ell = 2. So, if lmax = 1200, then the actual maximum ell used is 1202.

This wreaked havoc on my code until I managed to track down what was happening, because of a second bug that may, admittedly, be unique to my installation: synfast behaves in a very nasty way when cls is shorter than lmax. Specifically, synfast intermittently creates a map with some really crazy behaviors at high ell, as if it's extending cls with random values that are sitting in memory. Try running synfast with the WMAP7 TT C_ells (there are 1198 of them) at resolution NSIDE = 512 and any lmax > 1198 to see what I mean. When I do this, synfast intermittently creates a map with at least one gigantic C_ell at ell > 1199. And when I say gigantic, I mean really huge: big enough that I can tell the map is crazy just by looking at it with mollview. Can anyone else confirm that they see this error? If it's a problem with healpy itself, someone should address it ASAP. I'd do it myself, but I'm a few weeks away from defending my Ph.D. thesis...