diff options
author | Onderwaater <onderwaa@esrf.fr> | 2015-12-14 10:45:35 +0100 |
---|---|---|
committer | Onderwaater <onderwaa@esrf.fr> | 2015-12-14 10:45:35 +0100 |
commit | 57ba0334ac5c139f6e960ac1ca56672721f78d36 (patch) | |
tree | b20bc7e4601aa3abd10fa7b397906cd1345c9ee6 | |
parent | 9bea7cc3ffa0ab6263054c39fa2db7b413a191c0 (diff) |
bugfix
-rwxr-xr-x | binoculars/space.py | 2 | ||||
-rw-r--r-- | test/id03.py | 12 |
2 files changed, 9 insertions, 5 deletions
diff --git a/binoculars/space.py b/binoculars/space.py index de501d3..73fe1cc 100755 --- a/binoculars/space.py +++ b/binoculars/space.py @@ -626,7 +626,7 @@ class Space(object): elif sl.start is not None and sl.stop is not None: invalid += numpy.bitwise_or(coord < sl.start, coord > sl.stop) - if numpy.all(invalid is True): + if numpy.all(invalid == True): return EmptySpace() coordinates = tuple(coord[~invalid] for coord in coordinates) intensity = intensity[~invalid] diff --git a/test/id03.py b/test/id03.py index 1a33d76..319ff66 100644 --- a/test/id03.py +++ b/test/id03.py @@ -18,7 +18,7 @@ class TestCase(unittest.TestCase): numpy.save('mask.npy', numpy.identity(516)) cfg_unparsed['maskmatrix'] = 'mask.npy' self.id03input = id03.EH2(cfg_unparsed) - self.projection = id03.pixels({'resolution' : '1'}) + self.projection = id03.HKLProjection({'resolution' : '0.01', 'limits' : '[0:, :-1, 0:0.2]'}) def test_IO(self): jobs = list(self.id03input.generate_jobs(['820'])) @@ -26,12 +26,16 @@ class TestCase(unittest.TestCase): imagedata = self.id03input.process_job(jobs[0]) intensity, weights, coords = imagedata.next() projected = self.projection.project(*coords) - space1 = binoculars.space.Space.from_image((1,1), ('x','y'), projected, intensity, weights) + limits = self.projection.config.limits + space1 = binoculars.space.Space.from_image(self.projection.config.resolution, self.projection.get_axis_labels(), projected, intensity, weights, limits = limits[0]) + + print space1 intensity, weights, coords = imagedata.next() projected = self.projection.project(*coords) - space2 = binoculars.space.Space.from_image((1,1), ('x','y'), projected, intensity, weights) - print space1 - space2 + + space2 = binoculars.space.Space.from_image(self.projection.config.resolution, self.projection.get_axis_labels(), projected, intensity, weights) + print space1 + space2 def tearDown(self): os.remove('mask.npy') |