Hi Nathan,<br><br>I would just like to add that once you get this working, a field like this seems like it would be useful to a number of people.  If you're up for it, I would encourage you to submit a yt script with just the definition of the field to the yt hub.  Perhaps we should even have a section devoted complex field definitions.<br>
<br>Britton<br><br><div class="gmail_quote">On Wed, Sep 7, 2011 at 3:55 AM, Matthew Turk <span dir="ltr"><<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Nathan,<br>
<div class="im"><br>
On Wed, Sep 7, 2011 at 3:30 AM, Nathan Goldbaum <<a href="mailto:goldbaum@ucolick.org">goldbaum@ucolick.org</a>> wrote:<br>
> Hi Andrew,<br>
> Thanks for the idea.  Unfortunately, that doesn't seem to be the problem.  I<br>
> just tried taking the absolute value of R cross V before taking the square<br>
> root and got the exact same results.<br>
<br>
</div>Your script actually did not work for me on a standard AMR dataset.<br>
The axes of the result of the cross product were transposed from what<br>
they should be; my script died on a grid of size (18, 16, 16) because<br>
the result of the cross product was (16, 16, 18) and the<br>
CylinderRadius variable was (18, 16, 16).  Naively applying a<br>
transpose (although I am not sure why I had to do this) and Andrew's<br>
suggestion of na.abs produced plots that looked vaguely correct.  I<br>
recognize this is perhaps not a satisfying answer, but I would<br>
encourage you to investigate how the axes in the na.cross function are<br>
modified and returned; I also noted that only specifying "axis=0"<br>
instead of "axisa=0" and "axisb=0" got me the same result.  I suspect<br>
that not specifying "axisc=0" is the cause of the problem.  Another<br>
note is that I end up with a singularity at the y=z line.<br>
<br>
If you end up wanting to do this *not* aligned with the axes, the<br>
off-axis projection method will probably be of some help.  It would be<br>
very nice if we had some kind of recipe or script for calculating<br>
Toomre Q; I have done it myself, but unfortunately the script I used<br>
to calculate it was not backed up and was wiped out in a colossal and<br>
deep-cutting hard drive failure at SDSC, and so I am unable to share<br>
it.<br>
<br>
Best,<br>
<br>
Matt<br>
<div><div></div><div class="h5"><br>
> -Nathan<br>
> On Sep 6, 2011, at 11:43 PM, Andrew Myers wrote:<br>
><br>
> Hi Nathan,<br>
><br>
> This is just a guess, but do you really mean to be taking the square root of<br>
> R cross V, at line 30? That quantity could potentially be negative,<br>
> depending on the sense in which the fluid is spinning.<br>
><br>
> -Andrew Myers<br>
><br>
><br>
> On Tue, Sep 6, 2011 at 5:54 PM, Nathan Goldbaum <<a href="mailto:goldbaum@ucolick.org">goldbaum@ucolick.org</a>><br>
> wrote:<br>
>><br>
>> Hello all,<br>
>> Right now I'm trying to generate maps of the Toomre Q in an isolated<br>
>> galaxy simulation.  To do so, I'm using yt to generate maps of the gas<br>
>> column density as well as density-weighted projections of the sound speed<br>
>> and orbital frequency, which I'm using as a proxy for the epicyclic<br>
>> frequency.<br>
>> Unfortunately, I'm having some trouble making projected maps of the<br>
>> orbital frequency.  I've defined two new derived fields, CylinderRadius and<br>
>> AngularVelocity (<a href="http://paste.yt-project.org/show/1784/" target="_blank">http://paste.yt-project.org/show/1784/</a>).<br>
>> When I try to project the AngularVelocity field, I get what looks like<br>
>> garbage: <a href="http://i.imgur.com/PkYhe.png" target="_blank">http://i.imgur.com/PkYhe.png</a><br>
>> However, slices work just fine: <a href="http://i.imgur.com/NnEbq.png" target="_blank">http://i.imgur.com/NnEbq.png</a><br>
>> I've written the derived fields in a coordinate-dependent way, since I'll<br>
>> always be doing projections down a fixed axis.  Is that where my problem<br>
>> lies?  My understanding of how yt does projections is too shallow to figure<br>
>> out exactly what's going wrong here, so I'm hoping the collective wisdom of<br>
>> the yt developers and user base can come to the rescue.<br>
>> Best regards,<br>
>> Nathan Goldbaum<br>
>> Graduate Student<br>
>> Astronomy & Astrophysics, UCSC<br>
>> <a href="mailto:goldbaum@ucolick.org">goldbaum@ucolick.org</a><br>
>> <a href="http://www.ucolick.org/%7Egoldbaum" target="_blank">http://www.ucolick.org/~goldbaum</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>
>><br>
><br>
> !DSPAM:10175,4e67128a9212068012397!<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>
><br>
><br>
> !DSPAM:10175,4e67128a9212068012397!<br>
><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>
><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>
</div></div></blockquote></div><br>