Hi Prateek,
Instead of using your "check" function and trying to set values one-by-one,
you can use numpy's fancy indexing to do the conditional setting of values
in your _norm function. I've modified your script to do what I think you
were trying to do here:
https://gist.github.com/ngoldbaum/b3ed70139faf6da89f37ae56cb965faf
This script produces this image: https://i.imgur.com/6Fgpf53.png
Hope that helps!
If there's something else that you were trying to do that your script
wasn't illustrating and my solution won't work for, please do write back
with additional details.
-Nathan
On Thu, Oct 31, 2019 at 4:05 AM Prateek Gupta
Dear Yt-users,
I need to pass the value of the available/derived field corresponds to the index selected based on some criterion (using numpy.where()) to a scalar function. It should list out the indexes wheres the condition satisfies. It happens when this has been done outside the field but instead of getting 3D indexes it gives 1D YT_Array indexes I think. But I need to pass this value of field corresponds to the selected index to scalar function inside the field, which may give some problem (please find the attachment to see what exactly I am trying to do).
The attached script can run on the ENZO test data set, enzo_tiny_cosmology.
Many thanks and regards -Prateek
_______________________________________________ yt-users mailing list -- yt-users@python.org To unsubscribe send an email to yt-users-leave@python.org