<div dir="ltr">Ah, Sweet. I tried this:<br><div><br>>>> pf.h.boolean([pf.h.all_data(), 'NOT', clump.data])<br><br>and got this:<br><br>Building boolean100% |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| Time: 00:00:01 <br>
Traceback (most recent call last):<br> File "<stdin>", line 1, in <module><br> File "/nics/b/home/collins/local_2013_03_12/src/yt-hg/yt/data_objects/data_containers.py", line 4104, in __repr__<br>
s += region.__repr__(clean = True)<br>TypeError: wrapper __repr__ doesn't take keyword arguments<br><br></div><div>c32.data is of type ExtractedRegion. It works ok if I use pf.h.sphere. What do I need to do to condition the clump.data?<br>
<br></div><div>d.<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 17, 2013 at 1:49 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">I believe that is correct, yes. One very simple way to test this and<br>
verify would be to compare the volume in that object plus the volume<br>
in your clump against the volume in the domain.<br>
<div class="HOEnZb"><div class="h5"><br>
On Fri, May 17, 2013 at 3:48 PM, David Collins <<a href="mailto:dcollins4096@gmail.com">dcollins4096@gmail.com</a>> wrote:<br>
> Oh, right. I can do<br>
><br>
> pf.h.boolean([pf.h.all_data(), "NOT", clump])<br>
><br>
> ?<br>
><br>
><br>
> On Fri, May 17, 2013 at 1:41 PM, Matthew Turk <<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a>> wrote:<br>
>><br>
>> On Fri, May 17, 2013 at 3:39 PM, David Collins <<a href="mailto:dcollins4096@gmail.com">dcollins4096@gmail.com</a>><br>
>> wrote:<br>
>> > Is there an easy way to turn<br>
>> > data._get_cut_mask(grid)<br>
>> > into an AMR region?<br>
>> ><br>
>> > Then I could just do a boolean "or" on those regions from each of the<br>
>> > regions?<br>
>><br>
>> Oh, you want to do it grid-by-grid? I assumed that you were operating<br>
>> on the full clump. If you have the full clump, you can feed that<br>
>> (which should be an AMRExtractedRegion) to the boolean object.<br>
>><br>
>> And now that I think about it, AMRExtractedRegion is what should have<br>
>> the _flush_to_grids method.<br>
>><br>
>> ><br>
>> > d.<br>
>> ><br>
>> ><br>
>> > On Fri, May 17, 2013 at 1:34 PM, Matthew Turk <<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a>><br>
>> > wrote:<br>
>> >><br>
>> >> On Fri, May 17, 2013 at 3:31 PM, david collins <<a href="mailto:dcollins4096@gmail.com">dcollins4096@gmail.com</a>><br>
>> >> wrote:<br>
>> >> > Hi, all--<br>
>> >> ><br>
>> >> > I have a clump that I've gotten with the clump finder. I'd like to<br>
>> >> > paint<br>
>> >> > those zones of that clump with a flag, so I can exclude that region<br>
>> >> > from<br>
>> >> > other analysis. I'm a little stuck on how to get this done-- I feel<br>
>> >> > like it<br>
>> >> > needs to involve clump.data._flush_data_to_grids and a cut_mask, but<br>
>> >> > I'm<br>
>> >> > a<br>
>> >> > little stuck on how to define the field that I flush_to_grids.<br>
>> >> ><br>
>> >><br>
>> >> I have to think about specifically how you might do this, but I do<br>
>> >> believe that you can probably accomplish what you're looking for by<br>
>> >> using a boolean region.<br>
>> >><br>
>> >> > Specifically, how to get the cut_mask information to the field, and<br>
>> >> > how<br>
>> >> > to<br>
>> >> > avoid clobbering the paint from one clump with another (or, from one<br>
>> >> > grid<br>
>> >> > with another)<br>
>> >> ><br>
>> >> > I'm trying to do something like:<br>
>> >> ><br>
>> >> > <code><br>
>> >> > for grid in clump.data._grids:<br>
>> >> > cut_mask = clump.data._get_cut_mask(grid)<br>
>> >> > def masked_region(field,data):<br>
>> >> > cut_mask = data.get_field_parameter('cut_mask', None)<br>
>> >> > try:<br>
>> >> > base = data['masked_region']<br>
>> >> > except:<br>
>> >> > base = na.zeros(data['Density'].shape)<br>
>> >> > if cut_mask is not None:<br>
>> >> > base = na.maximum(base,cut_mask)<br>
>> >> > return base<br>
>> >> ><br>
>> >> ><br>
>> >> ><br>
>> >> > add_field('masked_region',function=masked_region,validators=[ValidateGridType()],<br>
>> >> > not_in_all=True)<br>
>> >> > grid.set_field_parameter('cut_mask',cut_mask)<br>
>> >> > print grid, cut_mask.sum(), grid['masked_region'].sum()<br>
>> >> > clump.data._flush_to_grids('masked_region',0)<br>
>> >> > </code><br>
>> >> ><br>
>> >> > but clump['masked_region'].sum() only returns the flagged zones in<br>
>> >> > the<br>
>> >> > first<br>
>> >> > of the grids.<br>
>> >> ><br>
>> >> > I feel like this is something I've done before, but can't find any<br>
>> >> > reference<br>
>> >> > to it in my email or old scripts. Apologies if this has been<br>
>> >> > answered<br>
>> >> > elsewhere, or it's obvious and I'm being thick.<br>
>> >> ><br>
>> >> > Thanks!<br>
>> >> > d.<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>
>> >> ><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>
>> ><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>
><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>