-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
bugSomething isn't workingSomething isn't working
Description
- 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

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')
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
