Skip to content

Commit

Permalink
Merge pull request #97 from BranniganLab/95-outline_site-cannot-calcu…
Browse files Browse the repository at this point in the history
…late-dtheta-when-the-site-is-one-bin-wide

site now has a dtheta attribute
  • Loading branch information
JahmalEnnis authored Dec 4, 2024
2 parents 90d735d + 725556b commit cb8128d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/DTA/site_distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class Site:
expPunocc: float=0
theta_vals: list=None
dr: float=0
dtheta: 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):
"""
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit cb8128d

Please sign in to comment.