Skip to content

Commit

Permalink
Updating debug plotter style
Browse files Browse the repository at this point in the history
  • Loading branch information
jmwood94-0 committed Jan 30, 2024
1 parent 1511f2c commit b1ddb16
Showing 1 changed file with 23 additions and 5 deletions.
28 changes: 23 additions & 5 deletions indica/models/charge_exchange.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,10 @@ def rotate(x, y, xo, yo, theta):
# Loop over channel
if debug:
from matplotlib import pyplot as plt
import matplotlib.cm as cm

cols = cm.gnuplot2(np.linspace(0.3, 0.75, len(self.los_transform.x1), dtype=float))

plt.figure()
ax1 = plt.axes()

Expand Down Expand Up @@ -477,12 +481,26 @@ def rotate(x, y, xo, yo, theta):
nh_along_chord_beamlet.append(nh_along_chord)

if debug:
ax1.plot(nh_along_chord.isel(energy=0)[0, :])

ax2.plot(los_x_rot.isel(channel=i_ch, beamlet=i_beamlet), los_y_rot.isel(channel=i_ch, beamlet=i_beamlet))
ax2.plot(los_x_rot.isel(channel=i_ch, beamlet=i_beamlet)[0], los_y_rot.isel(channel=i_ch, beamlet=i_beamlet)[0], 'ko')
ax1.plot(
nh_along_chord.isel(energy=0)[0, :],
c = cols[i],
)

ax3.plot(los_x.isel(channel=i_ch, beamlet=i_beamlet), los_y.isel(channel=i_ch, beamlet=i_beamlet))
ax2.plot(
los_x_rot.isel(channel=i_ch, beamlet=i_beamlet),
los_y_rot.isel(channel=i_ch, beamlet=i_beamlet),
c = cols[i],
)
ax2.plot(
los_x_rot.isel(channel=i_ch, beamlet=i_beamlet)[0],
los_y_rot.isel(channel=i_ch, beamlet=i_beamlet)[0],
'ko')

ax3.plot(
los_x.isel(channel=i_ch, beamlet=i_beamlet),
los_y.isel(channel=i_ch, beamlet=i_beamlet),
c=cols[i],
)

nh_along_chord_list.append(nh_along_chord_beamlet)

Expand Down

0 comments on commit b1ddb16

Please sign in to comment.