Skip to content

Commit

Permalink
Update geometry module to take into account when start measurement is…
Browse files Browse the repository at this point in the history
… not at r=0
  • Loading branch information
Cyril Gadal committed Oct 3, 2023
1 parent fa232f0 commit cf71069
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/plot_sketch_multiple_probes.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from pyudv.geometry import Probe, sketch_probes

# ## define probes
r = np.linspace(0, 5, 100) # beam radial coordiantes, same for all probes
r = np.linspace(1, 5, 100) # beam radial coordiantes, same for all probes
alpha1, alpha2, alpha3, alpha4 = -120, -70, 70, -80 # probe inclinations in degree
# probe origin points
O1, O2, O3, O4 = (
Expand Down
15 changes: 11 additions & 4 deletions pyudv/geometry.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,18 @@ def plot_probe(self, ax: mplaxes.Axes, color: str = None):
color : str, optional
probe color, by default None
"""
ax.scatter(self.O[0], self.O[1], color=color)
a = ax.scatter(self.O[0], self.O[1], color=color)
# plot unused beam part
(a, ) = ax.plot([self.O[0], self.x[0]], [self.O[1], self.z[0]],
color=a.get_facecolor(),
ls="--",
lw=1,
alpha=0.3)
# plot used beam part
(a, ) = ax.plot(
[self.O[0], self.E[0]],
[self.O[1], self.E[1]],
color=color,
[self.x[0], self.E[0]],
[self.z[0], self.E[1]],
color=a.get_color(),
ls="--",
lw=1,
)
Expand Down

0 comments on commit cf71069

Please sign in to comment.