[yt-users] clump as container

David Collins dcollins4096 at gmail.com
Tue Dec 16 15:01:06 PST 2014


Hi--

Not sure why this is happening.  Any chance you can reproduce it using one
> of the test datasets on yt-project.org/data?
>

I'll give that a shot in the morning and report back.


Thanks!
d.


>
>
>>
>> If I instead try quantities.total_mass(), I get an odd error.
>> >>> leaf_clumps[22].quantities.total_mass()
>> Traceback (most recent call last):
>>   File "<stdin>", line 1, in <module>
>>   File
>> "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/data_objects/derived_quantities.py",
>> line 193, in __call__
>>     rv = super(TotalMass, self).__call__(fields)
>>   File
>> "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/data_objects/derived_quantities.py",
>> line 160, in __call__
>>     rv = super(TotalQuantity, self).__call__(fields)
>>   File
>> "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/data_objects/derived_quantities.py",
>> line 56, in __call__
>>     sto.result = self.process_chunk(ds, *args, **kwargs)
>>   File
>> "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/data_objects/derived_quantities.py",
>> line 166, in process_chunk
>>     for field in fields]
>>   File
>> "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/data_objects/data_containers.py",
>> line 248, in __getitem__
>>     self.get_data(f)
>>   File
>> "/home/dcollins4096/local-yt-2014-08-27/src/yt-hg/yt/data_objects/selection_data_containers.py",
>> line 749, in get_data
>>     raise YTMixedCutRegion(self.conditionals, field)
>> yt.utilities.exceptions.YTMixedCutRegion: Can't mix particle/discrete and
>> fluid/mesh conditions or
>>                quantities.  Field: ('all', 'particle_mass') and
>> Conditions specified:
>>             obj['contours_8d0408a91fc34e2bbe9eb838d48de46e'] == 1
>>
>
> This is happening because, as the error indicates, you can't combine mesh
> and particle quantities in a cut_region (like a clump is).  The
> total_mass() quantity returns the total mass in particles and gas, so
> that's what's triggering the error. I bet this would work if you asked for
> the total gas mass only. Of course, that would only work if
> clump['cell_mass'] returned something sensible.
>
>
>>
>>
>>
>> I build the clumps in the following manner.  I don't have any validators
>> by design.  Plotting the clumps with annotate_clumps(leaf_clumps) gives
>> reasonable results.
>>
>>     ds = yt.load(setname)
>>     loc = ds.arr([ 0.03613281,  0.79589844,  0.03027344], 'code_length')
>>     width = (0.05,'code_length')
>>     sphere = ds.sphere(loc,width)
>>     master_clump = Clump(sphere,"density")
>> use_particles=False, use_thermal_energy=False)
>>     c_min = sphere["gas", "density"].min()
>>     c_max = sphere["gas", "density"].max()
>>     step = 2.0
>>     find_clumps(master_clump, c_min, c_max, step)
>>     leaf_clumps = get_lowest_clumps(master_clump)
>>
>> Thanks a ton!
>> d.
>>
>> --
>> -- Sent from a computer.
>>
>> _______________________________________________
>> 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
>
>

-- 
-- Sent from a computer.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20141216/29013936/attachment.htm>
-------------- next part --------------
_______________________________________________
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