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

Surface calculation with radius field produces zero-sized surfaces #1407

Closed
brittonsmith opened this issue May 19, 2017 · 1 comment
Closed
Labels
Milestone

Comments

@brittonsmith
Copy link
Member

I'm listing this as a separate issue from Issue #1406 because I think they are unrelated. To be honest, I cannot tell if this is a real issue or not.

Bug report

When making surfaces using the radius field, I find that the surfaces almost always have zero size even for rather large data containers. When constructing surfaces with other fields, like "density", "x", etc, this does not seem to be the case.

Code for reproduction

In this script, we make a sphere with size 0.5 and 0.4 using the IsolatedGalaxy dataset. Both spheres have about 3.6 million cells. The sphere
http://paste.yt-project.org/show/7153/

import yt

ds = yt.load("IsolatedGalaxy/galaxy0030/galaxy0030")

sp = ds.sphere(ds.domain_center, 0.5)
print ("sphere size:", sp["density"].size)
units = sp["radius"].units
surf = ds.surface(sp, "radius", sp.radius.to(units))
print ("surface size:", surf["density"].size)

sp = ds.sphere(ds.domain_center, 0.4)
print ("sphere size:", sp["density"].size)
units = sp["radius"].units
surf = ds.surface(sp, "radius", sp.radius.to(units))
print ("surface size:", surf["density"].size)
surf = ds.surface(sp, "radius", sp["radius"].max())
print ("surface size:", surf["density"].size)

Actual outcome

yt : [INFO     ] 2017-05-19 07:43:52,125 Parameters: current_time              = 0.0060000200028298
yt : [INFO     ] 2017-05-19 07:43:52,125 Parameters: domain_dimensions         = [32 32 32]
yt : [INFO     ] 2017-05-19 07:43:52,125 Parameters: domain_left_edge          = [ 0.  0.  0.]
yt : [INFO     ] 2017-05-19 07:43:52,126 Parameters: domain_right_edge         = [ 1.  1.  1.]
yt : [INFO     ] 2017-05-19 07:43:52,126 Parameters: cosmological_simulation   = 0.0
Parsing Hierarchy : 100%|████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 173/173 [00:00<00:00, 37610.25it/s]
yt : [INFO     ] 2017-05-19 07:43:52,145 Gathering a field list (this may take a moment.)
sphere size: 3628948
yt : [INFO     ] 2017-05-19 07:43:54,153 Extracting (sampling: ('gas', 'density'))
surface size: 917
sphere size: 3620292
yt : [INFO     ] 2017-05-19 07:44:00,449 Extracting (sampling: ('gas', 'density'))
surface size: 0
yt : [INFO     ] 2017-05-19 07:44:05,949 Extracting (sampling: ('gas', 'density'))
surface size: 0

Even when using the maximum value of the radius field, the surface is empty. This seems wrong, but that's all I can say.

@brittonsmith brittonsmith added this to the 4.0 milestone May 19, 2017
@brittonsmith
Copy link
Member Author

I think a better way to demonstrate this to set the surface value to be half of the radius, or some other value between the minimum and maximum. When I do that, I always get an empty surface.

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

No branches or pull requests

1 participant