<div dir="ltr">Munier,<div><br></div><div>I think there is a way to do what you want. It involves using the HomogenizedVolume class (as opposed to the newer KDTree class) for decomposing the volume before raycasting in the camera object. I have an old script that did this, but I just tested it out, and it no longer works in the current yt paradigm. I poked around and cannot seem to get it to work to do what you want. Unfortunately, the main point of contact on the HomogenizedVolume class is Matt, and he's currently on his honeymoon for a few weeks. Furthermore, I think the path forward in yt was for completely doing away with the HomogenizedVolume class in the near future, as it is now almost a subclass of functionality of the kdtree. I think one of the main pieces of functionality that was holding up this changeover was that which you have discovered--being able to specify data sources to the camera object for rendering, as Nathan alluded to above. </div>
<div>Sam, what is the status of the kdtree being able to handle arbitrary data sources for rendering? </div><div><br></div><div>For reference, I've attached a modified form of my old script (along with some comments for options that wouldn't successfully run) which could do this circa 1.5 years ago here: <a href="http://paste.yt-project.org/show/3750/">http://paste.yt-project.org/show/3750/</a></div>
<div><br></div><div>Cameron</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Aug 7, 2013 at 11:57 AM, Munier Azzam Salem <span dir="ltr"><<a href="mailto:msalem@astro.columbia.edu" target="_blank">msalem@astro.columbia.edu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks Guys,<div><br></div><div> Kacper, that looks like a work-around for now, thanks.</div><span class="HOEnZb"><font color="#888888"><div>
<br></div><div> Munier</div></font></span></div><div class="gmail_extra"><br><br><div class="gmail_quote"><div><div class="h5">On Wed, Aug 7, 2013 at 2:53 PM, Kacper Kowalik <span dir="ltr"><<a href="mailto:xarthisius.kk@gmail.com" target="_blank">xarthisius.kk@gmail.com</a>></span> wrote:<br>
</div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="h5"><div>On 07.08.2013 20:37, Munier Azzam Salem wrote:<br>
> Hey guys,<br>
><br>
> I've been trying to make slices of density only looking at cooler<br>
> gas (i.e. with a cut in Temperature). I've found a nice way to do this for<br>
> simple projections. But my strategy breaks for Off-Axis projections.<br>
><br>
> Specifically, this works fine:<br>
</div>> *<br>
> *<br>
> *field_parameters={'field_cuts':["grid['Temperature'] < 1e6 "]})*<br>
> *cold_proj =<br>
> ProjectionPlot(pf,0,'Density',field_parameters=field_parameters)*<br>
> * *<br>
><br>
> but this does not:<br>
><br>
> *cold_proj = OffAxisProjectionPlot(pf,axis,'Density',north_vector=north,*<br>
> * field_parameters= field_parameters)*<br>
<div>><br>
> sensibly enough, since field_parameters is not a keyword argument for off<br>
> axis projections.<br>
><br>
> Is there a decent workaround for this? Or would this be simple to add into<br>
> yt's functionality?<br>
<br>
</div>Hi,<br>
I think that you could define auxiliary derived field like<br>
<br>
@derived_field(name = "cut_dens",<br>
validators = [ValidateSpatial(1)],<br>
units = r"g/cm^3")<br>
def _cut_dens(field, data):<br>
cut = data['Density'].copy()<br>
cut[data['Temperature'] < 1.0e6] = 0.0<br>
return cut<br>
<br>
and make OffAxisProjection of that.<br>
Cheers,<br>
Kacper<br>
<br>
<br>
<br></div></div><div class="im">_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">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></div></blockquote></div><br><br clear="all"><div class="im"><div><br></div>-- <br>Munier A. Salem // <a href="tel:845.489.6450" value="+18454896450" target="_blank">845.489.6450</a>
</div></div>
<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></blockquote></div><br><br clear="all"><div><br></div>-- <br>Cameron Hummels<div>Postdoctoral Researcher</div><div>Steward Observatory</div><div>University of Arizona</div><div><a href="http://chummels.org" target="_blank">http://chummels.org</a></div>
</div>