<div dir="ltr">Hi Caroline,<div><br></div><div>If Matt is correct (and I think he is) that this is an issue with trying to get particle data when there is none, then you should be able to resolve this by providing the keyword argument, include_particles=False, to the IsBound function.</div>
<div><br></div><div>Please, let us know if this works.  If not, we'll take a closer look and see if there is another bug.</div><div><br></div><div>Britton</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On Mon, Jan 13, 2014 at 7:42 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 Caroline,<br>
<br>
I think that's the trouble -- for some reason, the clump finder is<br>
assuming there are particles and attempting to deposit them into the<br>
fields before computing the mass.  Could you file a bug, and we will<br>
triage it there and work through it?  I think we should be able to<br>
resolve it quickly.<br>
<br>
Thanks,<br>
<br>
Matt<br>
<div class="HOEnZb"><div class="h5"><br>
On Mon, Jan 13, 2014 at 1:34 PM, Caroline Van Borm <<a href="mailto:borm@astro.rug.nl">borm@astro.rug.nl</a>> wrote:<br>
> Hi Matt,<br>
><br>
> Thanks for your reply. There shouldn't be particles in my simulation, as far<br>
> as I can tell.<br>
><br>
> Cheers,<br>
> Caroline<br>
><br>
><br>
><br>
><br>
> On 01/13/2014 06:21 PM, Matthew Turk wrote:<br>
>><br>
>> Hi Caroline,<br>
>><br>
>> Sorry you're having trouble!  Do you have particles in your simulation?<br>
>><br>
>> -Matt<br>
>><br>
>> On Fri, Jan 10, 2014 at 12:18 PM, Caroline Van Borm <<a href="mailto:borm@astro.rug.nl">borm@astro.rug.nl</a>><br>
>> wrote:<br>
>>><br>
>>> Hi all,<br>
>>><br>
>>> I have a problem with the clump finder. When I try to run it on my<br>
>>> dataset<br>
>>> (Enzo data), using a script that mostly follows the find_clumps.py from<br>
>>> the<br>
>>> yt docs, I get the following, very long, error:<br>
>>><br>
>>> Traceback (most recent call last):<br>
>>>    File "./findclumps.py", line 44, in <module><br>
>>>      find_clumps(master_clump, c_min, c_max, step)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/analysis_modules/level_sets/clump_handling.py",<br>
>>> line 182, in find_clumps<br>
>>>      find_clumps(clump, min_val*d_clump, max_val, d_clump)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/analysis_modules/level_sets/clump_handling.py",<br>
>>> line 182, in find_clumps<br>
>>>      find_clumps(clump, min_val*d_clump, max_val, d_clump)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/analysis_modules/level_sets/clump_handling.py",<br>
>>> line 182, in find_clumps<br>
>>>      find_clumps(clump, min_val*d_clump, max_val, d_clump)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/analysis_modules/level_sets/clump_handling.py",<br>
>>> line 182, in find_clumps<br>
>>>      find_clumps(clump, min_val*d_clump, max_val, d_clump)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/analysis_modules/level_sets/clump_handling.py",<br>
>>> line 182, in find_clumps<br>
>>>      find_clumps(clump, min_val*d_clump, max_val, d_clump)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/analysis_modules/level_sets/clump_handling.py",<br>
>>> line 182, in find_clumps<br>
>>>      find_clumps(clump, min_val*d_clump, max_val, d_clump)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/analysis_modules/level_sets/clump_handling.py",<br>
>>> line 182, in find_clumps<br>
>>>      find_clumps(clump, min_val*d_clump, max_val, d_clump)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/analysis_modules/level_sets/clump_handling.py",<br>
>>> line 182, in find_clumps<br>
>>>      find_clumps(clump, min_val*d_clump, max_val, d_clump)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/analysis_modules/level_sets/clump_handling.py",<br>
>>> line 182, in find_clumps<br>
>>>      find_clumps(clump, min_val*d_clump, max_val, d_clump)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/analysis_modules/level_sets/clump_handling.py",<br>
>>> line 182, in find_clumps<br>
>>>      find_clumps(clump, min_val*d_clump, max_val, d_clump)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/analysis_modules/level_sets/clump_handling.py",<br>
>>> line 182, in find_clumps<br>
>>>      find_clumps(clump, min_val*d_clump, max_val, d_clump)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/analysis_modules/level_sets/clump_handling.py",<br>
>>> line 182, in find_clumps<br>
>>>      find_clumps(clump, min_val*d_clump, max_val, d_clump)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/analysis_modules/level_sets/clump_handling.py",<br>
>>> line 182, in find_clumps<br>
>>>      find_clumps(clump, min_val*d_clump, max_val, d_clump)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/analysis_modules/level_sets/clump_handling.py",<br>
>>> line 191, in find_clumps<br>
>>>      elif (child._isValid()):<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/analysis_modules/level_sets/clump_handling.py",<br>
>>> line 145, in _isValid<br>
>>>      self.function_value = eval(self.function)<br>
>>>    File "<string>", line 1, in <module><br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/data_objects/derived_quantities.py",<br>
>>> line 94, in __call__<br>
>>>      return self._call_func_unlazy(args, kwargs)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/data_objects/derived_quantities.py",<br>
>>> line 119, in _call_func_unlazy<br>
>>>      retval = self.func(self._data_source, *args, **kwargs)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/data_objects/derived_quantities.py",<br>
>>> line 378, in _IsBound<br>
>>>      mass_to_use = data["TotalMass"]<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py",<br>
>>> line 332, in __getitem__<br>
>>>      self.get_data(key)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py",<br>
>>> line 2618, in get_data<br>
>>>      if self._generate_field(field):<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py",<br>
>>> line 362, in _generate_field<br>
>>>      self[field] = self.pf.field_info[field](self)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/data_objects/field_info_container.py",<br>
>>> line 395, in __call__<br>
>>>      dd = self._function(self, data)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/data_objects/universal_fields.py",<br>
>>> line 444, in _TotalMass<br>
>>>      return (data["Density"]+data["particle_density"]) *<br>
>>> data["CellVolume"]<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py",<br>
>>> line 332, in __getitem__<br>
>>>      self.get_data(key)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py",<br>
>>> line 2618, in get_data<br>
>>>      if self._generate_field(field):<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py",<br>
>>> line 359, in _generate_field<br>
>>>      self._generate_field_in_grids(field, ngt_exception.ghost_zones)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py",<br>
>>> line 369, in _generate_field_in_grids<br>
>>>      grid[field] = self.__touch_grid_field(grid, field)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py",<br>
>>> line 95, in save_state<br>
>>>      tr = func(self, grid, field, *args, **kwargs)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/data_objects/data_containers.py",<br>
>>> line 373, in __touch_grid_field<br>
>>>      return grid[field]<br>
>>>    File<br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/data_objects/grid_patch.py",<br>
>>> line 157, in __getitem__<br>
>>>      self.get_data(key)<br>
>>>    File<br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/data_objects/grid_patch.py",<br>
>>> line 200, in get_data<br>
>>>      self._generate_field(field)<br>
>>>    File<br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/data_objects/grid_patch.py",<br>
>>> line 145, in _generate_field<br>
>>>      self[field] = self.pf.field_info[field](self)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/data_objects/field_info_container.py",<br>
>>> line 395, in __call__<br>
>>>      dd = self._function(self, data)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/data_objects/universal_fields.py",<br>
>>> line 998, in _pdensity<br>
>>>      if data["particle_position_x"].size == 0: return blank<br>
>>>    File<br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/data_objects/grid_patch.py",<br>
>>> line 157, in __getitem__<br>
>>>      self.get_data(key)<br>
>>>    File<br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/data_objects/grid_patch.py",<br>
>>> line 200, in get_data<br>
>>>      self._generate_field(field)<br>
>>>    File<br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/data_objects/grid_patch.py",<br>
>>> line 145, in _generate_field<br>
>>>      self[field] = self.pf.field_info[field](self)<br>
>>>    File<br>
>>><br>
>>> "/home/uni05/cborm/YT/yt-x86_64/src/yt-hg/yt/data_objects/field_info_container.py",<br>
>>> line 396, in __call__<br>
>>>      dd *= self._convert_function(data)<br>
>>> TypeError: unsupported operand type(s) for *=: 'NoneType' and 'float'<br>
>>><br>
>>> The main difference is that for the function passed to Clump, I'm using<br>
>>><br>
>>> 'self.data.quantities["IsBound"](truncate=True,include_thermal_energy=True)<br>
>>>><br>
>>>> 1.0' to find gravitationally bound objects.<br>
>>><br>
>>> When I run the clump finder on my data with a function that keeps clumps<br>
>>> based on the number of cells, it works fine.<br>
>>> I also tried running the script on the IsolatedGalaxy dataset as<br>
>>> demonstrated in the docs. This works fine too, also when the function is<br>
>>> set<br>
>>> to the one mentioned above.<br>
>>><br>
>>> Anyone knows what's going on here?<br>
>>> Btw, my yt version is b118390aa42c.<br>
>>><br>
>>> Thanks!<br>
>>><br>
>>> Cheers,<br>
>>> Caroline<br>
>>><br>
>>> _______________________________________________<br>
>>> yt-users mailing list<br>
>>> <a href="mailto:yt-users@lists.spacepope.org">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">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>
> _______________________________________________<br>
> yt-users mailing list<br>
> <a href="mailto:yt-users@lists.spacepope.org">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>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">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>
</div></div></blockquote></div><br></div>