Skip to content

Commit 1ed5254

Browse files
committed
FIX: set incident angle during beamline object creation
1 parent 9b37caf commit 1ed5254

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

sims/run/generate_configs.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def get_defaults():
4444
cry_width=102,
4545
cry_depth=54,
4646
N=1,
47-
acceptance_angle=0.05651551,
47+
# will be set when buliding end station
48+
acceptance_angle=0,
4849
thickness=1,
4950
),
5051
"scan": SimScanConfig(start=min_tth, stop=max_tth, delta=1e-4),
@@ -71,7 +72,7 @@ def convert_cycler(cycle: Cycler) -> list[CompleteConfig]:
7172

7273

7374
if __name__ == "__main__":
74-
cycle = cycler("source.E_hwhm", np.array([.1, 1, 2, 5]) * 1.4e-4)
75+
cycle = cycler("source.E_hwhm", np.array([0.1, 1, 2, 5]) * 1.4e-4)
7576
configs = convert_cycler(cycle)
7677
config_path = Path("configs")
7778
config_path.mkdir(exist_ok=True)

src/bad_tools/xrt/endstation.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import functools
2-
from dataclasses import dataclass
2+
from dataclasses import dataclass, replace
33
from typing import Self
44

55
import numpy as np
@@ -31,8 +31,9 @@ def from_configs(
3131
sim: SimConfig,
3232
) -> Self:
3333
crystalSi01 = rmats.CrystalSi(t=analyzer.thickness)
34-
3534
theta_b = _bragg(crystalSi01, source.E_incident)
35+
analyzer = replace(analyzer, acceptance_angle=np.rad2deg(theta_b))
36+
3637
arm_tth = np.deg2rad(15)
3738
beamLine = raycing.BeamLine()
3839

0 commit comments

Comments
 (0)