Skip to content
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: skipped pixels in Aitoff-Hammer pixelization #3823

Closed
neutrinoceros opened this issue Feb 22, 2022 · 2 comments · Fixed by #3824
Closed

BUG: skipped pixels in Aitoff-Hammer pixelization #3823

neutrinoceros opened this issue Feb 22, 2022 · 2 comments · Fixed by #3824

Comments

@neutrinoceros
Copy link
Member

neutrinoceros commented Feb 22, 2022

Bug report

Bug summary

The pixelisation routine used for r-normal plots in spherical coordinates is slightly broken, and it seems that some pixels are sometimes skipped in the vicinity of the equator.

Code for reproduction

import numpy as np
import yt
from yt.units import g, cm

shape = (1, 33, 200)

data = {
    "density": np.ones(shape) * g / cm**3,
}

ds = yt.load_uniform_grid(
    data,
    shape,
    bbox=np.array([[0.1, 1], [0.7, np.pi - 0.7], [0, 2 * np.pi]]),
    geometry="spherical",
)

p = yt.SlicePlot(ds, "r", "density")

p.save("/tmp/res.png")

Actual outcome
res

In this example we get a series of "holes" in the image, all seemingly symmetrical with respect to the equator.
I note that this phenomenon is apparently very sensitive to the grid's resolution, I just selected the case for with I found the highest number of such artefacts, but I saw this happening at a smaller scale in production.

@neutrinoceros
Copy link
Member Author

neutrinoceros commented Feb 22, 2022

It quickly gets much worse as the resolution in colatitude is reduced.
this is with shape = (1, 9, 200)
res

and with shape = (1, 3, 200)
res

however it seems that this happens specifically if the number of cells in the colatitudinal direction is odd
, with shape = (1, 2, 200) it gets back to normal
res

@neutrinoceros
Copy link
Member Author

It's probably easier to reason about if we only consider very small resolutions
shape = (1, 3, 6)
res

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant