program s2_gcmbcoad ! Uses use s2_types_mod use s2_error_mod use s2_sky_mod use s2_pl_mod use s2_cmb_mod use s2_wnoise_mod ! Calls call parse_options call s2_cmb_free call s2_error call s2_pl_free call s2_sky_compute_map call s2_sky_conv call s2_sky_downsample call s2_sky_free call s2_sky_get_map call s2_sky_map_convert call s2_sky_write_map_file call s2_wnoise_free ! Variables integer, parameter :: NUM_BANDS = 8 integer, parameter :: NOBS_EXT = 2 integer, parameter :: LMAX_LIMIT = 1000 integer, parameter :: NSIDE_FINAL = 256 character (len=*), parameter :: msgpfx = 's2_gcmbcoad> ' real (kind=s2_sp), parameter, dimension (NUM_BANDS) :: SIGMA0 = (/ 2.26677, 2.15567, 3.28789, 2.93683, 5.85196, 6.53276, 6.88032, 6.72537 /) character (len=S2_STRING_LEN), parameter, dimension (NUM_BANDS) :: filename_nobs = (/ 'wmap_q1_cleanimap_yr1_v1.fits', 'wmap_q2_cleanimap_yr1_v1.fits', 'wmap_v1_cleanimap_yr1_v1.fits', 'wmap_v2_cleanimap_yr1_v1.fits', 'wmap_w1_cleanimap_yr1_v1.fits', 'wmap_w2_cleanimap_yr1_v1.fits', 'wmap_w3_cleanimap_yr1_v1.fits', 'wmap_w4_cleanimap_yr1_v1.fits' /) character (len=S2_STRING_LEN), parameter, dimension (NUM_BANDS) :: filename_beam = (/ 'map_q1_ampl_bl_yr1_v1.txt', 'map_q2_ampl_bl_yr1_v1.txt', 'map_v1_ampl_bl_yr1_v1.txt', 'map_v2_ampl_bl_yr1_v1.txt', 'map_w1_ampl_bl_yr1_v1.txt', 'map_w2_ampl_bl_yr1_v1.txt', 'map_w3_ampl_bl_yr1_v1.txt', 'map_w4_ampl_bl_yr1_v1.txt' /) character (len=S2_STRING_LEN) :: filename_mask character (len=S2_STRING_LEN) :: filename_cl = 'wmap_lcdm_pl_model_yr1_v1.txt' character (len=S2_STRING_LEN) :: filename_out character (len=S2_STRING_LEN) :: filename_out_cmb_prefix = 'gcmb_coadded_' character (len=S2_STRING_LEN) :: filename_out_noise_prefix = 'wnoise_coadded_' character (len=S2_STRING_LEN) :: comment_out = 'seed not specified' character (len=S2_STRING_LEN) :: filename_current character (len=S2_STRING_LEN) :: dir_cl = 'data_input' character (len=S2_STRING_LEN) :: dir_nobs = 'data_input' character (len=S2_STRING_LEN) :: dir_beam = 'data_input' integer :: isim_start = 1 integer :: isim_end = 1 integer :: lmax integer :: lmin_cl integer :: lmin_beam integer :: iband integer :: isim integer :: fail integer :: ncomment_cl integer :: ncomment_beam integer :: seed_cmb = 1 integer :: seed_noise = 1 logical :: scale_in_cl = .true. logical :: scale_in_beam = .false. logical :: line_nos_in_cl = .true. logical :: line_nos_in_beam = .true. logical :: apply_mask = .false. type (s2_pl) :: cl type (s2_pl), dimension (NUM_BANDS) :: beam type (s2_sky), dimension (NUM_BANDS) :: weights type (s2_sky) :: weights_sum type (s2_sky) :: weights_temp type (s2_sky) :: mask type (s2_sky), dimension (NUM_BANDS) :: nobs type (s2_cmb) :: cmb type (s2_sky) :: cmb_sky type (s2_sky), dimension (NUM_BANDS) :: cmb_sky_beam type (s2_sky) :: sky_temp type (s2_sky) :: cmb_coadded type (s2_sky) :: cmb_coadded_unscaled type (s2_wnoise) :: wnoise type (s2_sky), dimension (NUM_BANDS) :: wnoise_sky type (s2_sky) :: wnoise_coadded type (s2_sky) :: wnoise_coadded_unscaled real (kind=s2_sp), allocatable, dimension (:) :: nobs_map real (kind=s2_sp), allocatable, dimension (:) :: weights_map ! Interfaces interface s2_gcmbcoad_weightedsum ! Subroutines and functions subroutine parse_options () end program s2_gcmbcoadGenerate co-added Gaussian CMB and noise realisations. Realisations are simulated for each WMAP channel by convolving with the approriate beam function and adding appropriate noise for the specific receiver. The signals from each receiver are combined to give a coadded map, using the processing pipeline specified by Komatsu et al. (2003).
Usage: s2_gcmbcoad
Author: J. D. McEwen (mcewen@mrao.cam.ac.uk)
Version: 0.1 - October 2005
integer, parameter :: NUM_BANDS = 8
integer, parameter :: NOBS_EXT = 2
integer, parameter :: LMAX_LIMIT = 1000
integer, parameter :: NSIDE_FINAL = 256
character (len=*), parameter :: msgpfx = 's2_gcmbcoad> '
real (kind=s2_sp), parameter, dimension (NUM_BANDS) :: SIGMA0 = (/ 2.26677, 2.15567, 3.28789, 2.93683, 5.85196, 6.53276, 6.88032, 6.72537 /)
character (len=S2_STRING_LEN), parameter, dimension (NUM_BANDS) :: filename_nobs = (/ 'wmap_q1_cleanimap_yr1_v1.fits', 'wmap_q2_cleanimap_yr1_v1.fits', 'wmap_v1_cleanimap_yr1_v1.fits', 'wmap_v2_cleanimap_yr1_v1.fits', 'wmap_w1_cleanimap_yr1_v1.fits', 'wmap_w2_cleanimap_yr1_v1.fits', 'wmap_w3_cleanimap_yr1_v1.fits', 'wmap_w4_cleanimap_yr1_v1.fits' /)
character (len=S2_STRING_LEN), parameter, dimension (NUM_BANDS) :: filename_beam = (/ 'map_q1_ampl_bl_yr1_v1.txt', 'map_q2_ampl_bl_yr1_v1.txt', 'map_v1_ampl_bl_yr1_v1.txt', 'map_v2_ampl_bl_yr1_v1.txt', 'map_w1_ampl_bl_yr1_v1.txt', 'map_w2_ampl_bl_yr1_v1.txt', 'map_w3_ampl_bl_yr1_v1.txt', 'map_w4_ampl_bl_yr1_v1.txt' /)
character (len=S2_STRING_LEN) :: filename_mask
character (len=S2_STRING_LEN) :: filename_cl = 'wmap_lcdm_pl_model_yr1_v1.txt'
character (len=S2_STRING_LEN) :: filename_out
character (len=S2_STRING_LEN) :: filename_out_cmb_prefix = 'gcmb_coadded_'
character (len=S2_STRING_LEN) :: filename_out_noise_prefix = 'wnoise_coadded_'
character (len=S2_STRING_LEN) :: comment_out = 'seed not specified'
character (len=S2_STRING_LEN) :: filename_current
character (len=S2_STRING_LEN) :: dir_cl = 'data_input'
character (len=S2_STRING_LEN) :: dir_nobs = 'data_input'
character (len=S2_STRING_LEN) :: dir_beam = 'data_input'
integer :: isim_start = 1
integer :: isim_end = 1
integer :: lmax
integer :: lmin_cl
integer :: lmin_beam
integer :: iband
integer :: isim
integer :: fail
integer :: ncomment_cl
integer :: ncomment_beam
integer :: seed_cmb = 1
integer :: seed_noise = 1
logical :: scale_in_cl = .true.
logical :: scale_in_beam = .false.
logical :: line_nos_in_cl = .true.
logical :: line_nos_in_beam = .true.
logical :: apply_mask = .false.
type (s2_pl) :: cl
type (s2_pl), dimension (NUM_BANDS) :: beam
type (s2_sky), dimension (NUM_BANDS) :: weights
type (s2_sky) :: weights_sum
type (s2_sky) :: weights_temp
type (s2_sky) :: mask
type (s2_sky), dimension (NUM_BANDS) :: nobs
type (s2_cmb) :: cmb
type (s2_sky) :: cmb_sky
type (s2_sky), dimension (NUM_BANDS) :: cmb_sky_beam
type (s2_sky) :: sky_temp
type (s2_sky) :: cmb_coadded
type (s2_sky) :: cmb_coadded_unscaled
type (s2_wnoise) :: wnoise
type (s2_sky), dimension (NUM_BANDS) :: wnoise_sky
type (s2_sky) :: wnoise_coadded
type (s2_sky) :: wnoise_coadded_unscaled
real (kind=s2_sp), allocatable, dimension (:) :: nobs_map
real (kind=s2_sp), allocatable, dimension (:) :: weights_map
interface s2_gcmbcoad_weightedsum function s2_gcmbcoad_weightedsum (skies, weights) result (sky_coadded) type (s2_sky), intent(inout), dimension (1:) :: skies type (s2_sky), intent(inout), dimension (1:) :: weights type (s2_sky) :: sky_coadded end function s2_gcmbcoad_weightedsum end interface s2_gcmbcoad_weightedsum
subroutine parse_options () ! Calls: getArgument end subroutine parse_optionsParse the options passed when program called.
Author: J. D. McEwen (mcewen@mrao.cam.ac.uk)
Version: 0.1 - October 2005