[yt-users] Accumulation in 3.0

Matthew Turk matthewturk at gmail.com
Mon Nov 3 09:16:00 PST 2014


Yup, those sure are weird!  Looks to me like a units issue -- any chance
those could be in grams but reported in Msun?

On Mon Nov 03 2014 at 11:15:23 AM John Regan <johnanthonyregan at gmail.com>
wrote:

> Hi Matt,
>
> Ah I see what you mean now. Changing 'radius' to 'particle_radius' worked
> nicely. However, the results are bit weird.
>
> rpm = yt.create_profile(sp, ['particle_radius'],  ['particle_mass'],
>                         units = {'particle_radius': 'pc', 'particle_mass'
> : 'Msun'},
>                         n_bins=20, weight_field=None, accumulation=True,
> fractional=False)
> print "Particle Mass = ", rpm["particle_mass"]
>
> Particle Mass =  [  0.00000000e+00   0.00000000e+00   0.00000000e+00
> 2.17730865e+47
>    2.39503952e+48   5.00780990e+48   9.36242721e+48   2.87404742e+49
>    8.03426893e+49   1.91385431e+50   4.44824158e+50   1.02681876e+51
>    2.28900459e+51   4.74174278e+51   1.05066029e+52   2.07602025e+52
>    3.49614805e+52   4.89060538e+52   6.82621100e+52   1.08907237e+53] Msun
>
> Any idea what is causing the crazy values?
>
> On Mon, Nov 3, 2014 at 4:23 PM, Matthew Turk <matthewturk at gmail.com>
> wrote:
>
>> Hi John,
>>
>> It was exactly the same error, when you used particle_radius in both
>> places that "radius" was used before?
>>
>> -Matt
>>
>>
>> On Mon Nov 03 2014 at 7:06:44 AM John Regan <johnanthonyregan at gmail.com>
>> wrote:
>>
>>> 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
>>>>
>>>>
>>> _______________________________________________
>>> 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
>>
>>
> _______________________________________________
> 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/f923c679/attachment.htm>


More information about the yt-users mailing list