[yt-users] Accumulation in 3.0

John Regan johnanthonyregan at gmail.com
Mon Nov 3 05:06:37 PST 2014


Hi Kacper,

Of course - I should have noticed that. Thanks for finding that.
However, I notice that when I try to create a profile for the Dark
(particle) matter I run into some trouble as well.

rpm = yt.create_profile(sp, 'radius',  ['particle_mass'],
                        units = {'radius': 'pc', 'particle_mass' : 'Msun'},
                        n_bins=20, weight_field=None, accumulation=True,
fractional=False)

This gives the following error:

Traceback (most recent call last):
  File "EnclosedMass.py", line 35, in <module>
    n_bins=20, weight_field=None, accumulation=True, fractional=False)
  File
"/homeappl/home/regan/appl_taito/YT/Dev-3.0/yt/yt/data_objects/profiles.py",
line 1361, in create_profile
    obj.add_fields([field for field in fields])
  File
"/homeappl/home/regan/appl_taito/YT/Dev-3.0/yt/yt/data_objects/profiles.py",
line 782, in add_fields
    self._bin_chunk(chunk, fields, temp_storage)
  File
"/homeappl/home/regan/appl_taito/YT/Dev-3.0/yt/yt/data_objects/profiles.py",
line 979, in _bin_chunk
    rv = self._get_data(chunk, fields)
  File
"/homeappl/home/regan/appl_taito/YT/Dev-3.0/yt/yt/data_objects/profiles.py",
line 910, in _get_data
    arr[:,i] = chunk[field][filter]
  File
"/homeappl/home/regan/appl_taito/YT/Dev-3.0/yt/yt/units/yt_array.py", line
963, in __getitem__
    ret = super(YTArray, self).__getitem__(item)
ValueError: too many boolean indices


Has anyone seen this before? For the 'cell_mass' everything works fine.

Cheers,
John

On Sat, Nov 1, 2014 at 6:49 PM, Kacper Kowalik <xarthisius.kk at gmail.com>
wrote:

> Hi John,
> I think that if you want to compute "total" instead of mean you need to
> set weight_field to None in create_profile.
> Cheers,
> Kacper
>
> On Sat Nov 01 2014 at 6:10:50 AM John Regan <johnanthonyregan at gmail.com>
> wrote:
>
>> Hi All,
>>
>> Is the accumulation flag working in 3.0?
>> I tried to plot the enclosed mass in a sphere and I got some funny
>> results.
>>
>> rpm = yt.create_profile(sp, 'radius',  'cell_mass',
>>                         units = {'radius': 'pc', 'cell_mass' : 'Msun'},
>>                         weight_field='density', accumulation=True,
>> fractional=False)
>>
>> print "Mass = ", rpm["gas", "cell_mass"]
>>
>> In this case bin[n-1] gives a mass of something like 0.5 Msun but when I
>> print the totals quantity I get a value of several orders of magnitude
>> higher and closer to what I would expect.
>>
>> sp.quantities.total_quantity(["cell_mass", "particle_mass"])
>>
>> Cheers,
>> John
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20141103/d98931d6/attachment.html>


More information about the yt-users mailing list