<div dir="ltr"><div><div>Is there an easy way to turn <br> data._get_cut_mask(grid)<br></div>into an AMR region?<br><br>Then I could just do a boolean "or" on those regions from each of the regions?<br><br></div>
d.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 17, 2013 at 1:34 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"><div class="im">On Fri, May 17, 2013 at 3:31 PM, david collins <<a href="mailto:dcollins4096@gmail.com">dcollins4096@gmail.com</a>> wrote:<br>
> Hi, all--<br>
><br>
> I have a clump that I've gotten with the clump finder. I'd like to paint<br>
> those zones of that clump with a flag, so I can exclude that region from<br>
> other analysis. I'm a little stuck on how to get this done-- I feel like it<br>
> needs to involve clump.data._flush_data_to_grids and a cut_mask, but I'm a<br>
> little stuck on how to define the field that I flush_to_grids.<br>
><br>
<br>
</div>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>
<div><div class="h5"><br>
> Specifically, how to get the cut_mask information to the field, and how to<br>
> avoid clobbering the paint from one clump with another (or, from one 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>
> 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 the first<br>
> of the grids.<br>
><br>
> I feel like this is something I've done before, but can't find any reference<br>
> to it in my email or old scripts. Apologies if this has been answered<br>
> elsewhere, or it's obvious and I'm being thick.<br>
><br>
> Thanks!<br>
> d.<br>
><br>
><br>
><br>
</div></div>> _______________________________________________<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>
</blockquote></div><br></div>