Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Physics package fixes #1754

Merged
merged 5 commits into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion hexrdgui/overlays/powder_overlay.py
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,8 @@ def pinhole_distortion_kwargs(self):
kwargs = self.tth_distortion_kwargs.copy()
if self.pinhole_distortion_type == 'RyggPinholeDistortion':
# Add our absorption length
kwargs['absorption_length'] = HexrdConfig().absorption_length()
kwargs['absorption_length'] = HexrdConfig(
).absorption_length() * 1e-3
return kwargs
# END PolarDistortionObject mixin reroutes

Expand Down
2 changes: 1 addition & 1 deletion hexrdgui/physics_package_manager_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def setup_form(self):
self.ui.pinhole_density.setValue(physics.pinhole_density)
if self.instrument_type == 'PXRDIP':
self.ui.pinhole_thickness.setValue(70)
self.ui.pinhole_diameter.setValue(130)
self.ui.pinhole_diameter.setValue(300)
saransh13 marked this conversation as resolved.
Show resolved Hide resolved
else:
self.ui.pinhole_thickness.setValue(physics.pinhole_thickness)
self.ui.pinhole_diameter.setValue(physics.pinhole_diameter)
Expand Down
5 changes: 3 additions & 2 deletions hexrdgui/pinhole_correction_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,14 +154,15 @@ def correction_kwargs(self, v):
if v is None:
return

vp = v.copy()
# These units are in mm, but we display in micrometers
for key, value in v.items():
if key in ('num_phi_elements', 'absorption_length'):
multiplier = 1
else:
multiplier = 1e3

v[key] = value * multiplier
vp[key] = value * multiplier

physics = HexrdConfig().physics_package
if physics is None:
Expand Down Expand Up @@ -201,7 +202,7 @@ def correction_kwargs(self, v):
for w_name, (key, value) in values.items():
if w_name.startswith(widget_prefix):
# Extract the value from the dict
value = v.get(key, value)
value = vp.get(key, value)

w = getattr(self.ui, w_name)
w.setValue(value)
Expand Down
Loading