-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2231 from kif/2227_worker_generic_detector
Generic detector in worker
- Loading branch information
Showing
3 changed files
with
32 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ | |
__contact__ = "[email protected]" | ||
__license__ = "MIT" | ||
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France" | ||
__date__ = "30/04/2024" | ||
__date__ = "04/07/2024" | ||
|
||
import unittest | ||
import logging | ||
|
@@ -439,6 +439,29 @@ def test_old(self): | |
ai = worker.ai | ||
self.assertTrue(numpy.allclose(config["shape"], ai.detector.max_shape)) | ||
|
||
def test_regression_2227(self): | ||
"""pixel size got lost with generic detector""" | ||
worker_generic = Worker() | ||
integration_options_generic = {'poni_version': 2.1, | ||
'detector': 'Detector', | ||
'detector_config': {'pixel1': 1e-4, | ||
'pixel2': 1e-4, | ||
'max_shape': [576, 748], | ||
'orientation': 3}, | ||
'dist': 0.16156348926909264, | ||
'poni1': 1.4999999999999998, | ||
'poni2': 1.4999999999999998, | ||
'rot1': 1.0822864853552985, | ||
'rot2': -0.41026007690779387, | ||
'rot3': 0.0, | ||
'wavelength': 1.0332016536100021e-10} | ||
worker_generic.set_config(integration_options_generic) | ||
self.assertEqual(worker_generic.ai.detector.pixel1, 1e-4, "Pixel1 size matches") | ||
self.assertEqual(worker_generic.ai.detector.pixel2, 1e-4, "Pixel2 size matches") | ||
self.assertEqual(worker_generic.ai.detector.shape, [576, 748], "Shape matches") | ||
self.assertEqual(worker_generic.ai.detector.orientation, 3, "Orientation matches") | ||
|
||
|
||
def suite(): | ||
loader = unittest.defaultTestLoader.loadTestsFromTestCase | ||
testsuite = unittest.TestSuite() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters