Hi Michael,

I think the previous answer is your best bet, but I actually just ran into perhaps something like this-my colleague was making projections and forgot we didn’t center our object so the projection was automatically looping to the other side of the box (even though our box is not periodic). We didn’t check this carefully because we didn’t want this, but might be worth just seeing what happens!

Best,
Stephanie 

On Sat, Apr 25, 2020 at 9:05 AM Contact <contact@cphyc.me> wrote:
Hi Michael,

You can probably achieve the desired behaviour using an union of data objects, see https://yt-project.org/doc/analyzing/objects.html#boolean-data-objects.
This lets you combine data objects. In your case, you could compute the (up to eight) rectangular regions that cover the area around your maximum overdensity.
For example in 1D, if your maximum density is located at x=0.1 and you want all the data at a distance of 0.2, you would take the union of the regions [0.9, 1.0] and [0.0, 0.3] (here I assumed a domain width of 1).

I hope that helps,
CC

24 Apr 2020 19:27:07 Michael Jennings <robertmjenningsjr@berkeley.edu>:

> Hello all,
>
> The documentation for the YTRegion class states "If the selected region extends past the edges of the domain, no data will be found there, though the object’s left_edge or right_edge are not modified.” Is there an easy way to change this to exhibit periodic behavior? For example: if the specified right_edge extended past the edges of the domain, data will be selected as continuing from the left of the domain.
>
> My ultimate goal is to create a square region centered on argmax(“density”) and calculate summed quantities in the region while successively increasing the size of the box assuming periodic boundaries.
>
> Does anyone have any insight?
> _______________________________________________
> yt-users mailing list -- yt-users@python.org
> To unsubscribe send an email to yt-users-leave@python.org
>
>

_______________________________________________
yt-users mailing list -- yt-users@python.org
To unsubscribe send an email to yt-users-leave@python.org
--
--
Dr. Stephanie Tonnesen
Associate Research Scientist
CCA, Flatiron Institute
New York, NY

stonnes@gmail.com