Ok, I'm in for this.  Let's try meeting on Friday on IRC for some TCB.<br><br>Britton<br><br><div class="gmail_quote">On Wed, Feb 29, 2012 at 4:22 PM, 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">Thanks, John!<br>
<br>
And Britton & John ZH, I'd be up for working on this tomorrow or<br>
Friday.  Here's the paper with the one-pass stddev.<br>
<br>
<a href="http://www.cs.berkeley.edu/%7Emhoemmen/cs194/Tutorials/variance.pdf" target="_blank">http://www.cs.berkeley.edu/~mhoemmen/cs194/Tutorials/variance.pdf</a><br>
<br>
(Formula 5)<br>
<br>
Meet up in IRC sometime soon, and try to knock it out?  I think it<br>
would be best if we just always calculated this and stick it in the<br>
profile.  We can calculate it along with the weight.<br>
<br>
-Matt<br>
<div class="HOEnZb"><div class="h5"><br>
On Wed, Feb 29, 2012 at 4:16 PM, John Wise <<a href="mailto:jwise@physics.gatech.edu">jwise@physics.gatech.edu</a>> wrote:<br>
> Hi all,<br>
><br>
> I did something like this a couple of weeks ago, where I did something<br>
> similar to Matt's description.  I ripped the relevant part of my script and<br>
> posted it here.<br>
><br>
> <a href="http://paste.yt-project.org/show/2201/" target="_blank">http://paste.yt-project.org/show/2201/</a><br>
><br>
> John<br>
><br>
><br>
> On 02/29/2012 04:14 PM, Matthew Turk wrote:<br>
>><br>
>> Yes, adding a direct stddev would be nice (and would not be too much<br>
>> overhead) but I think this can be done in two passes.<br>
>><br>
>> Pass one: calculate the average value.  This would be a standard profile.<br>
>> Pass two: set_field_parameter of the average value as a function of<br>
>> whatever.  Inside your new derived field, calculate the delta between<br>
>> the average and the actual field value.  Take average of this new<br>
>> derived field.<br>
>><br>
>> It's probably a better idea to just add stddev directly.  There is an<br>
>> extant algorithm for doing a one-pass stddev that is robust against<br>
>> round-off errors; I would be happy to help someone out to add that to<br>
>> the code.<br>
>><br>
>> -Matt<br>
>><br>
>> On Wed, Feb 29, 2012 at 4:11 PM, John ZuHone<br>
>> <<a href="mailto:jzuhone@head.cfa.harvard.edu">jzuhone@head.cfa.harvard.edu</a>>  wrote:<br>
>>><br>
>>> I do not believe this can be done with the current code. It's something<br>
>>> I'd like to see, however.<br>
>>><br>
>>> I would be willing to code this up, but it will probably be weeks before<br>
>>> I<br>
>>> have time.<br>
>>><br>
>>> John Z<br>
>>><br>
>>> On Wed, 29 Feb 2012, Britton Smith wrote:<br>
>>><br>
>>>> I think what Junhwan is asking is whether it's possible to do a profile<br>
>>>> of<br>
>>>> velocity dispersion.  If I understand correctly, the problem is that<br>
>>>> this<br>
>>>> would require, for every spherical shell in a radial profile, the<br>
>>>> calculation of the standard deviation of the VelocityMagnitude field.<br>
>>>>  I'm<br>
>>>> not sure if this is possible within the existing profile framework.  Can<br>
>>>> anyone else comment on this?<br>
>>>><br>
>>>> On Wed, Feb 29, 2012 at 2:25 PM, Nathan<br>
>>>> Goldbaum<<a href="mailto:goldbaum@ucolick.org">goldbaum@ucolick.org</a>>wrote:<br>
>>>><br>
>>>>> Hi Junhwan,<br>
>>>>><br>
>>>>> Can you paste a script and a traceback that shows the error you're<br>
>>>>> seeing?<br>
>>>>>  You should be able to pass the BulkVelocity to the derived field via<br>
>>>>> set_field_parameters.<br>
>>>>><br>
>>>>> You can paste a script from the command line with the following<br>
>>>>> command:<br>
>>>>><br>
>>>>> yt pastebin name_of_script.py<br>
>>>>><br>
>>>>> Nathan Goldbaum<br>
>>>>> Graduate Student<br>
>>>>> Astronomy&  Astrophysics, UCSC<br>
>>>>><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>
>>>>> On Feb 29, 2012, at 8:31 AM, Jun-Hwan Choi wrote:<br>
>>>>><br>
>>>>> Hi YT users,<br>
>>>>><br>
>>>>> I would like to make a (spherical and/or cylindrical) profile of the<br>
>>>>> velocity dispersion.<br>
>>>>> In order to do so, I need to compute the mean velocity (BulkVelocity)<br>
>>>>> for<br>
>>>>> a given shell (or ring), and pass this value to newly defined velocity<br>
>>>>> dispersion field, and then make a profile for the velocity dispersion<br>
>>>>> field.<br>
>>>>> Is there a particular way in yt to handle this?<br>
>>>>><br>
>>>>> Junhwan<br>
>>>>><br>
>>>>> P.S.: A few weeks ago I posted a similar question and Matt gave me a<br>
>>>>> following hint.<br>
>>>>> @derived_field(name = "deltaLocalCircularVelocity")<br>
>>>>> def delta_LocalCircularVelocity(fi<br>
>>>>> eld, data):<br>
>>>>>  fn, x, cv = data.get_field_parameter("local_circular_velocity")<br>
>>>>>  cv0 = na.interp(data[fn].ravel(), x, cv)<br>
>>>>>  cv0 = cv0.reshape(data[fn].shape)<br>
>>>>>  delta_cv = cv0 - data["LocalCircularVelocity"]<br>
>>>>>  return delta_cv<br>
>>>>><br>
>>>>> You'll need to do something like this on the data object from which<br>
>>>>> you are getting your data:<br>
>>>>><br>
>>>>>  sp.set_field_parameter("local_circular_velocity",<br>
>>>>>      (fn, prof[fn], prof["LocalCircularVelocity"]))<br>
>>>>><br>
>>>>> However, it does not work for me and it is also complicate to<br>
>>>>> understand<br>
>>>>> and modify it.<br>
>>>>><br>
>>>>><br>
>>>>><br>
>>>>> --<br>
>>>>> --------------------------------------------------------------<br>
>>>>> Jun-Hwan Choi, Ph.D.<br>
>>>>> Department of Physics and Astronomy, University of Kentucky<br>
>>>>> Tel: <a href="tel:%28859%29%20897-6737" value="+18598976737">(859) 897-6737</a>        Fax: <a href="tel:%28859%29%20323-2846" value="+18593232846">(859) 323-2846</a><br>
>>>>> Email: <a href="mailto:jhchoi@pa.uky.edu">jhchoi@pa.uky.edu</a>   URL: <a href="http://www.pa.uky.edu/%7Ejhchoi" target="_blank">http://www.pa.uky.edu/~jhchoi</a><br>
>>>>> --------------------------------------------------------------<br>
>>>>><br>
>>>>><br>
>>>>> !DSPAM:10175,4f4e76d329502195409319!<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,4f4e76d329502195409319!<br>
>>>>><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>
>>> _______________________________________________<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>
><br>
><br>
> --<br>
> John Wise<br>
> Assistant Professor of Physics<br>
> Center for Relativistic Astrophysics, Georgia Tech<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>
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>