[yt-users] Another data structure question

Elizabeth Tasker tasker at astro1.sci.hokudai.ac.jp
Wed Nov 9 01:55:53 PST 2011


Hi,

Another question about yt data structures. 

If I have:

dd = pf.h.all_data()

Then dd["Density"] contains all the density values in all the cells on all the grids? Given that, how does the indexing work? For instance:

dd["Density"][100]

is a single value, so have the grids and cells been numbered such that each cell in the simulation has a unique index? And if that's true, then


dd["TotalEnergy"][100]

is guaranteed to be the same cell?  

Finally, if I know the grid number and cell index of a cell I want to mark (e.g. via Sam's neighbour finding routine: grids, cis = kd.locate_neighbors_from_position(position) ), then can I work out what its uniform index will be such that I can then do:

newfield = na.zeros(dd["x"].shape, dtype='float64')

newfield[index] = value-of-my-choice

?

Thank you!

Elizabeth


More information about the yt-users mailing list