README.md 6.46 KB
Newer Older
Andrew Strong's avatar
Andrew Strong committed
1
2
# Fermi-LAT HealPix intensity skymapping tool

Andrew Strong's avatar
Andrew Strong committed
3
4
Tool  to create gamma-ray intensity skymaps in HealPix format from Fermi-LAT data.

Andrew Strong's avatar
Andrew Strong committed
5
Programme (c++):
Andrew Strong's avatar
Andrew Strong committed
6

Andrew Strong's avatar
Andrew Strong committed
7
8
9
10
11
12
13
14
15
healpix_fermi_intensity_skymap.cc


  Description:

   Divides Fermi-LAT HealPix counts maps by exposure maps to produce HealPix intensity maps.
   The counts maps are assumed to have been generated by FermiTools gtbin with algorithm=HEALPIX
   The exposure maps are assumed generated by gtexpcube2 in Healpix and the same event selections as the counts

Andrew Strong's avatar
Andrew Strong committed
16
   Maps in energy ranges as columns,  and energy-integrated values both increasing ("up") and decreasing ("down") in energy  are output to separate files. 
Andrew Strong's avatar
Andrew Strong committed
17
18
19
20
21
22
23
24
   Gaussian-smoothed energy bins and  energy-integrated values are  also output.
   Spherical-harmonic maps A_lm are output, by energy ranges in columns.

   The two input files are arguments, the first is divided by the second, with interpolation of the second in energy, according to the energies.
   The exposure need not have the same HealPix order as the counts; if different, the exposure is rebinned to the order of counts before division.
   The pixel solid angle (uniform = 4pi/number of pixels in HealPix) is used to convert units to intensity per sr.
  
   Units: 
Andrew Strong's avatar
Andrew Strong committed
25
   
Andrew Strong's avatar
Andrew Strong committed
26
    counts:    counts in pixel in energy bands
Andrew Strong's avatar
Andrew Strong committed
27
    
Andrew Strong's avatar
Andrew Strong committed
28
    exposure:  cm^2 s
Andrew Strong's avatar
Andrew Strong committed
29
    
Andrew Strong's avatar
Andrew Strong committed
30
    intensity: photons cm^-2 sr⁻1 s⁻1  in energy bands
Andrew Strong's avatar
Andrew Strong committed
31
    
Andrew Strong's avatar
Andrew Strong committed
32

33
   Requires HealPix v3.11 or higher,  available from http://healpix.jpl.nasa.gov/
Andrew Strong's avatar
Andrew Strong committed
34
35

   Usage: 
36

Andrew Strong's avatar
Andrew Strong committed
37
38
39
40
41
42
43
44
45
46
    ./healpix_fermi_intensity_skymap  counts_filename  exposure_filename  FWHM  prefix

                  counts_filename   input HealPix  counts file   (may be .gz, in which case the output file is also .gz)
                  exposure_filename input HealPix  exposure file (may be .gz)
                  FWHM              Gaussian full width half-max in degrees for smoothing
                  prefix            prefix prepended to output files

                 
   Restrictions: must be run in same directory as input files since output filenames are based on input filenames
   
47
48
   The maps can be viewed, rotated etc with the Aladin programme provided by CDS Strasbourg.
   Energies are selected by columns using 'Edit>Preferences'.
Andrew Strong's avatar
Andrew Strong committed
49
50
   Note Aladin will read .gz files.

Andrew Strong's avatar
Andrew Strong committed
51
   Version 2.0
Andrew Strong's avatar
Andrew Strong committed
52
53


54
Build instructions are in the header of the file and copied here:
Andrew Strong's avatar
Andrew Strong committed
55

56
These are examples for MPE installation, replace with appropriate paths.
Andrew Strong's avatar
Andrew Strong committed
57

58
59
60
61
--------------------------------------------------------

linux: 

62
63
setenv FITSIO_DIRECTORY /afs/ipp-garching.mpg.de/home/a/aws/propagate/c/cfitsio/3.26/gcc_sles11_olga2/cfitsio

64
65
66
67
68
69
70
using HEALPix v3.11:

setenv HEALPIX_PATH /afs/ipp-garching.mpg.de/home/a/aws/Healpix/Healpix_3.11/src/cxx/generic_gcc

GNU compiler:
g++  healpix_fermi_intensity_skymap.cc -I$HEALPIX_PATH/include -L$HEALPIX_PATH/lib -I$FITSIO_DIRECTORY/include -L$FITSIO_DIRECTORY/lib -lhealpix_cxx -lcxxsupport -lsharp -lfftpack -lc_utils -lcfitsio -fopenmp -lcfitsio -o healpix_fermi_intensity_skymap

71
72
73
74
75

using HEALPix v3.50: (note change of fft library!)

setenv HEALPIX_PATH /afs/ipp-garching.mpg.de/home/a/aws/Healpix/Healpix_3.50/src/cxx/generic_gcc

76
g++  healpix_fermi_intensity_skymap.cc -I$HEALPIX_PATH/include -L$HEALPIX_PATH/lib -I$FITSIO_DIRECTORY/include -L$FITSIO_DIRECTORY/lib -lhealpix_cxx -lcxxsupport -lsharp -lpocketfft -lc_utils -lcfitsio -fopenmp -lcfitsio -o healpix_fermi_intensity_skymap
77

78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
-----------------------------

using HEALPix v3.60: (note change of healpix libraries!) and newer cfitsio

module load gcc

