Closed chrisnorth closed 11 years ago
I have made some big changes to the code. I was mistakenly treating the random noise image as a spatial image and FFTing it before multiplying by the power spectrum. I've stopped FFTing it (speeding up initial page load) but have also decided to generate the Gaussian random noise in code rather than loading an image. I think the spatial scales look reasonable now.
It was meant to be a real image - the reason being that the FFT of a real image is complex - though with p(-k) is the conjugate of p(k). One thing to watch is that the complex numbers are right.
On the other hand, if it looks ok... hard to check right now (on my phone) but will have a look asap in the morning.
Sent from my phone. On Jun 25, 2013 12:17 AM, "Stuart" notifications@github.com wrote:
I have made some big changes to the code. I was mistakenly treating the random noise image as a spatial image and FFTing it before multiplying by the power spectrum. I've stopped FFTing it (speeding up initial page load) but have also decided to generate the Gaussian random noise in code rather than loading an image. I think the spatial scales look reasonable now.
— Reply to this email directly or view it on GitHubhttps://github.com/chrisnorth/planckapps/issues/6#issuecomment-19942868 .
@chrisnorth Did you manage to have a look at it? Did the original random sky image contain equal power at all scales?
It was Gaussian random fluctuation, so it should be frequency independent.
On thing that occurs to me - the Cl graph looks like it has the l(l+1) pre-factor (see e.g. https://upload.wikimedia.org/wikipedia/commons/thumb/1/16/PowerSpectrumExt.svg/300px-PowerSpectrumExt.svg.png )
That would increase the small scales relative to the large ones, so try dividing the power spectrum by l(l+1)/2pi
+----------------------------------------------------------+ | Chris North | School of Physics and Astronomy | Cardiff University | Queen's Buildings, The Parade | Cardiff, CF24 3AA, UK | chris.north@astro.cf.ac.uk | +44 (0)29 208 70537 (Office) +----------------------------------------------------------+
On 25 June 2013 12:08, Stuart notifications@github.com wrote:
@chrisnorth https://github.com/chrisnorth Did you manage to have a look at it? Did the original random sky image contain equal power at all scales?
— Reply to this email directly or view it on GitHubhttps://github.com/chrisnorth/planckapps/issues/6#issuecomment-19969108 .
Looks like it's also sqrt(C(l)) that should be applied to the Fourier domain, not C(l) itself. That probably won't change too much...
Also, the phases of the complex numbers in Fourier space should be Hermitian, to make the resulting real-space map real-valued. That means you only need to generate random values for half of k-space. The rest can be calculated through the constraint f(-k) = CONJUGATE(f(k))
+----------------------------------------------------------+ | Chris North | School of Physics and Astronomy | Cardiff University | Queen's Buildings, The Parade | Cardiff, CF24 3AA, UK | chris.north@astro.cf.ac.uk | +44 (0)29 208 70537 (Office) +----------------------------------------------------------+
On 25 June 2013 12:27, Chris North chris.north@astro.cf.ac.uk wrote:
It was Gaussian random fluctuation, so it should be frequency independent.
On thing that occurs to me - the Cl graph looks like it has the l(l+1) pre-factor (see e.g. https://upload.wikimedia.org/wikipedia/commons/thumb/1/16/PowerSpectrumExt.svg/300px-PowerSpectrumExt.svg.png )
That would increase the small scales relative to the large ones, so try dividing the power spectrum by l(l+1)/2pi
+----------------------------------------------------------+ | Chris North | School of Physics and Astronomy | Cardiff University | Queen's Buildings, The Parade | Cardiff, CF24 3AA, UK | chris.north@astro.cf.ac.uk | +44 (0)29 208 70537 (Office) +----------------------------------------------------------+
On 25 June 2013 12:08, Stuart notifications@github.com wrote:
@chrisnorth https://github.com/chrisnorth Did you manage to have a look at it? Did the original random sky image contain equal power at all scales?
— Reply to this email directly or view it on GitHubhttps://github.com/chrisnorth/planckapps/issues/6#issuecomment-19969108 .
We think it is correct now.
The blobs in "our Universe" look too small - they should be ~1/10th of the image across assuming a 10deg wide image and ~1deg wide blobs.
The relationship between multipole [ell,C_l(ell)] space and Fourier [k,P(k)] space is that k=ell/(2.pi) and the power in the Fourier mode P(k)=C_ell(ell=2.pi.k).
We should assume the image is 10deg wide, so each pixel (for a 200pixel image) is 0.05deg in width. That corresponds to l=3600 (or k=573).
There are various factors of 2pi that need to appear in the FFT function but I think they're just scaling functions, which are probably normalised out...