From 641a5284d6ab8759bfeed55a0431ea9d7c57f2a9 Mon Sep 17 00:00:00 2001 From: Jesse Sandberg Date: Tue, 19 Nov 2024 09:37:20 -0500 Subject: [PATCH] site now has a dtheta attribute that gets created by create_simple_site and accessed by outline_site --- python/DTA/site_distributions.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/DTA/site_distributions.py b/python/DTA/site_distributions.py index 42ebebe..5b0330b 100644 --- a/python/DTA/site_distributions.py +++ b/python/DTA/site_distributions.py @@ -31,6 +31,7 @@ class Site: expPunocc: float=0 theta_vals: list=None dr: float=0 + dth: float=0 def make_simple_site(the_data, inner_r=0, outer_r=0, nth=1, Ntheta=1, dr=1, dth=1, exrho=0, frames=1, the_thetas=None, title="", Npeak=None, accessible_area=None): """ @@ -74,6 +75,7 @@ def make_simple_site(the_data, inner_r=0, outer_r=0, nth=1, Ntheta=1, dr=1, dth= the_site.theta_vals = (the_thetas*dth)%(2*np.pi) the_site.dr = dr + the_site.dtheta = dth if Npeak is not None: the_site.Npeak = Npeak else: @@ -287,8 +289,7 @@ def outline_site(ax, site): - matplotlib.axes.Axes: The modified matplotlib axes object with the binding site outlined. """ - sorted_thetas = np.sort(site.theta_vals) - dtheta = sorted_thetas[1]-sorted_thetas[0] + dtheta = site.dtheta the_thetas = site.theta_vals-dtheta/2 the_thetas = np.append(the_thetas, the_thetas[-1]+dtheta) ax.fill_between(the_thetas, site.inner_r, site.outer_r, facecolor=(0,0,0,0), edgecolor='k')