You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copied from #5059
OK - I've actually uncovered a funny one.
importnumpyasnpimportytimportmatplotlib.pyplotaspltds=yt.load("output_00080")
p1=yt.ProjectionPlot(
ds,
"x",
("gas", "density"),
center=[0.5] *3,
width=.8,
#weight_field=("gas", "density"),
)
p2=yt.OffAxisProjectionPlot(
ds,
[1, 0, 0],
("gas", "density"),
center=[0.5] *3,
width=.8,
#weight_field=("gas", "density"),
)
# Note: due to our implementation, the off-axis projection will have a# slightly blurred cell edges so we can't do an exact comparisonv1, v2=p1.frb["gas", "density"], p2.frb["gas", "density"]
fig=plt.figure()
plt.imshow(v1, origin="lower", norm=plt.matplotlib.colors.LogNorm())
plt.colorbar()
fig.savefig("/tmp/1.png")
fig=plt.figure()
plt.imshow(v2, origin="lower", norm=plt.matplotlib.colors.LogNorm())
plt.colorbar()
fig.savefig("/tmp/2.png")
fig=plt.figure()
plt.imshow(v1/v2, origin="lower")
plt.colorbar()
fig.savefig("/tmp/3.png")
print(np.median(v1/v2), np.mean(v1/v2), np.std(v1/v2))
This returns:
Projection
Off-axis projection
Difference
The funny thing is that the ratio between the on-axis and the off-axis projection is equal (within some uncertainties) to plot_width * 0.5675 (above, plot_width = 0.8). This is the case for a RAMSES dataset (here), but the same can be obtained using fake_random_ds instead, yielding the same value.
As much as I see how I could have missed a plot_width factor, what the heck is 0.5675?
Expected outcome
Both the projection and off-axis projection should be the same map (up to small differences).
This bug was most likely introduced in #4741.
Version Information
yt version: 4.4 and above
The text was updated successfully, but these errors were encountered:
Bug report
Bug summary
Copied from #5059
OK - I've actually uncovered a funny one.
This returns:
The funny thing is that the ratio between the on-axis and the off-axis projection is equal (within some uncertainties) to
plot_width * 0.5675
(above,plot_width = 0.8
). This is the case for a RAMSES dataset (here), but the same can be obtained usingfake_random_ds
instead, yielding the same value.As much as I see how I could have missed a
plot_width
factor, what the heck is0.5675
?Expected outcome
Both the projection and off-axis projection should be the same map (up to small differences).
This bug was most likely introduced in #4741.
Version Information
The text was updated successfully, but these errors were encountered: