[yt-users] Field Cuts in Off-Axis Projections

Cameron Hummels chummels at gmail.com
Wed Aug 7 14:32:56 PDT 2013


Munier,

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.
Sam, what is the status of the kdtree being able to handle arbitrary data
sources for rendering?

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: http://paste.yt-project.org/show/3750/

Cameron


On Wed, Aug 7, 2013 at 11:57 AM, Munier Azzam Salem <
msalem at astro.columbia.edu> wrote:

> Thanks Guys,
>
>      Kacper, that looks like a work-around for now, thanks.
>
>          Munier
>
>
> On Wed, Aug 7, 2013 at 2:53 PM, Kacper Kowalik <xarthisius.kk at gmail.com>wrote:
>
>> On 07.08.2013 20:37, Munier Azzam Salem wrote:
>> > Hey guys,
>> >
>> >        I've been trying to make slices of density only looking at cooler
>> > gas (i.e. with a cut in Temperature). I've found a nice way to do this
>> for
>> > simple projections. But my strategy breaks for Off-Axis projections.
>> >
>> > Specifically, this works fine:
>> > *
>> > *
>> > *field_parameters={'field_cuts':["grid['Temperature'] < 1e6 "]})*
>> > *cold_proj =
>> > ProjectionPlot(pf,0,'Density',field_parameters=field_parameters)*
>> > *               *
>> >
>> > but this does not:
>> >
>> > *cold_proj =
>> OffAxisProjectionPlot(pf,axis,'Density',north_vector=north,*
>> > *                                  field_parameters= field_parameters)*
>> >
>> > sensibly enough, since field_parameters is not a keyword argument for
>> off
>> > axis projections.
>> >
>> > Is there a decent workaround for this? Or would this be simple to add
>> into
>> > yt's functionality?
>>
>> Hi,
>> I think that you could define auxiliary derived field like
>>
>> @derived_field(name = "cut_dens",
>>    validators = [ValidateSpatial(1)],
>>    units = r"g/cm^3")
>> def _cut_dens(field, data):
>>    cut = data['Density'].copy()
>>    cut[data['Temperature'] < 1.0e6] = 0.0
>>    return cut
>>
>> and make OffAxisProjection of that.
>> Cheers,
>> Kacper
>>
>>
>>
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>>
>
>
> --
> Munier A. Salem // 845.489.6450
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>


-- 
Cameron Hummels
Postdoctoral Researcher
Steward Observatory
University of Arizona
http://chummels.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130807/1dc6edd3/attachment.html>


More information about the yt-users mailing list