-
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: fix FRB integration with CylindricalResolutionBuffer #4790
base: main
Are you sure you want to change the base?
BUG: fix FRB integration with CylindricalResolutionBuffer #4790
Conversation
I think I need to be reminded what "unitary" units mean |
7ee6a51
to
d772c64
Compare
@yt-fido test this please |
98299b7
to
292f278
Compare
292f278
to
e9d0b3e
Compare
Thanks @neutrinoceros , very much appreciate the work on this. The FRB's don't quite match what I'd expect. If I run the following code: import yt
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
ds = yt.load_sample("bw_polar_2d")
slc = yt.SlicePlot(ds, "z", ("gas", "density"))
frb = slc.data_source.to_frb(width=(4,"cm"),resolution=(512,512),center=(0,0))
minmax = lambda A : (np.nanmin(A).v[()],np.nanmax(A).v[()])
R = frb["r"].in_units("cm")
Theta = frb["theta"].in_units("")
X = R*np.cos(Theta)
Y = R*np.sin(Theta)
rho = frb["density"]
print("R:", minmax(R) )
print("Theta:", minmax(Theta) )
print("X:", minmax(X) )
print("Y:", minmax(Y) )
print("rho:", minmax(rho) )
slc.show()
plt.figure()
plt.imshow(rho)
plt.show()
plt.figure()
plt.hist( np.unique(Theta) )
plt.xlabel("Theta")
plt.ylabel("Counts")
plt.show() I get this output:
Whereas I'd expect |
thanks for pointing this out. I'll try to come back to see in a few days. In the meantime any additional feedback is most welcome. |
PR Summary
Fix #4789
This is a proof-of-concept level patch, I want to see how it performs against CI.
I'll need to write the missing bits in
_set_radius
and add an actual test.This is currently based atop #4784PR Checklist