Commit 1037eb763a14473dd5dba6db0a06a566a9325926

Authored by Jürgen Knödlseder
2 parents 626051bc 089f4f79

Merge branch '2309-correct-skymap-smoothing' into integration

# Conflicts:
#	ChangeLog
#	NEWS
#	doc/source/admin/release_history/index.rst
ChangeLog
... ... @@ -7,6 +7,14 @@
7 7 Add GCTABackground::rate_ebin() method (#2308)
8 8  
9 9  
  10 +2018-02-13
  11 +
  12 + * Bug fix version 1.5.1 released
  13 + ================================
  14 +
  15 + Correct sky map smoothing.
  16 +
  17 +
10 18 2018-01-23
11 19  
12 20 * Version 1.5.0 released
... ...
doc/source/admin/release_history/1.5.1.rst 0 → 100644
  1 +.. _1.5.1:
  2 +
  3 +GammaLib 1.5.1 release
  4 +======================
  5 +
  6 +Overview
  7 +--------
  8 +
  9 +GammaLib 1.5.1 is a bug fix release for GammaLib release 1.5.
  10 +
  11 +The following bugs were fixed:
  12 +
  13 +* Correct sky map smoothing
  14 +
  15 +
  16 +The following improvements were made:
  17 +
  18 +* ...
... ...
doc/source/admin/release_history/index.rst
... ... @@ -7,6 +7,7 @@ Release History
7 7 :maxdepth: 1
8 8  
9 9 GammaLib 1.6 <1.6>
  10 + GammaLib 1.5.1 <1.5.1>
10 11 GammaLib 1.5 <1.5>
11 12 GammaLib 1.4.3 <1.4.3>
12 13 GammaLib 1.4.2 <1.4.2>
... ...
src/sky/GSkyMap.cpp
... ... @@ -3213,6 +3213,14 @@ GNdarray GSkyMap::smooth_kernel(const std::string&amp; kernel,
3213 3213 if (std::sqrt(xqs + y*y) <= par) {
3214 3214 kern(ix1,iy1) += 1.0;
3215 3215 sum += 1.0;
  3216 + if (ix2 < m_num_x) {
  3217 + kern(ix2,iy1) += 1.0;
  3218 + sum += 1.0;
  3219 + }
  3220 + if (iy2 < m_num_y) {
  3221 + kern(ix1,iy2) += 1.0;
  3222 + sum += 1.0;
  3223 + }
3216 3224 if ((ix2 < m_num_x) && (iy2 < m_num_y)) {
3217 3225 kern(ix2,iy2) += 1.0;
3218 3226 sum += 1.0;
... ... @@ -3238,6 +3246,14 @@ GNdarray GSkyMap::smooth_kernel(const std::string&amp; kernel,
3238 3246 double value = std::exp(norm * (xqs + y*y));
3239 3247 kern(ix1,iy1) += value;
3240 3248 sum += value;
  3249 + if (ix2 < m_num_x) {
  3250 + kern(ix2,iy1) += value;
  3251 + sum += value;
  3252 + }
  3253 + if (iy2 < m_num_y) {
  3254 + kern(ix1,iy2) += value;
  3255 + sum += value;
  3256 + }
3241 3257 if ((ix2 < m_num_x) && (iy2 < m_num_y)) {
3242 3258 kern(ix2,iy2) += value;
3243 3259 sum += value;
... ...
test/test_GSky.cpp
... ... @@ -1212,6 +1212,7 @@ void TestGSky::test_GSkyMap(void)
1212 1212 // Smooth map using DISK kernel
1213 1213 GSkyMap map_smooth1 = map_smooth;
1214 1214 map_smooth1.smooth("DISK", 0.2);
  1215 + map_smooth1.save("test_map_smooth_disk.fits", true);
1215 1216  
1216 1217 // Compute sum of smoothed sky map
1217 1218 double sum_smooth1 = 0.0;
... ... @@ -1223,6 +1224,7 @@ void TestGSky::test_GSkyMap(void)
1223 1224 // Smooth map using GAUSSIAN kernel
1224 1225 GSkyMap map_smooth2 = map_smooth;
1225 1226 map_smooth2.smooth("GAUSSIAN", 0.2);
  1227 + map_smooth2.save("test_map_smooth_gaussian.fits", true);
1226 1228  
1227 1229 // Compute sum of smoothed sky map
1228 1230 double sum_smooth2 = 0.0;
... ...