.help eaddmap Aug97 gro
.ih
NAME
eaddmap -- Add or subtract two EGRET maps. 
.ih
USAGE
eaddmap,infile1,infile2,outfile,sign,intflg,ocoord,maptyp,xbinsz,
.sp
ybinsz,cutoff,lonmin,lonmax,latmin,latmax
.ih
DESCRIPTION
The ADDMAP program adds or subtracts 2 counts maps as well as the corresponding exposure maps and stores the resulting counts, exposure and intensity maps into FITS format files. Optionally, only the counts maps may be generated if requested by the user. The program has the ability to add maps of different sky regions, bin sizes, and coordinate system (celestial, galactic,earth centered, instrument centered and others). The program may be used to combine observations of the same region for different viewing periods, or to produce maps of expanded regions such as galactic disk or all sky maps. The option to subtract is then useful when combining several regions by allowing to back up to a previous state and make adjustments. 
.sp
The ADDMAP program generates the output counts map which is the sum of the 2 input maps as well as the program report on a disk file. If the user requests for the intensity maps to be generated as well, then an exposure and an intensity map are also created to correspond to the counts map with the same name format.
.sp
The output map has its own dimensions, bin size, coordinate system and grid as requested by the user. It assumes the same energy levels and zenith angles as the first input map and if the second map does not have the same values, a warning message is written but the maps are added by energy level index.  The output map may replace the first input map and by default has the same parameters. The output file name is counts.v+xxxx.gyyy where xxxx is the viewing period number of the first map and yyyy is a unique sequence number for +xxxx. The + sign signify that the map is the sum of 2 maps. If the output map replaces the first input map then it also takes its name. 
.sp
Program report: it consists of a program title, echo of the user input, header of the input and output files, value and location of the maximum bins for all maps, total bin counts etc. The program listing is found in file eaddmap.list under the current directory.
.sp  
If a fitsio erroror other error has occured the error will be recorded in this file and the program will terminate. 	
.ih
PARAMETERS
.ls infile1 [filename]
A file name of one of the fits files to be added or subtracted
.le
.ls infile2 [filename]
A file name the second  fits files to be added or subtracted
.le
.ls outfile [filename]
The name of the output fits file.
.le
.ls sign [integer]
Sign of the map operation (1: addition, -1:subtraction) 
.le
.ls intflg [boolean]
Flag for creation of exposure and intensity maps (T: create exposure and intensity maps, F: don't create) 
.le
.ls ocoord [string]
Output map coordinate system ('GALA': galactic, 'CELE': celestial) 
.le
.ls maptyp [string]
Map type ('Sky Region', 'Galactic Disk', 'All Sky') 
.le
.ls xbinsz [double] 
Bin size on the X axis (in degrees) 
.le
.ls ybinsz [double] 
Bin size on the Y axis (in degrees)
.le
.ls cutoff [integer]
Cutoff angle
.le
.ls lonmin [double]
Minimum Longitude/Horizontal Coordinate
.le
.ls lonmax [double]
Maximum Longitude/Horizontal Coordinate
.le
.ls latmin [double]
Minimum Latitude/Vertical Coordinate
.le
.ls latmax [double]
Maximum Latitude/Vertical Coordinate
.le
.ih
EXAMPLES
1. The example below will add the maps  counts.vp0040.g002 and counts.vp0400.g002 and put them in the file counts.v+0040.g069. It will also produce exposure and intensity maps.  The maps will be in the celestial coordinate system, of a limited portion of the sky.  
.sp
.nf
eaddmap counts.vp0040.g002 counts.vp0400.g002 counts.v+0040.g069
1 Y CELE 'Sky Region' 0.50000 0.50000 40 130. 235. 0. 80.
.fi
.sp
.ih
BUGS
.ih
SEE ALSO
emapgen
.endhelp
