Commit 6bc297f8f13deee8aecf20a1171ef5a8cd45bb1b

Authored by Jürgen Knödlseder
1 parent 12f31edc

Adapt to new gammalib-00-08-00 interface

Showing 1 changed file with 5 additions and 5 deletions
test/example_radial_models.py
... ... @@ -35,10 +35,10 @@ def test_radial_model(name, model, clobber=True):
35 35 # Fill the image
36 36 energy = GEnergy()
37 37 time = GTime()
38   - for pix in range(image.npix()):
39   - dir = image.pix2dir(pix)
  38 + for inx in range(image.npix()):
  39 + dir = image.inx2dir(inx)
40 40 theta = center.dist(dir)
41   - image[pix] = model.eval(theta, energy, time)
  41 + image[inx] = model.eval(theta, energy, time)
42 42  
43 43 # Write it to file
44 44 filename = name + '.fits'
... ... @@ -47,8 +47,8 @@ def test_radial_model(name, model, clobber=True):
47 47  
48 48 # Check that it integrates to 1
49 49 integral = 0.0
50   - for pix in range(image.npix()):
51   - integral += image.omega(pix) * image[pix]
  50 + for inx in range(image.npix()):
  51 + integral += image.solidangle(inx) * image[inx]
52 52 print('integral = %g (should be 1)' % integral)
53 53 print('integral error = %g (should be 0)' % (integral - 1))
54 54 print('')
... ...