# User config file with limited (but most important) options to get
# you started with rungt.py. Used config files will be merged with
# default.conf located located in the rungt directory at runtime.
# Look at default.conf for full list of sections and parameters

[general]
    run =   xmlmodel select mktime ccube expcube2 srcmap binlike cmap model #binspec      
    target = A2163
     ra =  243.892 	
    dec =  -6.124  	
    tmin = 220838402.470
    tmax = 334683060.000
    emin = 63
    emax = 300000
    rad = 15
    exprad = 20
    chatter = 4
    mapxbins = 101
    mapybins = 101
    degperbin = 0.2
    nebins = 20
    proj = AIT
    coordsys = CEL
    predata = false   #select/allsky run gtselect/directly on prepared data
    irfs = P7SOURCE_V6
    name = general target, _analysis
    model = xmlmodel output
    infile= @/a/wain041/g.ki.ki07/lisal/A3376_binned_3yr/lisal-data-allsky-ft1_files.list
    scfile= /a/wain041/g.ki.ki07/lisal/new_ltcube/lisal-data-allsky-ft2-30s.fits
    zmax = 100

[binulimit]
    [[parameters]]
    	expcube = /nfs/slac/g/ki/ki07/lisal/new_ltcube/ltcube_220838402.470_334683060.000.fits
	
[findsrc]
    [[parameters]]
    	srcmdl = general model
	expcube = /nfs/slac/g/ki/ki07/lisal/new_ltcube/ltcube_220838402.470_334683060.000.fits
	#expmap = expcube_fornax_analysis_CEL_0.2dpb_AIT_63-300000MeV_P7SOURCE_V6.fits 


[binlike]
    program = gtlike, Likelihood
    [[parameters]]
        statistic = BINNED
        irfs = general irfs
        expcube = /nfs/slac/g/ki/ki07/lisal/new_ltcube/ltcube_220838402.470_334683060.000.fits
        srcmdl = model3_A2163_plsrc.xml
        chatter = general chatter
        cmap = srcmap outfile
        bexpmap = expcube outfile
        optimizer = MINUIT
        specfile = binned3_specfile_,general name,_,_,general modelname,.fits
        sfile = binned3_fitted_,general name,_,general modelname,.xml
        results = binned3_results_,general name,_,general modelname,.dat

[srcmap]
    program = gtsrcmaps, General
    [[parameters]]
        irfs = general irfs
        scfile = general scfile
        expcube = /nfs/slac/g/ki/ki07/lisal/new_ltcube/ltcube_220838402.470_334683060.000.fits
        chatter = general chatter
        cmap = ccube outfile
        srcmdl = general model
        bexpmap = expcube outfile
        outfile = srcmap_,general name,_,general modelname,general mapname,.fits 

[expcube2]
    program = gtexpcube2, General
    [[parameters]]
	infile = /nfs/slac/g/ki/ki07/lisal/new_ltcube/ltcube_220838402.470_334683060.000.fits
	cmap = ccube outfile
	irfs = general irfs 
	bincalc = "EDGE" # Should always be used for binned analysis	
	table = "EXPOSURE"
	outfile = expcube_,general name,general mapname,.fits
	

# important to put evclsmin = 0
[select]
    program = gtselect, General
    [[parameters]]
        evclsmin = 0
        zmax = general zmax
        rad = general rad
        ra = general ra
        dec = general dec
        chatter = general chatter
        tmin = general tmin
        tmax = general tmax
        emin = general emin
        emax = general emax
        infile = general infile 
        outfile = presel_,general name,.fits
[binspec]
    program = binlikespec, PyApp
    [[parameters]]
        nsbins = 30
        enumbins = 4
        tsmin = 9
        algorithm = CCUBE
        ebinalg = LOG
        coordsys = CEL
        chatter = general chatter
        zmax = general zmax
        emax = general emax
        emin = general emin
        proj = general proj
        name = general name
        target = general target
        model = binlike sfile
        fixallbuttargetnorm = true
        evfile = general evfile
        scfile = general scfile
        irfs = general irfs
        ltcube = /nfs/slac/g/ki/ki07/lisal/new_ltcube/ltcube_220838402.470_334683060.000.fits
        rad = general rad
        ra = general ra
        dec = general dec
        tmin = general tmin
        tmax = general tmax
        optimizer = general optimizer
        nxpix = general mapxbins
        nypix = general mapybins
        binsz = general degperbin
        outputdir=spec_bins_binned_,general name,_bins,binspec nsbins,_emin,general emin,_emax,general emax
[xmlmodel]
    program = xmlmodel, PyApp
    [[parameters]]
		modelname = general modelname
        fitsfile = default
        exclude = none
        mergefile = none
        sigmamin = 4
        fixflux = 1e-7
        fixrad = 3
        ra = general ra
        dec = general dec
        rad = general exprad
	ccube = ccube outfile
	ccuberoi = false # only include sources contained with ccube dimensions
        target = general target
        addtarget = replace
        galdiff = /afs/slac/g/glast/groups/diffuse/rings/2year/ring_2year_P76_v0.fits
        isodiff = /afs/slac/g/glast/groups/diffuse/rings/2year/isotrop_2year_P76_source_v0.txt
	#galdiff = /afs/slac.stanford.edu/g/glast/ground/releases/analysisFiles/diffuse/v2/gll_iem_v02.fit
	#isodiff = /afs/slac.stanford.edu/g/glast/ground/releases/analysisFiles/diffuse/v2/isotropic_iem_v02.txt
        output = model_,general target,_,general modelname,.xml
        

[model]
    program = gtmodel, Likelihood
    [[parameters]]
        srcmaps = srcmap outfile
        srcmdl = binlike sfile
        irfs = general irfs
        chatter = general chatter
        expcube = /afs/slac/g/glast/groups/catalog/P7_V4_SOURCE/ltcube_24m_pass7.4_source_z100_t90_cl0.fits
        bexpmap = srcmap bexpmap
        outfile = model_,binlike sfile,general name,.fits

[cmap]
    program = gtbin, General
    [[parameters]]
        algorithm = CMAP
        coordsys = general coordsys
        chatter = general chatter
        proj = general proj
        emin = general emin
	emax = general emax
	nxpix = general mapxbins
        nypix = general mapybins
        binsz = general degperbin
        xref = general ra
        yref = general dec
        evfile = general evfile
        scfile = general scfile
        outfile = cmap_,general name,general mapname,.fits
