-
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
Question: expected behavior of center argument in slices of spherical datasets? #4841
Comments
Related to #4362 This has been a problem for as long as spherical coordinates have been supported. To me, the issue is primarily that the API, which was originally designed for cartesian coordinates only, is ill suited for non-cartesian geometries; in particular, specifying a {center, width} combo is ambiguous in spherical geometries: does it result in a spherical selection (possibly off-center), or does it really just select a slab in the data cube1 ? what coordinates is I think we'd need a couple fundamental changes:
Footnotes
|
Thanks for the detailed thoughts, @neutrinoceros ! And searching back through issues and PRs, I see now that there's been a lot of related discussion and attempts circling around this problem (should have searched a bit more before posting my question...). In any case, it does seem like a bigger refactor is needed... I do have more thoughts on this, will try to come back later today or tomorrow to type them up! |
I wanted to mention two things -- the first is that I think we could absolutely explore a new method of designing these slices and whatnot. The second is that we should explore how we could revive the "IndexArray" type that @jzuhone worked on a few years ago in unyt. This would be a big change, and we may decide it's too much. But the idea there is twofold -- one is to make all of the arrays used for indexing read-only -- which could be a huge performance increase in some areas of the code that constantly do conversions or checks that arrays are in |
I was looking into a question on yt-users and got a bit confused myself so wanted to see if anyone has any thoughts. Here is a link to the original question, but the implicit question is a more general question about slices in spherical datasets: should the center argument have an effect?
Right now it seems that the
center
argument is only used to determine the value of the normal and is otherwise ignored:I naively expected the image center to be calculated by transforming the r and theta values provided to the image x-y coordinates (in this case that'd be (0.8, 0.0) in the 2nd and 3rd image above), but looking into the code it seems that the center is fixed to always be the domain center (I think the relevant section of code is in
_sanitize_center
). Is this a case of the behavior simply not being implemented yet or is there a different reason for always using the full domain center?The text was updated successfully, but these errors were encountered: