Skip to content
Snippets Groups Projects
Commit 1b5fdd16 authored by Martin Teichmann's avatar Martin Teichmann
Browse files

document and test the in-place changes of datasets

parent 67cef9ef
No related branches found
No related tags found
1 merge request!231improve the integation code
...@@ -467,7 +467,7 @@ class hRIXS: ...@@ -467,7 +467,7 @@ class hRIXS:
Example Example
------- -------
data = h.integrate(data) # create spectrum by summing pixels h.integrate(data) # create spectrum by summing pixels
data.spectrum[0, :].plot() # plot the spectrum of the first image data.spectrum[0, :].plot() # plot the spectrum of the first image
""" """
bins = self.Y_RANGE.stop - self.Y_RANGE.start - 20 bins = self.Y_RANGE.stop - self.Y_RANGE.start - 20
......
...@@ -16,10 +16,11 @@ class TestHRIXS(unittest.TestCase): ...@@ -16,10 +16,11 @@ class TestHRIXS(unittest.TestCase):
h.CURVE_A = 0.1 h.CURVE_A = 0.1
h.CURVE_B = 0.01 h.CURVE_B = 0.01
h.Y_RANGE = slice(30, 170) h.Y_RANGE = slice(30, 170)
data = h.integrate(data) r = h.integrate(data)
self.assertIs(r, data)
self.assertEqual(data['spectrum'][1, 50].values[()], self.assertEqual(data['spectrum'][1, 50].values[()],
28517.704705882352) 28517.704705882352)
self.assertEqual(data['spectrum'][1, 50].coords['energy'], 90) self.assertEqual(data['spectrum'][1, 50].coords['energy'], 90)
if __name__ == "__main__": if __name__ == "__main__":
unittest.main() unittest.main()
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment