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

Updated weighting strategy after looking at more datasets. #48

Merged
merged 1 commit into from
Mar 15, 2024
Merged
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
13 changes: 1 addition & 12 deletions src/dials/algorithms/refinement/weighting_strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,26 +99,15 @@ def calculate_weights(self, reflections):


class TOFWeightingStrategy(StatisticalWeightingStrategy):
"""Defines a single method that provides a ReflectionManager with a strategy
for calculating weights for refinement. This version uses statistical weights
for X and Y and a fixed constant for the delta Psi part, defaulting to 1000000"""

def __init__(self):
pass

def calculate_weights(self, reflections):
"""Include weights for DeltaPsi"""

# call parent class method to set X and Y weights
reflections = super().calculate_weights(reflections)

wx, wy, _ = reflections["xyzobs.mm.weights"].parts()
wavelength_var = (
reflections["wavelength"]
- sum(reflections["wavelength"]) / len(reflections)
) ** 2
wz = 1 / wavelength_var
wz = wy * 1260000
wz = flex.sqrt(wx * wx + wy * wy) * 1e7
reflections["xyzobs.mm.weights"] = flex.vec3_double(wx, wy, wz)

return reflections
Loading