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