Skip to content
Snippets Groups Projects
Commit ee23c2c5 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

use new c'tor in py examples

parent 651e7cf5
No related branches found
No related tags found
1 merge request!1859FlatDetector: long c'tor instead of setter fcts
......@@ -17,11 +17,8 @@ def get_sample():
def get_simulation(sample):
beam = ba.Beam(1e9, 1*angstrom, 0.2*deg)
n = 500
detector_distance = 2000.0 # in mm
width = 170 # nm
height = width
detector = ba.FlatDetector(n, width, n, height)
detector.setPerpendicularToSampleX(detector_distance, width/2., 0)
detector = ba.FlatDetector(n, n, width, width, beam, ba.FlatDetector.X, 2000.)
simulation = ba.ScatteringSimulation(beam, sample, detector)
return simulation
......
......@@ -38,8 +38,7 @@ def get_simulation(sample):
detPos = 2000 # distance from sample center to detector in mm
detWid = 500 # detector width in mm
n = 200 # number of pixels per direction
det = ba.FlatDetector(n, detWid, n, detWid)
det.setPerpendicularToDirectBeam(detPos, detWid/2, detWid/2)
det = ba.FlatDetector(n, n, detWid, detWid, beam, ba.FlatDetector.T, detPos)
return ba.ScatteringSimulation(beam, sample, det)
......
......@@ -57,10 +57,9 @@ def get_simulation(sample):
beam = ba.Beam(1e9, 0.4*nm, 9*deg)
# Detector opposite to source:
detPos = 2000 # distance from sample center to detector in mm
detPos = 2000 # distance from sample center to detector in mm
detWid = 500 # detector width in mm
detector = ba.FlatDetector(n, detWid, n, detWid)
detector.setPerpendicularToDirectBeam(detPos, detWid/2, detWid/2)
detector = ba.FlatDetector(n, n, detWid, detWid, beam, ba.FlatDetector.T, detPos)
beam.setPolarization(R3(0, 1, 0))
detector.setAnalyzer(R3(0, -1, 0))
......
......@@ -17,11 +17,8 @@ def get_sample():
def get_simulation(sample):
beam = ba.Beam(1e9, 1*angstrom, 0.2*deg)
n = 11
detector_distance = 2000.0 # in mm
width = 170 # nm
height = width
detector = ba.FlatDetector(n, width, n, height)
detector.setPerpendicularToSampleX(detector_distance, width/2., 0)
detector = ba.FlatDetector(n, n, width, width, beam, ba.FlatDetector.X, 2000.)
simulation = ba.ScatteringSimulation(beam, sample, detector)
return simulation
......
......@@ -38,8 +38,7 @@ def get_simulation(sample):
detPos = 2000 # distance from sample center to detector in mm
detWid = 500 # detector width in mm
n = 11 # number of pixels per direction
det = ba.FlatDetector(n, detWid, n, detWid)
det.setPerpendicularToDirectBeam(detPos, detWid/2, detWid/2)
det = ba.FlatDetector(n, n, detWid, detWid, beam, ba.FlatDetector.T, detPos)
return ba.ScatteringSimulation(beam, sample, det)
......
......@@ -57,10 +57,9 @@ def get_simulation(sample):
beam = ba.Beam(1e9, 0.4*nm, 9*deg)
# Detector opposite to source:
detPos = 2000 # distance from sample center to detector in mm
detPos = 2000 # distance from sample center to detector in mm
detWid = 500 # detector width in mm
detector = ba.FlatDetector(n, detWid, n, detWid)
detector.setPerpendicularToDirectBeam(detPos, detWid/2, detWid/2)
detector = ba.FlatDetector(n, n, detWid, detWid, beam, ba.FlatDetector.T, detPos)
beam.setPolarization(R3(0, 1, 0))
detector.setAnalyzer(R3(0, -1, 0))
......
......@@ -17,11 +17,8 @@ def get_sample():
def get_simulation(sample):
beam = ba.Beam(1e9, 1*angstrom, 0.2*deg)
n = <%= sm ? 11 : 500 %>
detector_distance = 2000.0 # in mm
width = 170 # nm
height = width
detector = ba.FlatDetector(n, width, n, height)
detector.setPerpendicularToSampleX(detector_distance, width/2., 0)
detector = ba.FlatDetector(n, n, width, width, beam, ba.FlatDetector.X, 2000.)
simulation = ba.ScatteringSimulation(beam, sample, detector)
return simulation
......
......@@ -38,8 +38,7 @@ def get_simulation(sample):
detPos = 2000 # distance from sample center to detector in mm
detWid = 500 # detector width in mm
n = <%= sm ? 11 : 200 %> # number of pixels per direction
det = ba.FlatDetector(n, detWid, n, detWid)
det.setPerpendicularToDirectBeam(detPos, detWid/2, detWid/2)
det = ba.FlatDetector(n, n, detWid, detWid, beam, ba.FlatDetector.T, detPos)
return ba.ScatteringSimulation(beam, sample, det)
......
......@@ -57,10 +57,9 @@ def get_simulation(sample):
beam = ba.Beam(1e9, 0.4*nm, 9*deg)
# Detector opposite to source:
detPos = 2000 # distance from sample center to detector in mm
detPos = 2000 # distance from sample center to detector in mm
detWid = 500 # detector width in mm
detector = ba.FlatDetector(n, detWid, n, detWid)
detector.setPerpendicularToDirectBeam(detPos, detWid/2, detWid/2)
detector = ba.FlatDetector(n, n, detWid, detWid, beam, ba.FlatDetector.T, detPos)
beam.setPolarization(R3(0, 1, 0))
detector.setAnalyzer(R3(0, -1, 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