PROGRAM deconvolve_mask IMPLICIT none ! ! This program uses the so-called MASTER algorithm [Hivon et al., ! ApJ, 567, 2 (2002)] to deconvolve the power spectrum for the ! effect of a mask applied to a map. ! ! The input power spectrum file should contain the spectrum ! data from l=0 in the following format: ! ! cl at l=0 ! cl at l=1 ! cl at l=2 ! . ! . ! ! The input mask power spectrum file should also be in the same ! format. The output file, "deconvolved_cl.txt", will also be ! in the same format: ! ! deconvolved cl at l=0 ! deconvolved cl at l=1 ! deconvolved cl at l=2 ! . ! . ! June 27, 2010: E.Komatsu ! integer :: nlmax,l double precision, dimension(:), allocatable :: cl,ml double precision, dimension(:,:), allocatable :: Ftp integer, dimension(:), allocatable :: ipiv character(len=256) :: filename1,filename2 print*,'enter the maximum multipole (eg: 1024):' read*,nlmax allocate(cl(0:nlmax),ml(0:nlmax),ipiv(1:nlmax-1)) allocate(Ftp(0:nlmax-2,0:nlmax-2)) print*,'enter filename of the power spectrum to be deconvolved (eg: cl_cutsky.txt):' read*,filename1 print*,'enter filename of the power spectrum of the mask (eg: cl_of_mask.txt):' read*,filename2 open(1,file=filename1,status='old') open(2,file=filename2,status='old') do l=0,nlmax read(1,*)cl(l) read(2,*)ml(l) enddo close(1) close(2) call compute_coupling_matrix(nlmax,ml,Ftp,ipiv) call compute_cl(nlmax,cl,Ftp,ipiv) open(3,file='deconvolved_cl.txt',status='unknown') do l=0,nlmax write(3,*)cl(l) enddo close(3) END PROGRAM deconvolve_mask