Skip to content
Snippets Groups Projects

FlatDetector: long c'tor instead of setter fcts

Merged Wuttke, Joachim requested to merge fd5 into r22
1 file
+ 10
10
Compare changes
  • Side-by-side
  • Inline
@@ -90,18 +90,18 @@ def get_sample(P):
return sample
def create_detector():
def create_detector(beam):
"""
A model of the GALAXY detector
"""
u0 = beam_xpos*pilatus_pixel_size # in mm
v0 = beam_ypos*pilatus_pixel_size # in mm
detector = ba.FlatDetector(pilatus_npx,
pilatus_npx*pilatus_pixel_size,
pilatus_npy,
pilatus_npy*pilatus_pixel_size)
detector.setPerpendicularToDirectBeam(detector_distance, u0, v0)
return detector
n = pilatus_npx
s = pilatus_pixel_size
w = n*s
u0 = beam_xpos*s # in mm
v0 = beam_ypos*s # in mm
return ba.FlatDetector(
n, n, w, w, beam, ba.FlatDetector.T, detector_distance,
0, 0, 0, u0 - w/2, v0 - w/2)
def create_simulation(P):
@@ -110,7 +110,7 @@ def create_simulation(P):
"""
beam = ba.Beam(1.2e7, wavelength, alpha_i)
sample = get_sample(P)
detector = create_detector()
detector = create_detector(beam)
simulation = ba.ScatteringSimulation(beam, sample, detector)
simulation.setRegionOfInterest(85, 70, 120, 92.)
Loading