[yt-users] Projection Question

david collins dcollins4096 at gmail.com
Tue Apr 9 09:48:36 PDT 2013


Hi--

To update, what Nathan suggested worked fine.  It seems that my old
references to PlotCollection were the culprit.

In answer to Matt's questions:
Left = na.array([0.0]*3)
Right = na.array([0.25]*3)
Center = 0.5*(Left+Right)

>>> reg.quantities["TotalQuantity"]("CellVolumeCode")
[0.015625]
>>> reg.quantities["Extrema"]("Density")
[(0.013392246073068692, 288.83114127717198)]

So the set itself is ok, and as I understand it PlotCollections are no
longer the best way to do what I want, so I'll expunge them from my scripts
in favor of plot windows.

Thanks a ton!
d.



On Mon, Apr 8, 2013 at 11:41 PM, Matthew Turk <matthewturk at gmail.com> wrote:

> Hi Dave,
>
> On Mon, Apr 8, 2013 at 6:07 PM, david collins <dcollins4096 at gmail.com>
> wrote:
> > Hi, Everybody!
> >
> > I have a probably dumb question.  I keep getting the following error when
> > projecting.  I get this from a variety of methods, but what I'm trying
> to do
> > is project a region.  What I used to do was something like this, but
> it's no
> > longer working (with or without the source.)
> >
> > reg = pf.h.region(center,left,right)
> > pf = load(thing)
> > pc = PlotCollection(pf)
> > proj =  pf.h.proj(0,'Density',center=Center) #,source=reg)
> > prooj = pc.add_projection('Density','x') #,data_source=reg)
>
> So we're on the same page, would you mind showing how you create
> center, left, right, and what their values are?  And would it also be
> possible to have you run:
>
> print reg.quantities["TotalQuantity"]("CellVolumeCode")
> print reg.quantities["Extrema"]("Density")
>
> Thanks,
>
> Matt
>
> >
> > So my question is: with the recent developments to yt, what's the best
> > mechanism to do this?
> > I'm on a self install that was done fresh pretty recently, the hash is
> > 34b95297062b
> >
> > Thanks,
> > d.
> >
> >
> >     prooj = pc.add_projection('Density','x',data_source=reg)
> >   File
> >
> "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/visualization/plot_collection.py",
> > line 786, in add_projection
> >     size=fig_size, periodic=periodic))
> >   File
> >
> "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/visualization/plot_types.py",
> > line 326, in __init__
> >     self.__init_temp_image(use_colorbar)
> >   File
> >
> "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/visualization/plot_types.py",
> > line 358, in __init_temp_image
> >     shrink=0.95)
> >   File
> >
> "/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/figure.py",
> > line 1387, in colorbar
> >     cb = cbar.colorbar_factory(cax, mappable, **kw)
> >   File
> >
> "/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/colorbar.py",
> > line 1173, in colorbar_factory
> >     cb = Colorbar(cax, mappable, **kwargs)
> >   File
> >
> "/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/colorbar.py",
> > line 854, in __init__
> >     ColorbarBase.__init__(self, ax, **kw)
> >   File
> >
> "/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/colorbar.py",
> > line 298, in __init__
> >     self.draw_all()
> >   File
> >
> "/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/colorbar.py",
> > line 323, in draw_all
> >     self._config_axes(X, Y)
> >   File
> >
> "/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/colorbar.py",
> > line 409, in _config_axes
> >     self.update_ticks()
> >   File
> >
> "/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/colorbar.py",
> > line 345, in update_ticks
> >     ticks, ticklabels, offset_string = self._ticker()
> >   File
> >
> "/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/colorbar.py",
> > line 560, in _ticker
> >     ticks = self._locate(b)
> >   File
> >
> "/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/colorbar.py",
> > line 808, in _locate
> >     z = np.take(y, i0) + (xn-np.take(b,i0))*dy/db
> >
> >
> > _______________________________________________
> > yt-users mailing list
> > yt-users at lists.spacepope.org
> > http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
> >
> _______________________________________________
> yt-users mailing list
> 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/20130409/443d6030/attachment.html>


More information about the yt-users mailing list