Hi Matt,<br>Many thanks for response!<br>I will try to compute SAG  as you suggested and let you guys know.<br>Cheers<br>Latif<br><div class="gmail_quote">On Thu, Jul 12, 2012 at 6:27 PM, Matthew Turk <span dir="ltr"><<a href="mailto:matthewturk@gmail.com" target="_blank">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 Latif,<br>
<br>
These fields should be removed -- they are difficult to get working<br>
correctly, because they are vectors.<br>
<br>
What you can do is get:<br>
<br>
SpecificAngularMomentumX<br>
SpecificAngularMomentumY<br>
SpecificAngularMomentumZ<br>
<br>
for each individually, and then you can combine them yourself.<br>
Unfortunately because there are a number of ways to evaluate the<br>
"total" L in a cell, this is not terribly easy to do from<br>
add_profile_sphere.  I would recommend using BinnedProfile1D by hand,<br>
and then constructing a final result from that after you have weighted<br>
(or not weighted) specifically how you would like them to be combined.<br>
<br>
Hope that helps -- feel free to write back if you would like more<br>
info.  This would be a great addition to the cookbook, if you end up<br>
with something you like and that works for you!<br>
<br>
-Matt<br>
<div><div><br>
On Thu, Jul 12, 2012 at 9:25 AM, Latif <<a href="mailto:latifne@gmail.com" target="_blank">latifne@gmail.com</a>> wrote:<br>
> Hi all,<br>
><br>
> I am trying to compute specific angular momentum using YT. I am getting the<br>
> following error. It is already in derived fields list but does not work. Am<br>
> i doing some thing wrong here? Any ideas what is going wrong here?<br>
> Thanks in advance!<br>
> Cheers<br>
> Latif<br>
><br>
> pc.add_profile_sphere(150, "kpc",<br>
>                       ["Radiuspc", "SpecificAngularMomentum"],<br>
> weight="CellMassMsun", accumulation=False,<br>
>                       x_bins=64, x_log=True, x_bounds=None,lazy_reader=True,<br>
>                       id=None, figure=None, axes=None) # x, y, weight<br>
><br>
>   id=None, figure=None, axes=None) # x, y, weight<br>
>   File<br>
> "/home/astro73/mlatif/YT/yt-x86_64/src/yt-hg/yt/visualization/plot_collection.py",<br>
> line 1033, in add_profile_sphere<br>
>     figure=figure, axes=axes)<br>
>   File<br>
> "/home/astro73/mlatif/YT/yt-x86_64/src/yt-hg/yt/visualization/plot_collection.py",<br>
> line 943, in add_profile_object<br>
>     profile.add_fields(fields[1], weight=weight, accumulation=accumulation)<br>
>   File<br>
> "/home/astro73/mlatif/YT/yt-x86_64/src/yt-hg/yt/data_objects/profiles.py",<br>
> line 147, in add_fields<br>
>     self._lazy_add_fields(fields, weight, accumulation)<br>
>   File<br>
> "/home/astro73/mlatif/YT/yt-x86_64/src/yt-hg/yt/data_objects/profiles.py",<br>
> line 107, in _lazy_add_fields<br>
>     args=args, check_cut=True)<br>
>   File<br>
> "/home/astro73/mlatif/YT/yt-x86_64/src/yt-hg/yt/data_objects/profiles.py",<br>
> line 56, in save_state<br>
>     tr = func(*args, **kwargs)<br>
>   File<br>
> "/home/astro73/mlatif/YT/yt-x86_64/src/yt-hg/yt/data_objects/profiles.py",<br>
> line 243, in _bin_field<br>
>     source_data = self._get_field(source, field, check_cut)<br>
>   File<br>
> "/home/astro73/mlatif/YT/yt-x86_64/src/yt-hg/yt/data_objects/profiles.py",<br>
> line 183, in _get_field<br>
>     data.append(source[field][pointI].ravel().astype('float64'))<br>
> IndexError: index (3) out of range (0<=index<2) in dimension 0<br>
><br>
><br>
</div></div>> _______________________________________________<br>
> yt-users mailing list<br>
> <a href="mailto:yt-users@lists.spacepope.org" target="_blank">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" target="_blank">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>
</blockquote></div><br>