Commit d532b581dd8c4f7ca4ae1d370ca1a6b1bf94db0d

Authored by Jürgen Knödlseder
1 parent beefe63f

Solve some minor code quality issues

cscripts/csbkgmodel.py
... ... @@ -19,7 +19,6 @@
19 19 #
20 20 # ==========================================================================
21 21 import sys
22   -import math
23 22 import gammalib
24 23 import ctools
25 24  
... ... @@ -96,10 +95,10 @@ class csbkgmodel(ctools.csobservation):
96 95  
97 96 # Query input parameters
98 97 spatial = self['spatial'].string()
99   - if self['spatial'].string() == 'GAUSS':
  98 + if spatial == 'GAUSS':
100 99 self['gradient'].boolean()
101 100 self['spectral'].string()
102   - if self['spatial'].string() == 'NODES':
  101 + if spatial == 'NODES':
103 102 self._create_energies()
104 103 self['runwise'].boolean()
105 104 self['emin'].real()
... ... @@ -330,7 +329,6 @@ class csbkgmodel(ctools.csobservation):
330 329 spectral = model.spectral()
331 330 nodes = spectral.nodes()
332 331 for i in range(nodes):
333   - ieng = 2*(nodes - i) - 2
334 332 iint = 2*(nodes - i) - 1
335 333 if spectral[iint].error() == 0.0:
336 334 spectral.remove(nodes - i - 1)
... ...
examples/show_significance_distribution.py
... ... @@ -2,7 +2,7 @@
2 2 # ==========================================================================
3 3 # Shows the distribution of significances in a given significance map.
4 4 #
5   -# Copyright (C) 2018 Andreas Specovius
  5 +# Copyright (C) 2018-2019 Andreas Specovius
6 6 #
7 7 # This program is free software: you can redistribute it and/or modify
8 8 # it under the terms of the GNU General Public License as published by
... ... @@ -50,7 +50,6 @@ import gammalib
50 50 import cscripts
51 51 try:
52 52 import matplotlib.pyplot as plt
53   - import matplotlib.mlab as mlab
54 53 plt.figure()
55 54 plt.close()
56 55 except (ImportError, RuntimeError):
... ...
src/ctfindvar/ctfindvar.cpp
... ... @@ -768,10 +768,10 @@ void ctfindvar::analyse_cube(void)
768 768 for (int ipix = 0; ipix < m_counts.npix(); ++ipix) {
769 769  
770 770 // Compute total counts for pixel
771   - double total_counts = 0.0;
772   - for (int k = 0; k < nbins; ++k) {
773   - total_counts += m_counts(ipix, k);
774   - }
  771 + //double total_counts = 0.0;
  772 + //for (int k = 0; k < nbins; ++k) {
  773 + // total_counts += m_counts(ipix, k);
  774 + //}
775 775  
776 776 // Getting the variability significance for the current pixel
777 777 GNdarray pixSig = get_variability_sig(ipix);
... ...
test/test_ctfindvar.py
... ... @@ -2,7 +2,7 @@
2 2 # ==========================================================================
3 3 # This scripts performs unit tests for the ctfindvar tool.
4 4 #
5   -# Copyright (C) 2018 Simon Bonnefoy
  5 +# Copyright (C) 2018-2019 Simon Bonnefoy
6 6 #
7 7 # This program is free software: you can redistribute it and/or modify
8 8 # it under the terms of the GNU General Public License as published by
... ... @@ -18,7 +18,6 @@
18 18 # along with this program. If not, see <http://www.gnu.org/licenses/>.
19 19 #
20 20 # ==========================================================================
21   -import os
22 21 import gammalib
23 22 import ctools
24 23 from testing import test
... ...