-
Notifications
You must be signed in to change notification settings - Fork 280
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BUG: wrong pixelization for "r-normal" projections in spherical coordinates ? #3610
Comments
Here's another example that doesn't require It should be pretty clear here that the import numpy as np
import yt
shape = (72, 721, 1152)
prng = np.random.RandomState(0)
data = {("gas", "density"): prng.random_sample(shape)}
bbox = np.array([[1, 72], [0, 2.0*np.pi], [0, np.pi] ])
ds = yt.load_uniform_grid(
data,
shape,
1.0,
geometry=("spherical", ('r', 'theta', 'phi')),
bbox=bbox
)
p = yt.SlicePlot(ds, "r", "density")
p.save(f"/tmp/test.png") |
My example above is broken on the user side... import numpy as np
import yt
shape = (72, 721, 1152)
prng = np.random.RandomState(0)
data = {("gas", "density"): prng.random_sample(shape)}
bbox = np.array([[1, 72], [0, np.pi], [0, 2*np.pi]])
ds = yt.load_uniform_grid(
data,
shape,
1.0,
geometry=("spherical", ('r', 'theta', 'phi')),
bbox=bbox
)
p = yt.SlicePlot(ds, "r", "density")
p.save(f"/tmp/test1.png")
# transposition
bbox = np.array([[1, 72], [0, 2*np.pi], [0, np.pi]])
ds = yt.load_uniform_grid(
data,
shape,
1.0,
geometry=("spherical", ('r', 'phi', 'theta')),
bbox=bbox
)
p.save(f"/tmp/test2.png") both example produce this image which I think is incorrect ? I'd except x/y axes to be flipped, now let's try fix that. |
A few minor things -- before you get too far in, can you check what happens if you use the cartopy projections? |
I'd love to, how do I do that ? |
(I might be unable to actually, cartopy is notoriously hard to install outside of conda land) |
yet another way this is broken: import yt
ds = yt.load_sample("KeplerianDisk")
p = yt.SlicePlot(ds, "r", "density")
p.save(f"/tmp/disk_slice_r.png") likely a crucial difference with the previous example is that this data set has
while the previous one had
|
I think I'll need to adress #1796 thoroughly before I can fix this one |
Bug report
Bug summary
originally reported as #3529
Code for reproduction
Actual outcome
Expected outcome
Seemingly, working examples of this usage were documented in #1791
but it also looks like the important code here has really not changed much since then (except for formatting), and the PR included tests, so I'm surprised to see it failing now. I'll try to inspect this deeper later.
The text was updated successfully, but these errors were encountered: