[yt-users] getting all the data in a subgrid

Jean-Claude Passy jcpassy at gmail.com
Thu Mar 8 10:17:10 PST 2012


Thanks Britton, this is exactly what I needed.
Cheers,

JC

On 08/03/12 12:36, Britton Smith wrote:
> Hi JC,
>
> You can always reshape the 3D data array to a 1D array.  You can try 
> something like numpy.reshape.  Also, you should be able to just do 
> grid['Density'] without doing get_data.
>
> Britton
>
> On Thu, Mar 8, 2012 at 10:25 AM, Jean-Claude Passy <jcpassy at gmail.com 
> <mailto:jcpassy at gmail.com>> wrote:
>
>     Hi all,
>
>     As far as I understand, a:
>
>     ------------------------------------
>
>     region = pf.h.region(...)
>
>     density = region["Density"]
>
>     ------------------------------------
>
>
>     will return the density field without considering cells that have
>     subcells. How can I access ALL the data stored in the hdf5 file? I
>     have tried to use
>
>     ------------------------------------
>
>     grid = pf.h.grids[i]
>
>     rhogrid = grid.get_data("Density")
>
>     ------------------------------------
>
>
>     but I would like to get a 1D array.
>     Thanks for you help,
>
>     JC
>
>     _______________________________________________
>     yt-users mailing list
>     yt-users at lists.spacepope.org <mailto:yt-users at lists.spacepope.org>
>     http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20120308/9674c5d0/attachment.html>


More information about the yt-users mailing list