setenv HEALPIX_PATH /afs/ipp-garching.mpg.de/home/a/aws/Healpix/Healpix_3.60_module_load_gcc

setenv FITSIO_DIRECTORY /afs/ipp-garching.mpg.de/home/a/aws/propagate/c/cfitsio/3.47/cfitsio-3.47/build

g++  healpix_fermi_intensity_skymap.cc -I$HEALPIX_PATH/include/healpix_cxx  -I$HEALPIX_PATH/include/libsharp  -L$HEALPIX_PATH/lib -I$FITSIO_DIRECTORY/include -L$FITSIO_DIRECTORY/lib -lhealpix_cxx -lsharp  -lcfitsio -fopenmp -lcfitsio -o healpix_fermi_intensity_skymap

------------------------------------------------------------------


93

94
Intel compiler:
95
96
using HEALPix v3.11

97
98
99
icpc  healpix_fermi_intensity_skymap.cc -I$HEALPIX_PATH/include -L$HEALPIX_PATH/lib -I$FITSIO_DIRECTORY/include -L$FITSIO_DIRECTORY/lib -lhealpix_cxx -lcxxsupport -lsharp -lfftpack -lc_utils -lcfitsio -fopenmp -lcfitsio -o healpix_fermi_intensity_skymap

MacOS:
100
 at present there is a problem due to OpenMP library, which is not actually used but is automatically detected by HEALPix installation, so this will be fixed. IN PROGRESS.
101
102
103
104
105

-----------------------------------------------------------------------------

Sample input data are provided, with the refence output for installation check.

106
Input files: (10 years of CLEAN event class from HEASARC, 10 energy ranges, HEALPix order 7 (gtbin:counts), 6 (gtexpcube2:exposure)
107

108
counts_healpix_full_clean_gt20MeV.fits
109

110
111
exposure_healpix_full_clean_gt20MeV.fits

112
113
114
Set runtime libraries (example from MPE, for healpix 3.60)

setenv LD_LIBRARY_PATH /afs/ipp-garching.mpg.de/home/a/aws/propagate/c/cfitsio/3.47/cfitsio-3.47/build/lib:/afs/ipp-garching.mpg.de/home/a/aws/Healpix/Healpix_3.60_module_load_gcc/lib
115

116
run command ( 1 deg smoothing, prefix=test):
117

118
119
120
121
122
   ./healpix_fermi_intensity_skymap  counts_healpix_full_clean_gt20MeV.fits exposure_healpix_full_clean_gt20MeV.fits 1 test

Output files:

test_healpix_intensity_using_counts_healpix_full_clean_gt20MeV.fits
Andrew Strong's avatar
Andrew Strong committed
123
124
test_healpix_intensity_integrated_up_using_counts_healpix_full_clean_gt20MeV.fits
test_healpix_intensity_integrated_down_using_counts_healpix_full_clean_gt20MeV.fits
125
test_healpix_intensity_smoothed_using_counts_healpix_full_clean_gt20MeV.fits
Andrew Strong's avatar
Andrew Strong committed
126
127
test_healpix_intensity_integrated_up_smoothed_using_counts_healpix_full_clean_gt20MeV.fits
test_healpix_intensity_integrated_down_smoothed_using_counts_healpix_full_clean_gt20MeV.fits
128
test_healpix_exposure_rebinned_using_exposure_healpix_full_clean_gt20MeV.fits
Andrew Strong's avatar
Andrew Strong committed
129
test_healpix_intensity_Alm_using_counts_healpix_full_clean_gt20MeV.fits
130

Andrew Strong's avatar
Andrew Strong committed
131
132
133
134
135
Sample images made with Aladin on these files: *.jpeg

2-5 GeV (erange6), unsmoothed

 Centred on Galactic plane
Andrew Strong's avatar
Andrew Strong committed
136
 
Andrew Strong's avatar
Andrew Strong committed
137
 Pan to North
Andrew Strong's avatar
Andrew Strong committed
138
 
Andrew Strong's avatar
Andrew Strong committed
139
 Anticentre zoom
Andrew Strong's avatar
Andrew Strong committed
140
 
Andrew Strong's avatar
Andrew Strong committed
141
 Northern hemisphere
Andrew Strong's avatar
Andrew Strong committed
142
 
Andrew Strong's avatar
Andrew Strong committed
143
144
145
 Southern hemisphere

12.6-31.7 GeV (erange8) unsmoothed
Andrew Strong's avatar
Andrew Strong committed
146

Andrew Strong's avatar
Andrew Strong committed
147
148
149
 Centred on Galactic plane


150
-----------------------------------
Andrew Strong's avatar
Andrew Strong committed
151
   
152
A. W. Strong, MPE, first release 30 Nov 2019
Andrew Strong's avatar
Andrew Strong committed
153

Andrew Strong's avatar
Andrew Strong committed
154
History:
Andrew Strong's avatar
Andrew Strong committed
155

Andrew Strong's avatar
Andrew Strong committed
156
20190806 First version v1.0
Andrew Strong's avatar
Andrew Strong committed
157
158
159
160

20190808 HEALPix 3.50 library 

20190820 added EBOUNDS extension to all intensity maps
Andrew Strong's avatar
Andrew Strong committed
161
162

20191130 added integration downward in energy. v2.0
163
164
165

20200530 added build for healpix-3.60 and newer cfitsio

166
167
168
20200828 added setenv LD_LIBRARY_PATH for runtime libraries