We solve this problem in the light cone generator by using the field_cuts keyword argument to add projection.  For example, you can project only the gas with overdensity less than 200, by throwing:<br>field_cuts = ['grid["Overdensity"] < 200']<br>
along with your add_projection call.<br>You can use the coordinate fields to make positional cuts that are equivalent to making a subregion of the box and using it as a source for the projection.<br>For example:<br>axis = 'x'<br>
leftSide = 0.25<br>rightSide = 0.75<br>cutout = '((grid[\"%s\"] + 0.5*grid[\"d%s\"] >= %f) & (grid[\"%s\"] - 0.5*grid[\"d%s\"] <= %f))' % (axis,axis,leftSide,axis,axis,rightSide)<br>
field_cuts = [cutout]<br>pc.add_projection("Density",0,field_cuts=field_cuts)<br><br>This would limit the projection in the x direction to only project 0.25 to 0.75.  You can add others for the y and z direction.<br>
Since you're technically still projecting the whole box, this can be parallelized, and I have done it.  Of course, if you use too many processors for projecting a small region, you may get some processors completely outside the region you want to project.  If the region is of considerable size, this should still work quite well.  If the regions you want to project are very small, you are better off doing it the other way with source regions in serial.  In that case, the region would be so small that it would still go quite fast in serial.<br>
<br>Britton<br><br><div class="gmail_quote">On Tue, Feb 3, 2009 at 12:08 PM, Matthew Turk <span dir="ltr"><<a href="mailto:matthewturk@gmail.com">matthewturk@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Stephen,<br>
<br>
Right now, parallel projections are only of the entire domain.  The<br>
reason behind this is that the current means of doing domain<br>
decomposition are based on Regions, but Regions cannot themselves be<br>
subdivided.  When I wrote the parallel projections the idea was that<br>
sub-regions of projection would never be too prohibitive for<br>
projecting on a single processor.  I guess this was myopic?<br>
<br>
As Eric said in his reply, I think Britton's field_cuts might help you<br>
out here.  The way that came to my mind was that of an extracted<br>
hierarchy, which I'm working on (wherein an entire hierarchy object is<br>
constructed from some subset of an existing hierarchy) but which<br>
probably won't be ready for a couple weeks.<br>
<br>
Britton?  Any ideas?<br>
<br>
-Matt<br>
<div><div></div><div class="Wj3C7c"><br>
On Tue, Feb 3, 2009 at 10:51 AM, Stephen Skory <<a href="mailto:stephenskory@yahoo.com">stephenskory@yahoo.com</a>> wrote:<br>
> Hi all,<br>
><br>
> I'd like to make some parallel projections for a sub-region. What is the appropriate way to do that? I've tried something like this, below, but it makes a projection for the whole box, not the sub-region. I've tried a few other ways, something like this <<a href="http://paste.enzotools.org/show/38/" target="_blank">http://paste.enzotools.org/show/38/</a>>, but it works in only serial but not in parallel, where it crashes, like this <<a href="http://paste.enzotools.org/show/39/" target="_blank">http://paste.enzotools.org/show/39/</a>> (that's abbreviated output).<br>

><br>
> i = 1<br>
> pc = PlotCollection(pf.h.region([0.5]*3,[i*.1,0.,0.],[i*.1 + .1,1.,1.]),center=[0.5]*3)<br>
> pc.add_projection("Density", 0)<br>
> pc.save("slice-0.%d" % i)<br>
><br>
> Thanks!<br>
><br>
> _______________________________________________________<br>
> <a href="mailto:sskory@physics.ucsd.edu">sskory@physics.ucsd.edu</a>           o__  Stephen Skory<br>
> <a href="http://physics.ucsd.edu/%7Esskory/" target="_blank">http://physics.ucsd.edu/~sskory/</a> _.>/ _Graduate Student<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>