-
Notifications
You must be signed in to change notification settings - Fork 279
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: migrate away from broken optional dependency (pyregion -> regions) #4235
Conversation
two notes: Turns out
Also, at least one of the notebooks that uses it in the docs is currently broken for a different reason:
This other problem is not my target here so if I can't find a solution I'll report it separately. |
I may have opened this much too soon. Migration guidelines do not even exist yet, but here's where to follow progress on it, eventually: astropy/regions#488 |
0ce9b4e
to
11d05cc
Compare
11d05cc
to
8898b13
Compare
With a little help from import yt
from yt.frontends.fits.misc import ds9_region
ds = yt.load("grs-50-cube.fits.gz")
region = 'galactic;box(+49:26:35.150,-0:30:04.410,1926.1927",1483.3701",0.0)'
box_reg = ds9_region(ds, region)
print(box_reg.quantities.extrema(("fits", "temperature")))
prj = yt.ProjectionPlot(
ds,
"z",
("fits", "temperature"),
origin="native",
data_source=box_reg,
weight_field=("index", "ones"),
) # "ones" weights each cell by 1
prj.set_zlim(("fits", "temperature"), 1.0e-2, 1.5)
prj.set_log(("fits", "temperature"), True)
prj.save("/tmp/") (maybe the plot shouldn't have so much empty space in it but that's a different story, I think) I will open this PR to review when I can verify that the docs build correctly |
Not sure if this should be backported to the 4.1.x branch since |
@neutrinoceros I think unless we get a bug report, we shouldn't at this point. |
fine by me ! |
@matthewturk do you want to push the button ? |
PR Summary
Should fix #4234