yt-project / yt

Main yt repository
http://yt-project.org
Other
468 stars 280 forks source link

RAMSES and volume rendering - fails to split grids #986

Closed yt-fido closed 7 years ago

yt-fido commented 9 years ago

Originally reported by: Benjamin Thompson (Bitbucket: cosmosquark, GitHub: cosmosquark)


Hello.

Using the example volume rendering code with ramses http://yt-project.org/doc/visualizing/volume_rendering.html

and the ramses output_00080 from the sample data http://yt-project.org/data/

from using this code

#!python

import yt
import numpy as np

ds = yt.load("output_00080/info_00080.txt")
plot = yt.ProjectionPlot(ds, "z", "temperature", weight_field="density")
plot.save()

print "starting volume rendering process"
# Choose a field
field = 'density'
# Do you want the log of the field?
use_log = True

# Find the bounds in log space of for your field
dd = ds.all_data()
mi, ma = dd.quantities.extrema(field)

if use_log:
    mi,ma = np.log10(mi), np.log10(ma)

# Instantiate the ColorTransferfunction.
tf = yt.ColorTransferFunction((mi, ma))

# Set up the camera parameters: center, looking direction, width, resolution
c = (ds.domain_right_edge + ds.domain_left_edge)/2.0
L = np.array([1.0, 1.0, 1.0])
W = ds.quan(0.3, 'unitary')
N = 256

# Create a camera object
cam = ds.camera(c, L, W, N, tf, fields = [field], log_fields = [use_log])

# Now let's add some isocontours, and take a snapshot, saving the image
# to a file.
tf.add_layers(10, 0.01, colormap = 'RdBu_r')
im = cam.snapshot('test_rendering.png')

returns lots of "failed to split grid errors" . This applies for every instance of volume rendering I have always tried to do with RAMSES. Mainly using the example dataset for ease of acces.

yt : [INFO ] 2015-02-13 15:05:51,136 Warning: no_ghost is currently True (default). This may lead to artifacts at grid boundaries.

Failed to split grids.

Failed to split grids.

Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids. Failed to split grids.

Ray casting100% |||||||||||||||||||||||||||||||||||||||||||||||| Time: 00:00:00

/usr/local/lib/python2.7/dist-packages/yt/units/yt_array.py:764: RuntimeWarning: divide by zero encountered in divide

return YTArray(super(YTArray, self).rdiv(lo))

/usr/local/lib/python2.7/dist-packages/yt/data_objects/image_array.py:229:

RuntimeWarning: invalid value encountered in multiply

np.multiply(self[:, :, :3], 1.0/cmax, out[:, :, :3])


yt-fido commented 8 years ago

Original comment by Nathan Goldbaum (Bitbucket: ngoldbaum, GitHub: ngoldbaum):


Duplicate of #1212.

yt-fido commented 8 years ago

Original comment by Nathan Goldbaum (Bitbucket: ngoldbaum, GitHub: ngoldbaum):


Moving to 3.4.

yt-fido commented 9 years ago

Original comment by Benjamin Thompson (Bitbucket: cosmosquark, GitHub: cosmosquark):


@MatthewTurk I have seen that you have been working on this recently .. and looking at some PR's it looks like you are close to resolving this issue? In your own time of course :)

yt-fido commented 9 years ago

Original comment by Matt Turk (Bitbucket: MatthewTurk, GitHub: MatthewTurk):


@gmontes it's on the short term radar to address this.

yt-fido commented 9 years ago

Original comment by gmontes (Bitbucket: gmontes, GitHub: gmontes):


Hello, I'm having the same issue. Did you find any solution to this?

yt-fido commented 9 years ago

Original comment by Benjamin Thompson (Bitbucket: cosmosquark, GitHub: cosmosquark):


Might be related. But also

trying to print this field in RAMSES ('gas', 'averaged_density')

returns

Traceback (most recent call last):

#!python

  File "print_info.py", line 11, in <module>
    print ad[field]
  File "/home/ben/.local/lib/python2.7/site-packages/yt-3.0.2-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py", line 240, in __getitem__
    self.get_data(f)
  File "/home/ben/.local/lib/python2.7/site-packages/yt-3.0.2-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py", line 673, in get_data
    self._generate_fields(fields_to_generate)
  File "/home/ben/.local/lib/python2.7/site-packages/yt-3.0.2-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py", line 693, in _generate_fields
    fd = self._generate_field(field)
  File "/home/ben/.local/lib/python2.7/site-packages/yt-3.0.2-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py", line 277, in _generate_field
    tr = self._generate_fluid_field(field)
  File "/home/ben/.local/lib/python2.7/site-packages/yt-3.0.2-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py", line 295, in _generate_fluid_field
    rv = self._generate_spatial_fluid(field, ngt_exception.ghost_zones)
  File "/home/ben/.local/lib/python2.7/site-packages/yt-3.0.2-py2.7-linux-x86_64.egg/yt/data_objects/data_containers.py", line 314, in _generate_spatial_fluid
    for i, chunk in enumerate(chunks):
  File "/home/ben/.local/lib/python2.7/site-packages/yt-3.0.2-py2.7-linux-x86_64.egg/yt/frontends/ramses/data_structures.py", line 449, in _chunk_spatial
    g = og.retrieve_ghost_zones(ngz, [], smoothed=True)
AttributeError: 'RAMSESDomainSubset' object has no attribute 'retrieve_ghost_zones'
yt-fido commented 9 years ago

Original comment by Benjamin Thompson (Bitbucket: cosmosquark, GitHub: cosmosquark):


the output of the volume rendering