[yt-users] add_gradient_field
John Regan
johnanthonyregan at gmail.com
Thu Feb 2 04:22:47 PST 2017
Hi All,
Just wondering why the snippet of code below fails:
ds = yt.load("......./galaxy0030/galaxy0030")
dd = ds.all_data()
grad_fields = ds.add_gradient_fields(("gas","gravitational_potential"))
#for i in sorted(ds.derived_field_list):
# print(i)
print dd["gravitational_potential_gradient_x"]
I see the gradient field (4 in total) have been added to the field list but
I can't access the field.
Error:
TypeError: only length-1 arrays can be converted to Python scalars
Cheers,
John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20170202/d383f587/attachment.htm>
More information about the yt-users
mailing list