Is there an easy way to turn
into an AMR region?

Then I could just do a boolean "or" on those regions from each of the regions?


On Fri, May 17, 2013 at 1:34 PM, Matthew Turk <> wrote:
On Fri, May 17, 2013 at 3:31 PM, david collins <> wrote:
> Hi, all--
> I have a clump that I've gotten with the clump finder.  I'd like to paint
> those zones of that clump with a flag, so I can exclude that region from
> other analysis.  I'm a little stuck on how to get this done-- I feel like it
> needs to involve and a cut_mask, but I'm a
> little stuck on how to define the field that I flush_to_grids.

I have to think about specifically how you might do this, but I do
believe that you can probably accomplish what you're looking for by
using a boolean region.

> Specifically, how to get the cut_mask information to the field, and how to
> avoid clobbering the paint from one clump with another (or, from one grid
> with another)
> I'm trying to do something like:
> <code>
> for grid in
>     cut_mask =
>     def masked_region(field,data):
>         cut_mask = data.get_field_parameter('cut_mask', None)
>         try:
>             base = data['masked_region']
>         except:
>             base = na.zeros(data['Density'].shape)
>         if cut_mask is not None:
>             base = na.maximum(base,cut_mask)
>         return base
> add_field('masked_region',function=masked_region,validators=[ValidateGridType()],
> not_in_all=True)
>     grid.set_field_parameter('cut_mask',cut_mask)
>     print grid, cut_mask.sum(), grid['masked_region'].sum()
> </code>
> but clump['masked_region'].sum() only returns the flagged zones in the first
> of the grids.
> I feel like this is something I've done before, but can't find any reference
> to it in my email or old scripts.  Apologies if this has been answered
> elsewhere, or it's obvious and I'm being thick.
> Thanks!
> d.
> _______________________________________________
> yt-users mailing list
yt-users mailing list