Skip to content

Commit

Permalink
Merge pull request #1 from jaejoonk/sandbox_edits
Browse files Browse the repository at this point in the history
implement optimal filtering into lensing sandbox
  • Loading branch information
jaejoonk authored Sep 11, 2024
2 parents 1c6162c + 2a18d0a commit 7514988
Show file tree
Hide file tree
Showing 3 changed files with 452 additions and 5 deletions.
17 changes: 12 additions & 5 deletions bin/demo_sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import pyfisher
from enlib import bench
import solenspipe
from solenspipe import sandbox_extensions

from mpi4py import MPI
comm = MPI.COMM_WORLD

Expand All @@ -30,7 +32,6 @@
required_args = parser.add_argument_group('Required arguments')
args = parser.parse_args()


debug = args.debug
outname = args.outname
save_map_plots = args.map_plots
Expand All @@ -54,7 +55,13 @@
nsims_n1 = args.nsims_n1 if not(args.nsims_n1 is None) else nsims_rdn0
nsims_mf = args.nsims_mf if not(args.nsims_mf is None) else nsims_rdn0

mg = solenspipe.LensingSandbox(fwhm_arcmin,noise_uk,dec_min,dec_max,res,lmin,lmax,mlmax,ests,add_noise=add_noise,verbose=True)
# default mask, ivar, mcg lmax is set to
# fullsky mask, white noise uniform ivar, and lmax - 1000
mg = sandbox_extensions.LensingSandboxOF(None, None, None,
fwhm_arcmin,noise_uk,dec_min,dec_max,res,
lmin,lmax,mlmax,ests,add_noise=add_noise,verbose=True)
#mg = solenspipe.LensingSandbox(fwhm_arcmin,noise_uk,dec_min,dec_max,res,
# lmin,lmax,mlmax,ests,add_noise=add_noise,verbose=True)
data_map = mg.get_observed_map(0)
Xdata = mg.prepare(data_map)
galm,calm = mg.qfuncs[est](Xdata,Xdata)
Expand Down Expand Up @@ -131,9 +138,9 @@
pl.add(cents,bclkk_ix,label=r'$C_L^{\kappa\hat{\kappa}}$')
pl.add(cents,bclkk_ii,label=r'$C_L^{\kappa\kappa}$')
pl.add(cents,bclkk_xx,label=r'$C_L^{\hat{\kappa}\hat{\kappa}}$')
pl.add(cents,brdn0,label=r'$N_L^{0,\rm RD}$')
pl.add(cents,bmcn1,label=r'$N_L^{1,\rm MC}$')
if nsims_mf>0: pl.add(cents,bmcmf,label=r'$C_L^{\rm MCMF}$')
pl.add(cents,brdn0,label=r'$N_L^{0,\rm RD}$' + f' ({nsims_rdn0} sims)')
pl.add(cents,bmcn1,label=r'$N_L^{1,\rm MC}$' + f' ({nsims_n1} sims)')
if nsims_mf>0: pl.add(cents,bmcmf,label=r'$C_L^{\rm MCMF}$' + f' ({nsims_mf} sims)')
pl.add(lns,nls,label=r'$N_L$ opt. theory',ls='--')
pl.add_err(cents,bclkk_final,yerr=errs,label=r'Debiased $C_L^{\hat{\kappa}\hat{\kappa}}-N_L^{0,\rm RD} - N_L^{1,\rm MC} $' )
pl._ax.set_ylim(1e-9,3e-7)
Expand Down
Loading

0 comments on commit 7514988

Please sign in to comment.