This failure is happening because the MeshSource only works with unstructured mesh data. It will not work with your RAMSES AMR data.

Your best bet for volume rendering RAMSES data is to first deposit the data onto a uniform resolution mesh, reaload that data using yt.load_uniform_grid, and volume render the reloaded dataset.

We currently do not support volume rendering RAMSES data. We realize this is something that a lot of users want but unfortunately do not have funded developer time right now for working on fixing that situation.

Apologies for the trouble, hopefully this makes more sense now.


On Mon, Jan 7, 2019 at 4:30 AM Vadlamani Samhitha <> wrote:
I'm trying to make a movie by depositing particles on to the mesh:

import yt

from yt.visualization.volume_rendering.api import MeshSource

from yt.units import Myr

import yt.visualization.eps_writer as eps

from yt.data_objects.particle_filters import add_particle_filter

import pylab as plt


def star_filter(pfilter,data):

        age = data["all", "particle_age"]

        filter = age.in_units('Myr') > 0

        return filter

add_particle_filter("new_stars", function=star_filter, filtered_type="all", requires=["particle_age"])



CMAP = 'hot'

VMIN = 1e3

VMAX = 1e10

for x in range(ini, fin):

        filename="/lunarc/nobackup/users/samvad/FINAL-50-0.5/output/output_%0*d/info_%0*d.txt"  % (5,x,5,x)


        time = ds.current_time


        ms =MeshSource(ds, ('deposit', 'new_stars_density'))


        camera_position = ds.arr([0, 0, 0], 'code_length')

        cam.focus = ds.domain_center

        north_vector = ds.arr([0, 0, 0], 'dimensionless')

        cam.width = ds.arr([ 400400400], 'kpc')

        cam.resolution = (800, 800)

        cam.set_position(camera_position, north_vector)

        # actually make the image here

        im = ms.render(cam, cmap=CMAP, color_bounds=(VMIN, VMAX))


        fig = plt.gcf()

        ax = plt.gca()

        ax.imshow(im, interpolation='nearest', origin='lower')

        p = ax.imshow(, visible=False, cmap=CMAP, vmin=VMIN, vmax=VMAX)

        cb = fig.colorbar(p)


        ax.text(25, 750, 'time = %.2e' % time, color='k')

        plt.savefig('movie_frames/test_%.3d' % x)

But ending up with error:

Traceback (most recent call last):

  File "", line 32, in <module>

    ms =MeshSource(ds, ('deposit', 'new_stars_density'))

  File "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/volume_rendering/", line 536, in __init__


  File "/home/samvad/yt-conda/lib/python3.6/site-packages/yt/visualization/volume_rendering/", line 593, in build_volume_embree

    mesh_id = int(ftype[-1]) - 1

ValueError: invalid literal for int() with base 10: 't'

Any leads on this are highly appreciated.  
yt-users mailing list --
To unsubscribe send an email to