I wouldn't mind working on this with you.  We might be able to do this with teamwork.<br><br><div class="gmail_quote">On Wed, Feb 29, 2012 at 4:14 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">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>
<div class="HOEnZb"><div class="h5"><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>
> 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 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 of<br>
>> velocity dispersion.  If I understand correctly, the problem is that this<br>
>> would require, for every spherical shell in a radial profile, the<br>
>> calculation of the standard deviation of the VelocityMagnitude field.  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 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 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 command:<br>
>> ><br>
>> > yt pastebin name_of_script.py<br>
>> ><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>
>> > 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) 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 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 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>
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>