Skip to content

Commit

Permalink
Merge pull request #1204 from lmohrmann/ring-bg-conv
Browse files Browse the repository at this point in the history
Consistently use mode='constant' in convolutions of RingBackgroundEstimator
  • Loading branch information
cdeil committed Nov 13, 2017
2 parents ca38c8f + 6df9591 commit 8b0c092
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion gammapy/background/ring.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def run(self, images):

exposure_on_excluded = SkyImage(data=exposure_on.data * exclusion.data, wcs=wcs)

result['exposure_off'] = exposure_on_excluded.convolve(ring.array, mode='reflect',
result['exposure_off'] = exposure_on_excluded.convolve(ring.array, mode='constant',
use_fft=p['use_fft_convolution'])

with np.errstate(divide='ignore'):
Expand Down
6 changes: 3 additions & 3 deletions gammapy/image/tests/test_basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,10 +93,10 @@ def setup(self):
def test_run(self):
images = OrderedDict()
images['counts'] = dict(sum=2222.0)
images['background'] = dict(sum=1827.9166666666665)
images['background'] = dict(sum=1885.083333333333)
images['exposure'] = dict(sum=83036669325.30281)
images['excess'] = dict(sum=394.0833333333333)
images['flux'] = dict(sum=8.477134335825048e-07)
images['excess'] = dict(sum=336.91666666666674)
images['flux'] = dict(sum=5.250525628586507e-07)
images['psf'] = dict(sum=1.)
results = self.estimator.run(self.observations)

Expand Down

0 comments on commit 8b0c092

Please sign in to comment.