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

[WIP] Naive off-axis slice attempt for spherical-ish geometry #4752

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

matthewturk
Copy link
Member

This is an attempt at addressing #4750. It works alright for offsets in theta, which seem to just rotate, but I'm confusing myself when attempting to test it for having a new normal vector that is set at some declination.

I think I've also confused myself yet again about how the r, theta, phi coordinates work, as my test script is not producing the types of plots I'd expect. When slicing along the dimension that runs 0 .. pi, I'd expect to get a whole circle, and when slicing along 0 .. 2pi I'd expect half circle. But that's not what's happening.

Here's an example script:

import numpy as np
import yt, yt.testing

ds = yt.testing.fake_amr_ds(geometry = "spherical")

for i, phi_offset in enumerate(np.mgrid[ds.domain_left_edge[2]:ds.domain_right_edge[2]:100j]):
    s = ds.slice("theta", ds.domain_center[1], offset = [0.0, 0.0, phi_offset])
    s.to_pw("Density").save(f"frame_{i:04d}")
    print(i, phi_offset)

@matthewturk
Copy link
Member Author

There are lots of problems with this! I am rethinking it but it was absolutely helpful to sketch it out.

For starters, it's incorrect - an offset isn't that same as a new north vector. But I do see a path forward here.

@matthewturk
Copy link
Member Author

Moving to draft, and I think I've found the right math now and will revisit.

@matthewturk matthewturk marked this pull request as draft November 29, 2023 13:06
@matthewturk
Copy link
Member Author

This is going to stay WIP, but I've been poking at it a bit and will try to come back to it very soon.

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

Successfully merging this pull request may close these issues.

1 participant