From 6ed78601223254303995ec397b1b59ab33c29fe7 Mon Sep 17 00:00:00 2001 From: Pavel Afonine Date: Sat, 18 Jan 2025 10:00:33 -0800 Subject: [PATCH] Better sampling --- cctbx/maptbx/__init__.py | 61 ++++++++++++++++++++++++++++++++-------- 1 file changed, 49 insertions(+), 12 deletions(-) diff --git a/cctbx/maptbx/__init__.py b/cctbx/maptbx/__init__.py index df0e486bcc..547fa4ee18 100644 --- a/cctbx/maptbx/__init__.py +++ b/cctbx/maptbx/__init__.py @@ -2208,26 +2208,57 @@ def is_periodic(map_data, else: return None # Really do not know -def map_values_along_line_connecting_two_points(map_data, points_cart, step, - unit_cell, interpolation): +def map_values_along_line_connecting_two_points(map_data, points_cart, + unit_cell, interpolation, step=None, n_steps=None): """ Calculate interpolated map values along the line connecting two points in space. """ assert interpolation in ["eight_point", "tricubic"] + assert [step, n_steps].count(None)==1 points_frac = unit_cell.fractionalize(points_cart) dist = unit_cell.distance(points_frac[0], points_frac[1]) - assert step mv_max: + mv_max = mv + point_max = p[:] vals.append(mv) - alp += step - return group_args(dist = dist, vals = vals) + return group_args(dist = dist, vals = vals, point_max = point_max)