Hi Jean-Claude,<br><br>You can change the information that gets written out in the write_info routine. The clump object stores a list called clump_info, whose entries determine what information gets written out about the clumps. First, you will want to clear out the list with:<br>
master_clump.clear_clump_info()<br><br>Then, you can add back any of the information items you want, including anything new you might want. The default information items are set in the Clump method called set_default_clump_info. Have a look at the set_default_clump_info routine in yt/lagos/Clump.py for many examples of how to add information to be printed out for the clumps. You can just add the ones you want one at a time and skip the ones you don't.<br>
<br>Britton<br><br><div class="gmail_quote">On Thu, May 20, 2010 at 9:02 PM, Matthew Turk <span dir="ltr"><<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hi JC,<br>
<br>
As another followup, Britton Smith has committed a change to the Clump<br>
object that should allow what you're looking for in terms of plotting.<br>
You should be able to call get_lowest_clumps, supplying it the master<br>
clump, and get back a list of the children that are the bottom of the<br>
clump hierarchy. That list can be fed to the callback.<br>
<br>
We're still working on a solution for the Temperature / JeansMass issue.<br>
<br>
-Matt<br>
<div><div></div><div class="h5"><br>
On Wed, May 19, 2010 at 3:32 PM, Matthew Turk <<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a>> wrote:<br>
> Hi JC,<br>
><br>
> As a quick note, all this inline text output from IPython is very<br>
> difficult to parse over email. I highly recommend that you script<br>
> this task and then run with the --paste command, as mentioned here:<br>
><br>
> <a href="http://yt.enzotools.org/doc/askingforhelp.html" target="_blank">http://yt.enzotools.org/doc/askingforhelp.html</a><br>
><br>
> and more specifically, here:<br>
><br>
> <a href="http://yt.enzotools.org/doc/advanced/debugdrive.html#error-reporting" target="_blank">http://yt.enzotools.org/doc/advanced/debugdrive.html#error-reporting</a><br>
><br>
> That way, some of the rest of us can try reproducing it, as well. :)<br>
><br>
> Anyway, I've looked at the issues, and it looks to me like the first<br>
> is because of a mismatch in what the clump callback wants and what the<br>
> clump *finder* (as opposed to the contour finder) hands off. I'll<br>
> work with Britton Smith on making that work.<br>
><br>
> The second error is because the clump finder (again, not the contour<br>
> finder) expects to be handed something with a meaningful "Temperature"<br>
> field. This is true for, say, Cosmology simulations and a few types<br>
> of star formation simulations. The Clump finder is a very powerful<br>
> tool that also assumes you have relatively rich data; however, you can<br>
> mock up a small portion of it by using extract_connected_sets:<br>
><br>
> <a href="http://yt.enzotools.org/doc/modules/amrdata.html#yt.lagos.AMR3DData.extract_connected_sets" target="_blank">http://yt.enzotools.org/doc/modules/amrdata.html#yt.lagos.AMR3DData.extract_connected_sets</a><br>
><br>
> and then on each returned object, call the quantity IsBound. I will<br>
> work on writing up a very simple recipe for this, to be included with<br>
> the next build of the docs, but Britton Smith or David Collins can<br>
> probably chime in with some additional words of wisdom.<br>
><br>
> As to your third question, IsBound takes as an argument whether or not<br>
> to consider the thermal energy. I believe by default it *does* take<br>
> into account thermal energy inside the clump finder, but I defer to<br>
> Britton on that.<br>
><br>
> I hope that helps!<br>
><br>
> -Matt<br>
><br>
> On Wed, May 19, 2010 at 3:05 PM, Jean-Claude Passy <<a href="mailto:jcpassy@gmail.com">jcpassy@gmail.com</a>> wrote:<br>
>> Dear all,<br>
>><br>
>> I want ultimately plot bound/unbound quantities such as mass, angular<br>
>> momentum...<br>
>> Britton suggested I used the clump finder. I have read the paragraph in the<br>
>> Cookbook but did not manage to make it work. See below:<br>
>><br>
>><br>
>> ##########################################################################################<br>
>> In [1]: from yt.mods import *<br>
>> In [2]: import yt.raven as R<br>
>> In [3]: fn = "DD0000/CommonEnvelope0000"<br>
>> In [4]: field = "Density"<br>
>> In [5]: step = 10.0<br>
>> In [6]: pf = load(fn)<br>
>> In [7]: whole_box = pf.h.all_data() yt INFO 2010-05-19<br>
>> 13:47:49,272 Getting the binary hierarchy yt INFO 2010-05-19<br>
>> 13:47:49,275 Finished with binary hierarchy reading<br>
>> In [8]: total_mass = whole_box.quantities['TotalQuantity']('CellMassMsun')<br>
>> In [9]: data_source = pf.h.all_data()<br>
>> In [10]: master_clump = Clump(data_source, None, field) yt<br>
>> INFO 2010-05-19 13:47:49,371 Getting field Density from 1<br>
>> In [11]: c_min = 10**na.floor(na.log10(data_source[field]).min() )<br>
>> In [12]: c_max = 10**na.floor(na.log10(data_source[field]).max()+1)<br>
>> In [13]: step = 10<br>
>> In [14]: find_clumps(master_clump, c_min, c_max, step) Finding clumps: min:<br>
>> 1.000000e-05, max: 1.000000e+03, step: 10.000000 First pass100%<br>
>> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||<br>
>> Time: 00:00:00 Calculating joins 100%<br>
>> |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time:<br>
>> 00:00:00 yt INFO 2010-05-19 13:47:49,908 Coalescing 1 joins<br>
>> Joining 100%<br>
>> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||<br>
>> Time: 00:00:00 yt INFO 2010-05-19 13:47:49,910 Getting field<br>
>> tempContours from 1 yt INFO 2010-05-19 13:47:49,916 Getting<br>
>> field tempContours from 1 yt INFO 2010-05-19 13:47:49,920<br>
>> Identified 1 contours between 1.00000e-05 and 1.05005e+02 yt<br>
>> INFO 2010-05-19 13:47:49,931 Getting field Density from 1 Finding<br>
>> clumps: min: 1.000000e-04, max: 1.000000e+03, step: 10.000000 Wiping out<br>
>> existing children clumps. First pass100%<br>
>> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||<br>
>> Time: 00:00:00 Calculating joins 100%<br>
>> |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time:<br>
>> 00:00:00 yt INFO 2010-05-19 13:47:49,944 Coalescing 1 joins<br>
>> Joining 100%<br>
>> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||<br>
>> Time: 00:00:00 yt INFO 2010-05-19 13:47:49,945 Getting field<br>
>> tempContours from 1 yt INFO 2010-05-19 13:47:49,950 Getting<br>
>> field tempContours from 1 yt INFO 2010-05-19 13:47:49,954<br>
>> Identified 1 contours between 1.00000e-04 and 1.05005e+02 yt<br>
>> INFO 2010-05-19 13:47:49,957 Getting field Density from 1 Finding<br>
>> clumps: min: 1.000000e-03, max: 1.000000e+03, step: 10.000000 Wiping out<br>
>> existing children clumps. First pass100%<br>
>> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||<br>
>> Time: 00:00:00 Calculating joins 100%<br>
>> |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time:<br>
>> 00:00:00 yt INFO 2010-05-19 13:47:49,967 Coalescing 1 joins<br>
>> Joining 100%<br>
>> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||<br>
>> Time: 00:00:00 yt INFO 2010-05-19 13:47:49,968 Getting field<br>
>> tempContours from 1 yt INFO 2010-05-19 13:47:49,973 Getting<br>
>> field tempContours from 1 yt INFO 2010-05-19 13:47:49,977<br>
>> Identified 1 contours between 1.00000e-03 and 1.05005e+02 yt<br>
>> INFO 2010-05-19 13:47:49,980 Getting field Density from 1 Finding<br>
>> clumps: min: 1.000000e-02, max: 1.000000e+03, step: 10.000000 Wiping out<br>
>> existing children clumps. First pass100%<br>
>> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||<br>
>> Time: 00:00:00 Calculating joins 100%<br>
>> |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time:<br>
>> 00:00:00 yt INFO 2010-05-19 13:47:49,990 Coalescing 1 joins<br>
>> Joining 100%<br>
>> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||<br>
>> Time: 00:00:00 yt INFO 2010-05-19 13:47:49,991 Getting field<br>
>> tempContours from 1 yt INFO 2010-05-19 13:47:49,996 Getting<br>
>> field tempContours from 1 yt INFO 2010-05-19 13:47:50,000<br>
>> Identified 1 contours between 1.00000e-02 and 1.05005e+02 yt<br>
>> INFO 2010-05-19 13:47:50,003 Getting field Density from 1 Finding<br>
>> clumps: min: 1.000000e-01, max: 1.000000e+03, step: 10.000000 Wiping out<br>
>> existing children clumps. First pass100%<br>
>> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||<br>
>> Time: 00:00:00 Calculating joins 100%<br>
>> |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time:<br>
>> 00:00:00 yt INFO 2010-05-19 13:47:50,013 Coalescing 1 joins<br>
>> Joining 100%<br>
>> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||<br>
>> Time: 00:00:00 yt INFO 2010-05-19 13:47:50,014 Getting field<br>
>> tempContours from 1 yt INFO 2010-05-19 13:47:50,019 Getting<br>
>> field tempContours from 1 yt INFO 2010-05-19 13:47:50,023<br>
>> Identified 1 contours between 1.00000e-01 and 1.05005e+02 yt<br>
>> INFO 2010-05-19 13:47:50,026 Getting field Density from 1 Finding<br>
>> clumps: min: 1.000000e+00, max: 1.000000e+03, step: 10.000000 Wiping out<br>
>> existing children clumps. First pass100%<br>
>> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||<br>
>> Time: 00:00:00 Calculating joins 100%<br>
>> |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time:<br>
>> 00:00:00 yt INFO 2010-05-19 13:47:50,034 Coalescing 1 joins<br>
>> Joining 100%<br>
>> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||<br>
>> Time: 00:00:00 yt INFO 2010-05-19 13:47:50,036 Getting field<br>
>> tempContours from 1 yt INFO 2010-05-19 13:47:50,040 Getting<br>
>> field tempContours from 1 yt INFO 2010-05-19 13:47:50,045<br>
>> Identified 1 contours between 1.00000e+00 and 1.05005e+02 yt<br>
>> INFO 2010-05-19 13:47:50,047 Getting field Density from 1 Finding<br>
>> clumps: min: 1.000000e+01, max: 1.000000e+03, step: 10.000000 Wiping out<br>
>> existing children clumps. First pass100%<br>
>> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||<br>
>> Time: 00:00:00 Calculating joins 100%<br>
>> |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time:<br>
>> 00:00:00 yt INFO 2010-05-19 13:47:50,055 Coalescing 1 joins<br>
>> Joining 100%<br>
>> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||<br>
>> Time: 00:00:00 yt INFO 2010-05-19 13:47:50,056 Getting field<br>
>> tempContours from 1 yt INFO 2010-05-19 13:47:50,061 Getting<br>
>> field tempContours from 1 yt INFO 2010-05-19 13:47:50,065<br>
>> Identified 1 contours between 1.00000e+01 and 1.05005e+02 yt<br>
>> INFO 2010-05-19 13:47:50,067 Getting field Density from 1 Finding<br>
>> clumps: min: 1.000000e+02, max: 1.000000e+03, step: 10.000000 Wiping out<br>
>> existing children clumps. First pass100%<br>
>> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||<br>
>> Time: 00:00:00 Calculating joins 100%<br>
>> |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time:<br>
>> 00:00:00 yt INFO 2010-05-19 13:47:50,073 Coalescing 0 joins<br>
>> Joining 100%<br>
>> ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||<br>
>> Time: 00:00:00 yt INFO 2010-05-19 13:47:50,075 Getting field<br>
>> tempContours from 1 yt INFO 2010-05-19 13:47:50,080 Getting<br>
>> field tempContours from 1 yt INFO 2010-05-19 13:47:50,084<br>
>> Identified 0 contours between 1.00000e+02 and 1.05005e+02<br>
>> In [15]: p = R.PlotCollection(pf) yt.lagos INFO 2010-05-19<br>
>> 13:47:50,918 Max Value is 1.05005e+02 at 0.4843750000000000<br>
>> 0.4843750000000000 0.4843750000000000 in grid EnzoGrid_0001 at level 0 (15,<br>
>> 15, 15) yt INFO 2010-05-19 13:47:50,919 Created plot<br>
>> collection with default plot-center = [0.484375, 0.484375, 0.484375]<br>
>> In [16]: p.add_slice("Density",2,center=[0.5, 0.5, 0.5]) yt<br>
>> INFO 2010-05-19 13:47:51,479 Added slice of Density at z = 0.5 with<br>
>> 'center' = [0.5, 0.5, 0.5] Out[16]: <yt.raven.PlotTypes.SlicePlot object at<br>
>> 0x42f1c10><br>
>> In [17]: p.plots[-1].modify["clumps"](master_clump) Out[17]: 0<br>
>> In [18]: p.save('testclumps', format = 'png') ERROR: An unexpected error<br>
>> occurred while tokenizing input The following traceback may be corrupted or<br>
>> invalid The error message is: ('EOF in multi-line statement', (10, 0))<br>
>> ---------------------------------------------------------------------------<br>
>> TypeError Traceback (most recent call last)<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/scripts/iyt in <module>() ----> 1<br>
>> 2 3 4 5<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/yt/raven/PlotCollection.pyc in<br>
>> save(self, basename, format, override, force_save) 81<br>
>> fn.append(plot.save_image(basename, \ 82<br>
>> format=format, submit=self._run_id, ---> 83<br>
>> override=override, force_save=force_save)) 84 if<br>
>> self.submit: 85 im = plot.im.copy()<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/yt/raven/PlotTypes.pyc in<br>
>> save_image(self, prefix, format, submit, override, force_save)<br>
>> 116 *override* will force no filename generation beyond the prefix.<br>
>> 117 """ --> 118 self._redraw_image() 119 if<br>
>> not override: 120 self._generate_prefix(prefix)<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/yt/raven/PlotTypes.pyc in<br>
>> _redraw_image(self, *args) 404<br>
>> self.norm.autoscale(na.array((newmin,newmax))) 405<br>
>> self._reset_image_parameters() --> 406 self._run_callbacks() 407<br>
>> 408 def _reset_image_parameters(self):<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/yt/raven/PlotTypes.pyc in<br>
>> _run_callbacks(self) 259 self._axes.texts = [] 260<br>
>> for cb in self._callbacks: --> 261 cb(self) 262 263<br>
>> def set_label(self, label):<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/yt/raven/Callbacks.pyc in<br>
>> __call__(self, plot) 451 nx, ny = plot.image._A.shape<br>
>> 452 buff = na.zeros((nx,ny),dtype='float64') --> 453 for<br>
>> i,clump in enumerate(reversed(self.clumps)): 454<br>
>> mylog.debug("Pixelizing contour %s", i) 455<br>
>> TypeError: object of type 'Clump' has no len()<br>
>> ##########################################################################################<br>
>><br>
>><br>
>> If I also try to reproduce the example in the cookbook:<br>
>><br>
>> ##########################################################################################<br>
>> In [19]: f = open('%s_clump_hierarchy.txt' % pf,'w')<br>
>> In [20]: write_clump_hierarchy(master_clump,0,f) yt INFO<br>
>> 2010-05-19 14:00:24,974 Getting field CellMassMsun from 1 yt<br>
>> INFO 2010-05-19 14:00:24,974 Getting field CellVolume from 1<br>
>> yt INFO 2010-05-19 14:00:24,974 Getting field dx from 1<br>
>> yt INFO 2010-05-19 14:00:24,978 Getting field dy from 1<br>
>> yt INFO 2010-05-19 14:00:24,981 Getting field dz from 1 ERROR:<br>
>> An unexpected error occurred while tokenizing input The following traceback<br>
>> may be corrupted or invalid The error message is: ('EOF in multi-line<br>
>> statement', (37, 0))<br>
>> ERROR: An unexpected error occurred while tokenizing input The following<br>
>> traceback may be corrupted or invalid The error message is: ('EOF in<br>
>> multi-line statement', (111, 0))<br>
>> ERROR: An unexpected error occurred while tokenizing input The following<br>
>> traceback may be corrupted or invalid The error message is: ('EOF in<br>
>> multi-line statement', (111, 0))<br>
>> ERROR: An unexpected error occurred while tokenizing input The following<br>
>> traceback may be corrupted or invalid The error message is: ('EOF in<br>
>> multi-line statement', (133, 0))<br>
>> ---------------------------------------------------------------------------<br>
>> NeedsDataField Traceback (most recent call last)<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/scripts/iyt in <module>() ----> 1<br>
>> 2 3 4 5<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/yt/lagos/Clump.pyc in<br>
>> write_clump_hierarchy(clump, level, f_ptr) 196 f_ptr.write("\t")<br>
>> 197 f_ptr.write("Clump at level %d:\n" % level) --> 198<br>
>> clump.write_info(level,f_ptr) 199 f_ptr.write("\n") 200<br>
>> f_ptr.flush()<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/yt/lagos/Clump.pyc in<br>
>> write_info(self, level, f_ptr) 102 value =<br>
>> item['quantity']() 103 else: --> 104 value =<br>
>> eval(item['quantity']) 105 output = eval(item['format'])<br>
>> 106 f_ptr.write("%s%s" % ('\t'*level,output))<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/yt/lagos/Clump.pyc in <module>()<br>
>> ----> 1 2 3 4 5<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/yt/lagos/DerivedQuantities.pyc in<br>
>> __call__(self, *args, **kwargs) 70<br>
>> self._<a href="http://data_source.pf.h.io" target="_blank">data_source.pf.h.io</a>) 71 if lazy_reader and not<br>
>> self.force_unlazy: ---> 72 return self._call_func_lazy(args,<br>
>> kwargs) 73 else: 74 return<br>
>> self._call_func_unlazy(args, kwargs)<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/yt/lagos/DerivedQuantities.pyc in<br>
>> _call_func_lazy(self, args, kwargs) 77 self.retvals = [ [] for<br>
>> i in range(self.n_ret)] 78 for gi,g in<br>
>> enumerate(self._get_grids()): ---> 79 rv =<br>
>> self.func(GridChildMaskWrapper(g, self._data_source), *args, **kwargs)<br>
>> 80 for i in range(self.n_ret): self.retvals[i].append(rv[i])<br>
>> 81 g.clear_data()<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/yt/lagos/DerivedQuantities.pyc in<br>
>> _WeightedAverageQuantity(data, field, weight) 151 :param weight: The<br>
>> field to weight by 152 """ --> 153 num = (data[field] *<br>
>> data[weight]).sum() 154 den = data[weight].sum() 155 return<br>
>> num, den<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/yt/lagos/DerivedQuantities.pyc in<br>
>> __getitem__(self, item) 41 return getattr(self.grid, attr)<br>
>> 42 def __getitem__(self, item): ---> 43 return<br>
>> self.data_source._get_data_from_grid(self.grid, item) 44 45 class<br>
>> DerivedQuantity(ParallelAnalysisInterface):<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/yt/lagos/BaseDataTypes.pyc in<br>
>> save_state(self, grid, field) 41 old_keys = grid.data.keys()<br>
>> 42 grid.field_parameters = self.field_parameters ---><br>
>> 43 tr = func(self, grid, field) 44<br>
>> grid.field_parameters = old_params 45 grid.data = dict( [(k,<br>
>> grid.data[k]) for k in old_keys] )<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/yt/lagos/BaseDataTypes.pyc in<br>
>> _get_data_from_grid(self, grid, field) 1670 else:<br>
>> 1671 pointI = self._get_point_indices(grid) -> 1672<br>
>> if grid[field].size == 1: # dx, dy, dz, cellvolume 1673 t<br>
>> = grid[field] * na.ones(grid.ActiveDimensions, dtype='float64')<br>
>> 1674 return t[pointI].ravel()<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/yt/lagos/BaseGridType.pyc in<br>
>> __getitem__(self, key) 133 """ 134 if not<br>
>> self.data.has_key(key): --> 135 self.get_data(key)<br>
>> 136 return self.data[key] 137<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/yt/lagos/BaseGridType.pyc in<br>
>> get_data(self, field) 176 else: raise<br>
>> 177 else: --> 178 self._generate_field(field)<br>
>> 179 return self.data[field] 180<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/yt/lagos/BaseGridType.pyc in<br>
>> _generate_field(self, field) 121 self[field] =<br>
>> temp_array[sl] 122 else: --> 123 self[field]<br>
>> = self.pf.field_info[field](self) 124 else: # Can't find the<br>
>> field, try as it might 125 raise exceptions.KeyError, field<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/yt/lagos/FieldInfoContainer.pyc in<br>
>> __call__(self, data) 316 ii = self.check_available(data)<br>
>> 317 original_fields = data.keys() # Copy --> 318 dd =<br>
>> self._function(self, data) 319 dd *=<br>
>> self._convert_function(data) 320 for field_name in data.keys():<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/yt/lagos/UniversalFields.pyc in<br>
>> _JeansMassMsun(field, data) 769 770 return (MJ_constant * --><br>
>> 771 ((data["Temperature"]/data["MeanMolecularWeight"])**(1.5)) *<br>
>> 772 (data["Density"]**(-0.5))) 773<br>
>> add_field("JeansMassMsun",function=_JeansMassMsun,<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/yt/lagos/BaseGridType.pyc in<br>
>> __getitem__(self, key) 133 """ 134 if not<br>
>> self.data.has_key(key): --> 135 self.get_data(key)<br>
>> 136 return self.data[key] 137<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/yt/lagos/BaseGridType.pyc in<br>
>> get_data(self, field) 176 else: raise<br>
>> 177 else: --> 178 self._generate_field(field)<br>
>> 179 return self.data[field] 180<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/yt/lagos/BaseGridType.pyc in<br>
>> _generate_field(self, field) 111 # First we check the<br>
>> validator<br>
>> 112 try: --> 113<br>
>> self.pf.field_info[field].check_available(self) 114 except<br>
>> NeedsGridType, ngt_exception: 115 # This is only going<br>
>> to be raised if n_gz > 0<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/yt/lagos/FieldInfoContainer.pyc in<br>
>> check_available(self, data) 283 """ 284 for<br>
>> validator in self.validators: --> 285 validator(data)<br>
>> 286 # If we don't get an exception, we're good to go<br>
>> 287 return True<br>
>> /rpod2/jcpassy/yt-x86_64/src/yt-trunk-svn/yt/lagos/FieldInfoContainer.pyc in<br>
>> __call__(self, data) 381 doesnt_have.append(f)<br>
>> 382 if len(doesnt_have) > 0: --> 383 raise<br>
>> NeedsDataField(doesnt_have) 384 return True 385<br>
>> NeedsDataField: (['Temperature'])<br>
>> ##########################################################################################<br>
>><br>
>><br>
>> Also, if I correctly understand the Cookbook and the reference, the tree of<br>
>> clumps in contained in master_clump. It contains only the bound clumps so if<br>
>> I do :<br>
>><br>
>><br>
>> ##########################################################################################<br>
>> In [31]: master_clump.data.fields Out[31]: ['Density', 'tempContours',<br>
>> 'CellMassMsun']<br>
>> In [32]: a = master_clump.data['CellMassMsun']<br>
>> In [33]: sum(a) Out[33]: 0.98881452898337696<br>
>> ##########################################################################################<br>
>><br>
>> this will be the total bound mass. Does it automatically take into account<br>
>> the thermal energy to determine whether a clump is bound or not ?<br>
>><br>
>><br>
>> I would really appreciate if someone could give me a hint.<br>
>> Thanks a lot,<br>
>><br>
>> Jean-Claude<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>
_______________________________________________<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>