<html><head><meta http-equiv="Content-Type" content="text/html charset=iso-8859-1"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>In analogy to the to_pw() function, there is also to_frb(), which will return a FixedResolutionBuffer object that you can use to take a direct look at the data: <a href="http://paste.yt-project.org/show/3349/">http://paste.yt-project.org/show/3349/</a></div><div><br></div><div>Note this uses the enzo IsolatedGalaxy test dataset available on <a href="http://yt-project.org/data">yt-project.org/data</a>.  On my machine the output from this script looks like this: <a href="http://paste.yt-project.org/show/3347/">http://paste.yt-project.org/show/3347/</a></div><div><br></div><div>Hope that's useful and that you're able to figure out what's going wrong.</div><div><br></div><div>-Nathan</div><div><br></div><div><br></div><div><div>On Apr 8, 2013, at 7:28 PM, david collins <<a href="mailto:dcollins4096@gmail.com">dcollins4096@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
It looks like the plot is crashing because of some issue with the color bar - something like all the values in the plot being zero, causing the logarithmic color bar to crash.  I'd need to know more about the dataset you're trying to plot to be able to figure out the exact issue.<br>


<br></blockquote><div><br></div><div style="">Yeah, it looks like what happens when I have a bad dataset, like Density = 0 everywhere.  However, I've plotted (and published) this dataset many times, so unless it's been corrupted on disk the set itself is ok.  To check that I did </div>

<div style="">for grid in pf.h.grids:</div><div style=""> print grid['Density'].min(), grid['Density'].max()</div><div style=""><br></div><div style="">and it didn't barf-- I'll double check those values, though.</div>

<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I think a more modern script would look like this:<br>
<br></blockquote><div><br></div><div style="">Thanks a ton for the update.  I'll try this, and ensure the data isn't borked.</div><div style=""><br></div><div style="">Thanks a ton!</div><div style="">d.</div><div> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex; position: static; z-index: auto; ">


pf = load(thing)<br>
reg = pf.h.region(center,left,right)<br>
proj =  pf.h.proj(0,'Density',center=Center, source=reg)<br>
prooj = proj.to_pw()<br>
prooj.save()<br>
<br>
This leverages the to_pw() function, which is defined for projection, slice, and off-axis slice data objects.  The function returns a plot window plot that uses the user-defined data object to select data.  By default plot window plots use a region that covers the whole dataset to select data.<br>


<br>
-Nathan<br>
<div><div class="h5"><br>
On Apr 8, 2013, at 4:07 PM, david collins <<a href="mailto:dcollins4096@gmail.com">dcollins4096@gmail.com</a>> wrote:<br>
<br>
> Hi, Everybody!<br>
><br>
> 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.)<br>


><br>
> reg = pf.h.region(center,left,right)<br>
> pf = load(thing)<br>
> pc = PlotCollection(pf)<br>
> proj =  pf.h.proj(0,'Density',center=Center) #,source=reg)<br>
> prooj = pc.add_projection('Density','x') #,data_source=reg)<br>
><br>
> So my question is: with the recent developments to yt, what's the best mechanism to do this?<br>
> I'm on a self install that was done fresh pretty recently, the hash is 34b95297062b<br>
><br>
> Thanks,<br>
> d.<br>
><br>
><br>
>     prooj = pc.add_projection('Density','x',data_source=reg)<br>
>   File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/visualization/plot_collection.py", line 786, in add_projection<br>
>     size=fig_size, periodic=periodic))<br>
>   File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/visualization/plot_types.py", line 326, in __init__<br>
>     self.__init_temp_image(use_colorbar)<br>
>   File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/visualization/plot_types.py", line 358, in __init_temp_image<br>
>     shrink=0.95)<br>
>   File "/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/figure.py", line 1387, in colorbar<br>
>     cb = cbar.colorbar_factory(cax, mappable, **kw)<br>
>   File "/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/colorbar.py", line 1173, in colorbar_factory<br>
>     cb = Colorbar(cax, mappable, **kwargs)<br>
>   File "/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/colorbar.py", line 854, in __init__<br>
>     ColorbarBase.__init__(self, ax, **kw)<br>
>   File "/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/colorbar.py", line 298, in __init__<br>
>     self.draw_all()<br>
>   File "/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/colorbar.py", line 323, in draw_all<br>
>     self._config_axes(X, Y)<br>
>   File "/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/colorbar.py", line 409, in _config_axes<br>
>     self.update_ticks()<br>
>   File "/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/colorbar.py", line 345, in update_ticks<br>
>     ticks, ticklabels, offset_string = self._ticker()<br>
>   File "/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/colorbar.py", line 560, in _ticker<br>
>     ticks = self._locate(b)<br>
>   File "/nics/b/home/collins/local_2013_03_12/lib/python2.7/site-packages/matplotlib/colorbar.py", line 808, in _locate<br>
>     z = np.take(y, i0) + (xn-np.take(b,i0))*dy/db<br>
><br>
</div></div>> _______________________________________________<br>
> yt-users mailing list<br>
> <a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br>
_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
</blockquote></div><br></div></div>
_______________________________________________<br>yt-users mailing list<br><a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org<br></blockquote></div><br></body></html>