Hi Camryn,

Hmm, this is an odd one.  I believe that it should be possible to do this for FLASH data, but that it hasn't makes me nervous -- I suspect but am not totally sure that the reason it's not implemented is because we don't want to run the risk of *not* getting results in some cells.

Your best bet might be to do your own derived field that looks just like the nearest neighbor one in yt/fields/particle_fields.py , but instead of feeding in the grid's particles, feed in the particles from an externally defined all_data() object.

On Mon, Jul 27, 2020 at 2:18 PM <clp3ef@virginia.edu> wrote:
Hi! I'm working with a FLASH dataset and am trying to use the add_nearest_neighbor_field() function as briefly described here https://yt-project.org/doc/analyzing/fields.html#computing-the-nth-nearest-neighbor. However, when I run the short script (with the input data replaced with my own FLASH dataset), I get the errors yt.fields.field_exceptions.NeedsGridType: (0, None) and NotImplementedError. Is this function not available for FLASH datasets, and is there a workaround? My final goal is to create a smoothed particle field, so if there is a better way than using the nearest_neighbor_distance_64 field in place of a smoothing_length field, please let me know!

Input data:
plt file -  http://use.yt/upload/a94cdffd
part file -  http://use.yt/upload/dec62ce5

Test Script: http://paste.yt-project.org/show/259/

Camryn
_______________________________________________
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