Skip to content

Commit 3644c54

Browse files
authored
Merge pull request #50 from roussel-ryan/dset-plot-aspect-ratio
dset plot aspect ratio
2 parents 93b0b55 + b0faa5a commit 3644c54

File tree

4 files changed

+45
-272
lines changed

4 files changed

+45
-272
lines changed

docs/examples/example_reconstruction_4d.ipynb

Lines changed: 21 additions & 139 deletions
Large diffs are not rendered by default.

docs/examples/example_reconstruction_6d.ipynb

Lines changed: 18 additions & 125 deletions
Large diffs are not rendered by default.

gpsr/datasets.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ def plot_data(
176176

177177
ax[i].set_title(f"{parameters[i]:.1f}")
178178
ax[i].set_xlabel("x (mm)")
179+
ax[i].set_aspect("equal")
179180

180181
ax[0].set_ylabel("y (mm)")
181182
ax[0].text(
@@ -377,6 +378,8 @@ def plot_data(
377378
ha="right",
378379
transform=ax[row_number, 0].transAxes,
379380
)
381+
382+
ax[row_number, i].set_aspect("equal")
380383
# fig.tight_layout()
381384
for ele in ax[-1]:
382385
ele.set_xlabel("x (mm)")

gpsr/modeling.py

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,13 +99,7 @@ def __init__(
9999
# Drift from Bend to YAG 2 (corrected for dipole on/off)
100100
l_d3 = l3 - l_bend / 2 / np.cos(theta_on)
101101

102-
q = Quadrupole(
103-
torch.tensor(l_quad),
104-
torch.tensor(0.0),
105-
name="SCAN_QUAD",
106-
num_steps=5,
107-
tracking_method="bmadx",
108-
)
102+
q = Quadrupole(torch.tensor(l_quad), torch.tensor(0.0), name="SCAN_QUAD")
109103
d1 = Drift(torch.tensor(l_d1))
110104

111105
tdc = TransverseDeflectingCavity(
@@ -125,9 +119,10 @@ def __init__(
125119
bend = Dipole(
126120
name="SCAN_DIPOLE",
127121
length=torch.tensor(l_arc).float(),
128-
angle=torch.tensor(0.0).float(),
122+
angle=torch.tensor(theta_on).float(),
129123
dipole_e1=torch.tensor(0.0).float(),
130124
dipole_e2=torch.tensor(theta_on).float(),
125+
tracking_method="bmadx",
131126
)
132127

133128
d3 = Drift(name="DIPOLE_TO_SCREEN", length=torch.tensor(l_d3).float())

0 commit comments

Comments
 (0)