Dear Stephanie
1) (ad["ones"].size) =(dense_ad["ones"].size).

2) ProjectionPlot of ad and dense_ad are the same. 

3) SlicePlot with ad gives a nice slice image, with dense_ad nothing. 

Thank you


2020年9月4日(金) 0:57 Stephanie Tonnesen <stonnes@gmail.com>:
Hi,

Not sure if this will be helpful, but a couple things stood out to me.  First, can you check that the dense_ad is actually selecting all the gas?  Since selecting with <0 is giving you no values, make sure that >=0 is giving you all your values.  You can do that by checking that 

print(ad["ones"].size) is the same value as print(dense_ad["ones"].size).

If that is the same, then make sure your ProjectionPlot of ad and dense_ad are the same.  

If we are still good, then I would redo the SlicePlot without the origin command, and perhaps fiddling a bit more with the center (just putting it in the center of your box, for example).  

And, actually, it shouldn't matter, but I would make the selection variable and the plotting variable exactly the same (either both lowercase or both uppercase).  


Best,
Stephanie

--
Dr. Stephanie Tonnesen
Associate Research Scientist
CCA, Flatiron Institute
New York, NY

stonnes@gmail.com


On Thu, Sep 3, 2020 at 10:34 AM Fujita, Akimi <fujitaa@shinshu-u.ac.jp> wrote:
no change even if cut through np.median(dense_ad["x"].in_units("code_length"))

2020年9月3日(木) 22:49 Matthew Turk <matthewturk@gmail.com>:
Hi Akimi,

I think I might have an idea why it's not working, which I probably should have thought of before.  Is it possible that the slice center specified does not pass through any of these cells?  What happens if you supply a center where the x value (the direction you're slicing along) is chosen as, say, np.median(dense_ad["x"].in_units("code_length")) ?

On Wed, Sep 2, 2020 at 11:17 PM Fujita, Akimi <fujitaa@shinshu-u.ac.jp> wrote:
Thank you for your quick response.
ad = ds.all_data()
dense_ad =ad.cut_region(['(obj["Density"].in_cgs()  >= 0)'])
print(dense_ad["ones"].size)

189404

dense_ad = ad.cut_region(["obj['Density'].in_cgs() < 0"])
print(dense_ad["ones"].size)

0

I hope this helps you to fix the problem. thank you. 
Akimi


2020年9月3日(木) 3:22 Matthew Turk <matthewturk@gmail.com>:
Hi,

This is indeed odd!  It's possible that the cut region is causing some oddness.  Can you try doing this, and telling us how it looks?

print(dense_ad["ones"].size)

The other thing to look at would be:

dense_ad = ad.cut_region(["obj['Density'] < 0"])
print(dense_ad["ones"].size)

Since that's the complement, we'd expect it to return something.

It's also possible, but I would defer to Britton Smith on this (since he did the cut region work), that the comparison being executed is ignoring units, and potentially silently failing.

On Wed, Sep 2, 2020 at 1:18 PM <fujitaa@shinshu-u.ac.jp> wrote:
Hello,
 data_source in SlicePlot does not work (data_source in ProjectionPlot works). Would you explain how to enable it or fix the problem?

ds= yt.load("../DD2000/jf2000")
ad = ds.all_data()
dense_ad = ad.cut_region(["obj['Density'] >= 0"])
p = yt.SlicePlot(ds, 'x',"density",center=[6.5536/2, 6.5536/2,(15.5/2+2.5)],origin=["lower", "center", "domain"]
                ,data_source=dense_ad )

I chose 0 so that it will pick up all the gas but it does not.

There is no error message. It just does not show anything much in the figure. How can I attach figures here?
_______________________________________________
yt-users mailing list -- yt-users@python.org
To unsubscribe send an email to yt-users-leave@python.org
https://mail.python.org/mailman3/lists/yt-users.python.org/
Member address: matthewturk@gmail.com
_______________________________________________
yt-users mailing list -- yt-users@python.org
To unsubscribe send an email to yt-users-leave@python.org
https://mail.python.org/mailman3/lists/yt-users.python.org/
Member address: fujitaa@shinshu-u.ac.jp
_______________________________________________
yt-users mailing list -- yt-users@python.org
To unsubscribe send an email to yt-users-leave@python.org
https://mail.python.org/mailman3/lists/yt-users.python.org/
Member address: matthewturk@gmail.com
_______________________________________________
yt-users mailing list -- yt-users@python.org
To unsubscribe send an email to yt-users-leave@python.org
https://mail.python.org/mailman3/lists/yt-users.python.org/
Member address: fujitaa@shinshu-u.ac.jp
_______________________________________________
yt-users mailing list -- yt-users@python.org
To unsubscribe send an email to yt-users-leave@python.org
https://mail.python.org/mailman3/lists/yt-users.python.org/
Member address: stonnes@gmail.com
_______________________________________________
yt-users mailing list -- yt-users@python.org
To unsubscribe send an email to yt-users-leave@python.org
https://mail.python.org/mailman3/lists/yt-users.python.org/
Member address: fujitaa@shinshu-u.ac.jp