The bug that prevented you from plotting the 'dx' field has been fixed:<div><br></div><div><a href="https://bitbucket.org/yt_analysis/yt/pull-request/607/allow-plotting-of-excluded-fields/diff">https://bitbucket.org/yt_analysis/yt/pull-request/607/allow-plotting-of-excluded-fields/diff</a></div>
<div><br></div>Nathan<span></span><br><div><br>On Monday, September 23, 2013, Sam Skillman  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Cameron,<div>
<br></div><div>Just for completeness, Nathan and I were discussing in irc but I'll respond here my thoughts up until now. At least the first piece about dx is a bug:</div><div><br></div><div>

I think this comes from dx being an "excluded" field in a fixed resolution buffer, and when the SlicePlot goes to loop over all the data source fields, it gets explicitly ignored. Obviously this should not be the case if the user explicitly adds a slice of dx. This is a bug.  In yt/visualization/fixed_resolution.py you can see why dy works:<br>


</div><div>_exclude_fields = ['pz','dpz','dx','x','y','z']</div><div><br></div><div>For the rest of the issues, I think if you get rid of ValidateSpatial for everything that you have in the notebook, it runs fine. ValidateSpatial of more than 0 will mean you need to account for that and take the correct slices.  That said, in 2d I can't make sense of the shapes that come out of ValidateSpatial(1) for GridLevel. I don't know what is up with that.</div>


<div><br></div><div>I'll also just say that either:</div><div>sl.set_log(field, boolean) </div><div>or </div><div>pf.h; pf.field_info[field].take_log=False is easier than a derived field just to set the log.</div><div>


<br></div><div>One last thing -- I'm not sure why the following code has 2 returns in the universal_fields.py.<br></div><div><br></div><div><pre style="padding:0px;font-family:Monaco,Menlo,Consolas,'Courier New',monospace;font-size:13px;color:rgb(51,51,51);border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:4px;border-bottom-left-radius:4px;margin-top:0px;margin-bottom:0px;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre-wrap;background-color:rgb(245,245,245);border:none">

<span style="color:rgb(0,128,0);font-weight:bold">def</span> <span style="color:rgb(0,0,255)">_dy</span><span>(</span><span>field</span><span>,</span> <span>data</span><span>):</span>
    <span style="color:rgb(0,128,0);font-weight:bold">return</span> <span>data</span><span style="color:rgb(102,102,102)">.</span><span>dds</span><span>[</span><span style="color:rgb(102,102,102)">1</span><span>] <--- note the return here. The rest should probably be removed. Not sure why it is even there.</span>
    <span style="color:rgb(0,128,0);font-weight:bold">return</span> <span>np</span><span style="color:rgb(102,102,102)">.</span><span>ones</span><span>(</span><span>data</span><span style="color:rgb(102,102,102)">.</span><span>ActiveDimensions</span><span>,</span> <span>dtype</span><span style="color:rgb(102,102,102)">=</span><span style="color:rgb(186,33,33)">'float64'</span><span>)</span> <span style="color:rgb(102,102,102)">*</span> <span>data</span><span style="color:rgb(102,102,102)">.</span><span>dds</span><span>[</span><span style="color:rgb(102,102,102)">1</span><span>]</span>
<span>add_field</span><span>(</span><span style="color:rgb(186,33,33)">'dy_lin'</span><span>,</span> <span>function</span><span style="color:rgb(102,102,102)">=</span><span>_dy</span><span>,</span> <span>display_field</span><span style="color:rgb(102,102,102)">=</span><span style="color:rgb(0,128,0)">False</span><span>,</span>
          <span>validators</span><span style="color:rgb(102,102,102)">=</span><span>[</span><span>ValidateSpatial</span><span>(</span><span style="color:rgb(102,102,102)">0</span><span>)],</span> <span>take_log</span><span style="color:rgb(102,102,102)">=</span><span style="color:rgb(0,128,0)">False</span><span>)</span></pre>


<pre style="padding:0px;font-family:Monaco,Menlo,Consolas,'Courier New',monospace;font-size:13px;color:rgb(51,51,51);border-top-left-radius:4px;border-top-right-radius:4px;border-bottom-right-radius:4px;border-bottom-left-radius:4px;margin-top:0px;margin-bottom:0px;line-height:20px;word-break:break-all;word-wrap:break-word;white-space:pre-wrap;background-color:rgb(245,245,245);border:none">

<span><br></span></pre><div><br></div></div><div>Best,</div><div>Sam <br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">

On Mon, Sep 23, 2013 at 8:00 PM, Cameron Hummels <span dir="ltr"><<a href="javascript:_e({}, 'cvml', 'chummels@gmail.com');" target="_blank">chummels@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


<div dir="ltr"><div>Hello fellow yt'ers:</div><div><br></div><div>I'm having some issues with some fields that I don't think are behaving the way they should be in yt.  I'm encountering a number of problems with a simple 2D enzo dataset (x and y), so I put together a notebook demonstrating my various issues.  </div>




<div><br></div><a href="https://hub.yt-project.org/nb/727j2j" target="_blank">https://hub.yt-project.org/nb/727j2j</a><div><br></div><div>To summarize the weirdness from the notebook:</div><div><br></div><div>1) The 'dx' field doesn't seem to be able to be displayed (i.e. when I try to slice it), whereas the 'dy' field is fine.  'dz' even exists, but it's just uniformly 0, as is expected from a 2D dataset.</div>




<div><br></div><div>2) When I try to produce a new field which is 2^GridLevel, I get weird results (ignored levels and more).</div><div><br></div><div>3-5) I get strange behavior when trying to make a new field combining GridLevel and 'dy', since GridLevel  has twice as many indices as any of the spatial fields (in the z direction no less).  This results in some odd behavior when I try to pair various subsets of GridLevel with 'dy'.</div>




<div><br></div><div>Any clarification of these ideas is welcome.  The docs and source haven't yet revealed what is going on here.  Thanks!</div><span><font color="#888888"><div><br></div><div>Cameron<br clear="all">

<div><br></div>-- <br>Cameron Hummels<div>

Postdoctoral Researcher</div><div>Steward Observatory</div><div>University of Arizona</div><div><a href="http://chummels.org" target="_blank">http://chummels.org</a></div>
</div></font></span></div>
<br>_______________________________________________<br>
yt-users mailing list<br>
<a href="javascript:_e({}, 'cvml', 'yt-users@lists.spacepope.org');" target="_blank">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></blockquote></div><br></div>
</blockquote></div>