Skip to content

Commit

Permalink
FIX: set incident angle during beamline object creation
Browse files Browse the repository at this point in the history
  • Loading branch information
tacaswell committed Feb 7, 2025
1 parent 9b37caf commit 1ed5254
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions sims/run/generate_configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ def get_defaults():
cry_width=102,
cry_depth=54,
N=1,
acceptance_angle=0.05651551,
# will be set when buliding end station
acceptance_angle=0,
thickness=1,
),
"scan": SimScanConfig(start=min_tth, stop=max_tth, delta=1e-4),
Expand All @@ -71,7 +72,7 @@ def convert_cycler(cycle: Cycler) -> list[CompleteConfig]:


if __name__ == "__main__":
cycle = cycler("source.E_hwhm", np.array([.1, 1, 2, 5]) * 1.4e-4)
cycle = cycler("source.E_hwhm", np.array([0.1, 1, 2, 5]) * 1.4e-4)
configs = convert_cycler(cycle)
config_path = Path("configs")
config_path.mkdir(exist_ok=True)
Expand Down
5 changes: 3 additions & 2 deletions src/bad_tools/xrt/endstation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import functools
from dataclasses import dataclass
from dataclasses import dataclass, replace
from typing import Self

import numpy as np
Expand Down Expand Up @@ -31,8 +31,9 @@ def from_configs(
sim: SimConfig,
) -> Self:
crystalSi01 = rmats.CrystalSi(t=analyzer.thickness)

theta_b = _bragg(crystalSi01, source.E_incident)
analyzer = replace(analyzer, acceptance_angle=np.rad2deg(theta_b))

arm_tth = np.deg2rad(15)
beamLine = raycing.BeamLine()

Expand Down

0 comments on commit 1ed5254

Please sign in to comment.