[yt-users] Trouble with FixedResolutionBuffer

Matthew Turk matthewturk at gmail.com
Fri Sep 2 04:06:12 PDT 2011


Hi Nathan,

On Fri, Sep 2, 2011 at 3:08 AM, Nathan Goldbaum <goldbaum at ucolick.org> wrote:
> Hi all,
> I'm trying to use FixedResolutionBuffer to generate 2d projections following
> the example in the docs
> (http://yt-project.org/doc/analyzing/generating_processed_data.html)
> from yt.mods import *
> pf = load("DD0000/test_disk_0000")
> projden =
> pf.h.proj(0,'Density',data_source=pf.h.all_data(),center=[0.5,0.5,0.5])
> frb = FixedResolutionBuffer(projden,(0,0,1,1),(512,512))
> print frb['Density']
> ------> print(frb['Density'])
> yt : [INFO     ] 2011-09-02 00:03:10,273 Making a fixed resolution buffer of
> 512 by 512
> [[ nan  nan  nan ...,  nan  nan  nan]
>  [ nan  nan  nan ...,  nan  nan  nan]
>  [ nan  nan  nan ...,  nan  nan  nan]
>  ...,
>  [ nan  nan  nan ...,  nan  nan  nan]
>  [ nan  nan  nan ...,  nan  nan  nan]
>  [ nan  nan  nan ...,  nan  nan  nan]]
> Is there a problem with how I'm creating the buffer?

The bounds should be (pixelplane_x_min, pixelplane_x_max,
pixelplane_y_min, pixelplane_y_max) -- you've ordered them with both
mins, then both maxes.

> I'm pretty sure the
> way this is done in the docs on the page I linked is incorrect, since I get
> an error when I do when I try to say
> sl = pf.h.proj(0,0.5)

Yup, thanks -- that should be "slice" which will be fixed in the next
build of the docs, going up today.  Projections will implicitly use
the whole domain, so you can call:  pf.h.proj(0, "Density") if you
want a column density of the domain.

Best,

-Matt

> Thanks for your help,
> Nathan
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>



More information about the yt-users mailing list