Hi Desika,

Looking over the code, if you have a *particle* quantity, you should be able to add a *smoothed* quantity using this type of construction:

from yt.fields.particle_fields import add_volume_weighted_smoothed field

The API for this function is:

def add_volume_weighted_smoothed_field(ptype, coord_name, mass_name,
        smoothing_length_name, density_name, smoothed_field, registry,
        nneighbors = None)

so you should be able to supply particle type, "particle_position", "particle_mass", "smoothing_length", the density name ("density" probably), the name of the field to smooth, and then the ds.field_info.  I believe this should do it, and it may require another step but I don't think so.

-Matt

On Mon Nov 10 2014 at 8:22:08 AM Desika Narayanan <dnarayan@haverford.edu> wrote:

Hey All,

I'm trying to figure out how to add a new smoothed field to a data set.  Specifically, I want to add a (particle) field, and then be able to access the smoothed mesh quantities (the same way I would access the mesh quantities of density as below, for example)

ad = ds.all_data()

ad["deposit","PartType0_smoothed_desnsity"]

(in this case PartType0 is gas).   I'm adding a field prior to loading the data set as described here:

http://yt-project.org/doc/developing/creating_derived_fields.html#defining-a-new-field

thanks,

desika


_______________________________________________
yt-users mailing list
yt-users@lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org