4 Fermi LAT Flux Maps - nmik/Xgam GitHub Wiki

What mkdatafluxmaps.py does:

This app is aimed to prepare the data sample to the cross-correlation analysis. Several steps are computed:

  1. Sum in time

the data selection is preferentially done in 1-year-wide time bins, so now we want to merge those time bins to get the total counts and exposures. Counts and exposure maps in each micro energy bin are saved in output/output_counts/. Those maps are automatically retrieved if already present in the folder and overwrite keyword is False.

  1. Foreground Subtraction

If the associated flag is activated the fit and subtraction of the gamma-ray diffuse galactic emission model is performed over the micro energy bins. The fit is performed after downgrading the order of the maps and in the count space.

  1. Flux computation

The flux maps are derived as the ration of the count maps and the exposure maps in each micro energy bin. the flux maps are given in ph/cm2/s/sr. The maps are saved in output/output_flux/.

  1. Sum in energy

Flux maps in the macro energy bins are obtained summing the flux maps in the micro bins.

  1. Save the output file

A txt file is automatically generated and saved in output/. It contains all the main parameters related to the run.

Setting the configuration file:

Let's start by taking a look the configuration file: config/config_datafluxmaps.py:

IN_LABELS_LIST = ['w9w50_SV_t56', 'w51w100_SV_t56']
OUT_LABEL = '100weeks_SV_t56'

FORE_LABEL = 'glliemv07'
FORE_FILES_LIST = 'output/fits/gll_iem_v07_hp512_list.txt' 
#list of .fits files or .txt/.dat file containing the list of .fits file (used only if --foresub True)
IGRB_FILE = os.path.join(X_OUT, 'data/iso_P8R3_SOURCEVETO_V2_v1.txt') # (used only if --foresub True)
BINCALC = 'CENTER' #CENTER or EDGE, according to the data selection

BINNING_LABEL = '2binsTEST'
MICRO_BINS_FILE = os.path.join(X_OUT, 'ebinning.fits') # Created when mkdataselection.py is run 
MACRO_BINS = [(27,32),(33, 38)]

MASK_FILE = os.path.join(X_OUT, 'fits/Mask_gp25_src4fgl.fits')  #list of .fits files or .txt/.dat file containing the list of mask files; 'None' if no mask is needed
MASK_LABEL = 'mymask' # label used when creating the mask

Example:

To run the routine: >>> python bin/mkdatafluxmaps.py -c config/config_datafluxmaps.py --foresub True

To see all the options available for bin/mkfatafluxmaps.py type: >>> python bin/mkdatafluxmaps.py -h