<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, May 23, 2017 at 12:59 PM, Daniel William Murray <span dir="ltr"><<a href="mailto:dwmurray@uwm.edu" target="_blank">dwmurray@uwm.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">




<div dir="ltr">
<div id="gmail-m_-6254747684937749200divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:"Times New Roman",Times,serif" dir="ltr">
<p>Dear yt folks,</p>
<p><br>
</p>
<p>I am trying to visualize some RAMSES MHD simulation data. The simulation is for gravitationally collapsing gas looking at star formation. I'm looking to obtain projection and slice plots and then annotate the magnetic fields onto the resulting image.</p>
<p>I'm on Mac OS X 10.9.5</p>
<p>I'm using conda 4.3.18</p>
<p>My version of yt is: 3<span style="color:rgb(0,0,0)">.3.5-py27_0</span></p>
<p>and python 2.7.12</p>
<p><br>
</p>
<p><span style="font-size:12pt">All of what I believe is the relevant code:</span></p>
<p><span style="font-size:11pt"> <span style="font-family:"Times New Roman",Times,serif">pf = yt.load('output_00284/info_<wbr>00284.txt')</span></span></p>
<p></p>
<p style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-size:10pt"><span style="font-size:11pt;font-family:"Times New Roman",Times,serif"> </span><span style="font-size:11pt;font-family:"Times New Roman",Times,serif">sp = pf.h.sphere(part_center, (zoom_width + 0.5, "pc"))</span></span></p>
<p style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-family:"Times New Roman",Times,serif;font-size:11pt"> L = sp.quantities.angular_<wbr>momentum_vector()</span><br>
</p>
<p style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-size:10pt"><span style="font-size:11pt;font-family:"Times New Roman",Times,serif"> p = yt.OffAxisSlicePlot(pf, L, 'density', center=part_center, width =</span><span style="font-size:11pt;font-family:"Times New Roman",Times,serif">(zoom_width, </span><span style="font-size:11pt;font-family:"Times New Roman",Times,serif">"pc"))</span></span><br>
</p>
<p style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-family:"Times New Roman",Times,serif;font-size:11pt"> p.annotate_magnetic_field()</span><br>
</p>
<p style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
</p>
<p style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-size:11pt;font-family:"Times New Roman",Times,serif"> p.save('test.png')</span></p>
<p></p>
<br>
<p></p>
<p><span style="font-size:12pt">The error:</span></p>
<p><br>
</p>
<p></p>
<p style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
<span style="font-size:10pt">yt.utilities.exceptions.<wbr>YTPlotCallbackError: annotate_magnetic_field callback failed with the following error: Could not find field '('all', 'magnetic_field_x')' in info_00284.</span></p>
<br>
<p></p>
<p>If I load the field list for the data set, I can see that the B field data is there, but under 'ramses', not 'all'</p>
<p></p>
<p style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
 ('ramses', 'x-Bfield-left'),</p>
<p style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
 ('ramses', 'x-Bfield-right'),</p>
<p style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
 ('ramses', 'x-velocity'),</p>
<p style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
 ('ramses', 'y-Bfield-left'),</p>
<p style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
 ('ramses', 'y-Bfield-right'),</p>
<p style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
 ('ramses', 'y-velocity'),</p>
<p style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
 ('ramses', 'z-Bfield-left'),</p>
<p style="margin:0px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo">
 ('ramses', 'z-Bfield-right'),</p>
<br>
<p></p>
<p>Is there a way to pass these fields to annotate_magnetic_field? Or a manner in which I can have this information load in the field ('all', 'magnetic_field_')</p></div></div></blockquote><div><br></div><div>Hi Daniel,</div><div><br></div><div>You can't use annotate_magnetic_field for this (at least right now, there are some fixes we could make to the Ramses frontend to make this work, see below), since the "universal" yt field names for the magnetic field are not defined for your dataset. That said, annotate_magnetic_field is just a thin wrapper around annotate_quiver and annotate_cquiver (the former is for axis-aligned slices, the latter for off-axis slices). We can use that fact to make a workaround for your issue.</div><div><br></div><div>To get this to work you will first need to define the x and y components of the magnetic field in the plane of the off-axis slice. Next, once this field is defined, you will need to call plot.annotate_cquiver() (the version of the quiver callback that works with "cutting" planes, e.g. off-axis slices:</div><div><br></div><div>plot.annotate_cquiver('cutting_magx', 'cutting_magy')</div><div><br></div><div>You will need to define these two fields based on your x, y, and z B-field fields.</div><div><br></div><div>If these field names are "standard" field names for the magnetic field in Ramses simulations, then you could add these fields to the known_other_fields tuple defined on the RAMSESFieldInfo class. It's very likely we would accept this change if you made a pull request on github.</div><div><br></div><div>Hope that this clears things up,</div><div><br></div><div>Nathan</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div id="gmail-m_-6254747684937749200divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:"Times New Roman",Times,serif" dir="ltr">
<p><br>
</p>
<p>I should also note that I can create and save the plots with no issues, so long as I do not try to annotate the magnetic fields.</p>
<p><br>
</p>
<div id="gmail-m_-6254747684937749200Signature"><span style="color:rgb(0,0,0)"></span>
<div id="gmail-m_-6254747684937749200divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:"Times New Roman",Times,serif,EmojiFont,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<span style="color:rgb(0,0,0)"></span>
<div name="divtagdefaultwrapper" style="margin:0px"><span style="color:rgb(0,0,0)">Cheers,</span><br>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif"><font face="Times New Roman, Times, serif">Daniel Murray</font></div>
<div style="font-family:Calibri,Arial,Helvetica,sans-serif"><font face="Times New Roman, Times, serif">Graduate student at University of Wisconsin Milwaukee<br>
</font>
<div><br>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

<br>______________________________<wbr>_________________<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" rel="noreferrer" target="_blank">http://lists.spacepope.org/<wbr>listinfo.cgi/yt-users-<wbr>spacepope.org</a><br>
<br></blockquote></div><br></div></div>