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