[yt-users] basic question
Elizabeth Tasker
elizabeth.tasker at gmail.com
Tue Nov 8 06:29:16 PST 2011
>>
>>
>> But basically, I can't create a function that I can plug into slice or projection without it running through the function a gazillion times?
>
> You definitely can for slices. If you define a derived field that is
> not ValidateSpatial, it will only be called once, on the slice. The
> flow looks like this: inside get_data, for every field requested (in
> this case a derived field), it checks to see if it can generate that
> field. If it can (i.e., it's not a grid-requiring or
> spatial-requiring field) it will do so. If the field exists in the
> grid already, it will not be regenerated.
>
> Unfortunately projections do require touching every grid.
>
Hmm, OK I shall go away and think about this. Perhaps I could calculate my data set just once and then write a routine that simply checks which values are set on each grid, rather than perform the actual calculation....
Thanks!
Elizabeth
More information about the yt-users
mailing list