Program s2_skymask

program s2_skymask

        ! Uses
    use s2_types_mod
    use s2_sky_mod
    use s2_error_mod
    use healpix_types, only: HPX_SBADVAL

        ! Calls
    call parse_options
    call s2_error
    call s2_sky_free
    call s2_sky_get_map
    call s2_sky_io_fits_write
    call s2_sky_write_map_file

        ! Variables
    real (kind=s2_sp), parameter :: FITS_DISPLAY_GREY_MAGIC_NUMBER = HPX_SBADVAL
    real (kind=s2_sp), parameter :: ZERO_TOL = 1e-5
    character (len=*), parameter :: MAP_FILE = 'map'
    character (len=*), parameter :: SKY_FILE = 'sky'
    integer :: file_type = S2_SKY_FILE_TYPE_MAP
    integer :: ext = 1
    character (len=S2_STRING_LEN) :: filename_sky
    character (len=S2_STRING_LEN) :: filename_mask
    character (len=S2_STRING_LEN) :: filename_out
    character (len=S2_STRING_LEN) :: file_type_str = MAP_FILE
    type (s2_sky) :: sky
    type (s2_sky) :: mask
    type (s2_sky) :: prod
    real (kind=s2_sp), allocatable, dimension (:) :: mask_map
    real (kind=s2_sp), allocatable, dimension (:) :: prod_map
    logical :: display = .true.
    integer :: npix
    integer :: nside
    integer :: pix_scheme
    integer :: lmax
    integer :: mmax
    integer :: fail

        ! Subroutines and functions
    subroutine parse_options ()

end program s2_skymask
Apply a mask (containing only ones and zeros) to a sky. The output map is the product of the mask and sky maps. If the display status is set then masked pixels of the output map are overwritten with a magic number that appears grey when plotted. Output maps producted with the display option set should only be used for display purposes, and not for any subsequent analysis.

Usage: s2_skymask

Author: J. D. McEwen (mcewen@mrao.cam.ac.uk)

Version: 0.1 - August 2005


Description of Variables

FITS_DISPLAY_GREY_MAGIC_NUMBER

real (kind=s2_sp), parameter :: FITS_DISPLAY_GREY_MAGIC_NUMBER = HPX_SBADVAL

ZERO_TOL

real (kind=s2_sp), parameter :: ZERO_TOL = 1e-5

MAP_FILE

character (len=*), parameter :: MAP_FILE = 'map'

SKY_FILE

character (len=*), parameter :: SKY_FILE = 'sky'

file_type

integer :: file_type = S2_SKY_FILE_TYPE_MAP

ext

integer :: ext = 1

filename_sky

character (len=S2_STRING_LEN) :: filename_sky

filename_mask

character (len=S2_STRING_LEN) :: filename_mask

filename_out

character (len=S2_STRING_LEN) :: filename_out

file_type_str

character (len=S2_STRING_LEN) :: file_type_str = MAP_FILE

sky

type (s2_sky) :: sky

mask

type (s2_sky) :: mask

prod

type (s2_sky) :: prod

mask_map

real (kind=s2_sp), allocatable, dimension (:) :: mask_map

prod_map

real (kind=s2_sp), allocatable, dimension (:) :: prod_map

display

logical :: display = .true.

npix

integer :: npix

nside

integer :: nside

pix_scheme

integer :: pix_scheme

lmax

integer :: lmax

mmax

integer :: mmax

fail

integer :: fail

Description of Subroutines and Functions

parse_options

subroutine parse_options ()
    ! Calls: getArgument
end subroutine parse_options
Parse the options passed when program called.

Author: J. D. McEwen (mcewen@mrao.cam.ac.uk)

Version: 0.1 - November 2004