From cf037f0724e88e9ffee9c89f78be67199ebeb247 Mon Sep 17 00:00:00 2001 From: dennisbrookner Date: Thu, 21 Dec 2023 12:28:12 -0500 Subject: [PATCH] implementation of weighting in matchmaps, .mr --- src/matchmaps/_compute_mr_diff.py | 13 +++++++++++++ src/matchmaps/_compute_realspace_diff.py | 1 + src/matchmaps/_utils.py | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/matchmaps/_compute_mr_diff.py b/src/matchmaps/_compute_mr_diff.py index 7e13d1b..7043d28 100644 --- a/src/matchmaps/_compute_mr_diff.py +++ b/src/matchmaps/_compute_mr_diff.py @@ -378,6 +378,18 @@ def parse_arguments(): ), ) + parser.add_argument( + "--alpha", + required=False, + type=float, + default=0, + help=( + "Alpha to use for error weighting of F-obs prior to Fourier Transform. " + "Weights are computed as: 1 / ((1+(alpha*(SigF^2)) / ^2). " + "Default value is alpha=0, e.g., no weighting is performed. " + ) + ) + parser.add_argument( "--verbose", "-v", @@ -467,6 +479,7 @@ def main(): dmin=args.dmin, spacing=args.spacing, radius=args.unmasked_radius, + alpha=args.alpha, on_as_stationary=args.on_as_stationary, keep_temp_files=args.keep_temp_files, no_bss = args.no_bss diff --git a/src/matchmaps/_compute_realspace_diff.py b/src/matchmaps/_compute_realspace_diff.py index 501a65e..0e068e0 100755 --- a/src/matchmaps/_compute_realspace_diff.py +++ b/src/matchmaps/_compute_realspace_diff.py @@ -480,6 +480,7 @@ def main(): dmin=args.dmin, spacing=args.spacing, radius=args.unmasked_radius, + alpha=args.alpha, on_as_stationary=args.on_as_stationary, keep_temp_files=args.keep_temp_files, no_bss = args.no_bss, diff --git a/src/matchmaps/_utils.py b/src/matchmaps/_utils.py index 7c9a7a4..d24d614 100644 --- a/src/matchmaps/_utils.py +++ b/src/matchmaps/_utils.py @@ -108,7 +108,7 @@ def _subparser(selection): def make_floatgrid_from_mtz( - mtz, spacing, F, SigF, Phi, spacegroup="P1", dmin=None, alpha=0.2 + mtz, spacing, F, SigF, Phi, spacegroup="P1", dmin=None, alpha=0 ): """ Make a gemmi.FloatGrid from an rs.DataSet.