Skip to content
Snippets Groups Projects
Commit e7d2d570 authored by LINJIAO email's avatar LINJIAO email
Browse files

Refs #24158. fixed the annulus factor: forgot to normalize earlier.

fixed test too: turns out the original order of resolution still holds
parent 763828b6
No related merge requests found
...@@ -469,4 +469,4 @@ def sam0(sx, sy, sz, isam): ...@@ -469,4 +469,4 @@ def sam0(sx, sy, sz, isam):
# Sample type: 0==flat plate, 1==ellipse, 2==annulus, 3==sphere, 4==solid cylinder # Sample type: 0==flat plate, 1==ellipse, 2==annulus, 3==sphere, 4==solid cylinder
sample_shape_scaling_factors = collections.defaultdict(lambda: 1./12) sample_shape_scaling_factors = collections.defaultdict(lambda: 1./12)
sample_shape_scaling_factors[2] = np.pi/16. sample_shape_scaling_factors[2] = 1./8
...@@ -34,10 +34,10 @@ class PyChop2Tests(unittest.TestCase): ...@@ -34,10 +34,10 @@ class PyChop2Tests(unittest.TestCase):
self.assertTrue(flux[2] > flux[1]) self.assertTrue(flux[2] > flux[1])
# Note that MAPS has been upgraded so now should have higher flux than MARI. # Note that MAPS has been upgraded so now should have higher flux than MARI.
self.assertTrue(flux[0] > flux[1]) self.assertTrue(flux[0] > flux[1])
# Checks that the resolution should be best for MAPS, MARI and MERLIN in that order # Checks that the resolution should be best for MARI, MAPS, and MERLIN in that order
# actually MAPS and MARI resolutions are very close # actually MAPS and MARI resolutions are very close
self.assertTrue(res[0][0] < res[1][0]) self.assertTrue(res[1][0] < res[0][0])
self.assertTrue(res[1][0] < res[2][0]) self.assertTrue(res[0][0] < res[2][0])
# Now tests the standalone function # Now tests the standalone function
for inc, instname in enumerate(instnames): for inc, instname in enumerate(instnames):
rr, ff = PyChop2.calculate(instname, 's', 200, 18, 0) rr, ff = PyChop2.calculate(instname, 's', 200, 18, 0)
......
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