Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A_L matches expectation at low L, but rises at higher L #12

Open
ajvanengelen opened this issue Jul 2, 2022 · 1 comment
Open

A_L matches expectation at low L, but rises at higher L #12

ajvanengelen opened this issue Jul 2, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@ajvanengelen
Copy link

  • symlens version: most recent, I think
  • Python version: 3.8
  • Operating System: linux

Description

I'm computing some new A_L curves and trying to match expectations --- found that the result rose faster than expected. I wrote this test case script that just sets $f=1$ and $F=1$. At low ell I get what I expect according to the definition, based on the inverse of the area of the annulus from l_min to l_max. But the result rises with L.
image

image

What I Did

from __future__ import print_function
from orphics import maps,io,cosmology,stats
from pixell import enmap
import numpy as np
from symlens import qe
import matplotlib.pyplot as plt

shape,wcs = maps.rect_geometry(width_deg=20.,px_res_arcmin=1.5,proj='car')
theory = cosmology.default_theory()
modlmap = enmap.modlmap(shape,wcs)

#Set both f and F to just be 1
f_ones = 1  #enmap.ones(modlmap.shape, wcs)
F_ones = 1  #enmap.ones(modlmap.shape, wcs)

lmin, lmax = 100, 3500
Lmax = 3000
xmask = maps.mask_kspace(shape,wcs,lmin=lmin,lmax=lmax)
ymask = maps.mask_kspace(shape,wcs,lmin=lmin,lmax=lmax)

feed_dict = {}

#get A_L
A_L_ones = qe.A_l_custom(shape, wcs, feed_dict, f_ones, F_ones, xmask=xmask, ymask=ymask)

#We expect A_L to be L**2 times the inverse of ((1/(2pi)**2) times the area of a disk of outer radius lmax and inner radius lmin))
expected_A_L = modlmap**2 * 1/( 1 / (2 * np.pi)**2 * (np.pi * (lmax**2 - lmin**2)))

#set up binninga
bin_edges = np.arange(20,Lmax,20)
ells = np.arange(20,Lmax,1)
binner = stats.bin2D(modlmap,bin_edges)

cents, A_L_ones_1d = binner.bin(A_L_ones)
cents, expected_A_L_1d = binner.bin(expected_A_L)

plt.figure()
plt.plot(cents, A_L_ones_1d / expected_A_L_1d, label = 'binned')
indmax = 100
plt.plot(modlmap[0, :indmax], (A_L_ones / expected_A_L)[0, :indmax], label = 'slice on x axis')
plt.legend()
plt.ylabel('obtained / expected')
plt.xlabel('L')


plt.savefig('../output/test_ones.png')
@ajvanengelen
Copy link
Author

Update: I just tried setting both of f_ones and F_ones to sympy.Integer(1), leading to

type(f_ones)
Out[7]: sympy.core.numbers.One

This doesn't change the results. Any ideas about what might be going on here?

@ajvanengelen ajvanengelen added the bug Something isn't working label Jul 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants