//READ ME
The program analysis_4_weeks runs the fermi likelihood analysis as described in : http://fermi.gsfc.nasa.gov/ssc/data/analysis/scitools/likelihood_tutorial.html
It performs the likelihood analysis on sources provided in a data list (can be changed in the cfg.py file) that are within a certain distance to a known fermi source. The sources also appear for a span of 4 weeks and disappear.
If the resulting test statistic is more than 25, the program sends the user an email with the following details: -Name of source
-TS value
-RA and DEC
-Folder where source can be found
-The week number when the source had a TS >25.
Example of a line the data list:
102813 56.000 0.000000 0.226819 0.641252 -7.081667 0.659169 132.428574 50.868160 0.085570 0.000000 0.000000 -5.292000 0.000000 0.000000 0.000000 0.000000 0.000000 0.000000 2 4.510000 0.772000 -14.117000 0.026695 sig_match_sorted_157_160.dat sig_match_sorted_161_164.dat 2.6695e-02 1261 1.3247229E+02 4.8867855E+01
The following columns are used Healpix=0 RA=7 DEC=8 x=23 #column 23 contains a string with the weeks the sources appear/disappear* distance=25 #distance to the nearest known fermi source
Example:
eg: Healpix[col 0] Weeks sources appears[col 23] Weeks sources disappears[col 24]
444140 sig_match_sorted_253_256.dat sig_match_sorted_249_252.dat
444140 sig_match_sorted_253_256.dat sig_match_sorted_257_260.dat
Notice that weeks 253-256 are the weeks that the source 444140 appears. This source is repeated. The source is to be analysized for the weeks 253-256.
Example:
$python analysis_4_weeks
The analysis_4_weeks program contains the following fuctions: 1)gtselect.py 2)gtexmpmapcall.py 3)generatexmlfunc.py 4)makefunc.py 5)gtlikecall.py 6)tsfile.py 7)emailsy.py 8)gtbin.py 9)movefiles.py 10fermitute.py 10)cfg.py
gtselect.py
Given a fermi source, selects data based on radius of interest (ROI), energy range, time range
Example:
$python gtselect.py healpix number,ra,dec,week1,week2
(where week1 is the weeek that the source appears and week2 is when the source disappears)
gtexmpmapcall.py
Creates an exposure map based on the event selected via gtselect.py and a livetimecube (livetimecube in steps of 4 weeks were created prior to this analysis)
Example:
$python gtexpmapcallfunc.py healpix,ra,dec,week1,week2
generatexmlfunc.py
Generates the xml file with the fermi sources found in the fermi catalog based on the event select via gtselect.py.The particular source that you are analysing is not in this file and needs to be added later using makefunc.py
This program also writes a log file, make.xmllog, noting if there are extended sources present. Example of info in makexml.log: This is make2FGLxml version 04r1. For use with the gll_psc_v02.fit and gll_psc_v05.fit and later LAT catalog files. Creating file and adding sources for 2FGL Added 86 point sources and 0 extended sources
Example:
$python generatexmlfunc.py healpix,ra,dec,week1,week2
makefunc.py
Adds the source that you are analysing into the xml file generated by generatexmlfunc.py Also corrects the path name to any extended sources.
Example:
$python makefunc.py healpix,ra,dec,week1,week2,distance
gtlikecall.py
Runs the gtlike application on the source that you are analysising. Generates file containing info of the source and other fermi sources within the selected event. The info includes the test statistic (TS) value
Example:
$python gtlikecall.py healpix,ra,dec,week1,week2
tsfile.py
Generates a file for sources with TS value more than 25. File also includes the following info: healpix,ra,dec,week1,week2,distance
Example:
$python tsfile.py healpix,ra,dec,week1,week2,distance
emailsy.py
Sends an e-mail to the user if a source with TS value more than 25 is found.
The e-mail contains the following details: RA DEC TS Weeks Distance Folder
Example:
$python emailsy.py healpix,ra,dec,week1,week2,distance
gtbin.py
gtbin is used to "Create a counts map of the ROI, summed over photon energies, in order to identify candidate sources and to ensure that the field looks sensible as a simple sanity check. For creating the counts map, we will use the gtbin tool".
Example:
$python gtbin.py healpix,ra,dec,week1,week2
movefiles.py
Moves files depending on if there is an extended source. Names of folders can be changed in cfg.py Format of folders is as follows:
If there is one extended source: "%s/%s_%s" %(cfg.folder_extended,cfg.name2,identity)
No extended source: "%s/%s_%s" %(cfg.folder,cfg.name2,identity)
More than one extended source: "%s/%s_%s" %(cfg.folder_others,cfg.name2,identity)
Example:
$python movefilesfunc(healpix,ra,dec,week1,week2)
fermitute.py
Runs the entire fermi likelihood tutorial on a single source
Example:
$python fermitute.py healpix,ra,dec,week1,week2,distance
cfg.py
This is the configuration file. Allows the user to set the following: -The directory where all the fuctions live -The path to the spacecraft file -Name of folder where all files are stored -Name of folder for each individual source e.g NGC185_healpix_ra_dec_week1_week2 -Name of the data file -Healpix column number in a given data file -Column number of RA -Column number of DEC -Column number of the string where the source appears and disappears -Interval: Number of weeks to analyse the source -The response function eg."P7REP_SOURCE_V15" -The python version used e.g pythoncommand="/opt/rocks/bin/python"
The following numbers are for the gtlike and gtexp functions (refer to fermi likelihood tutorial):
-radius=20
-lowerenergy=100
-upperenergy=100000
-zenith=100
-radius1=30
-longitude=120
-latitude=120
-energies=20
This can be changed, and changes should be added to gtlike and gtexp