[yt-users] Questions About yt

Hansheng Chen jasonhs1221 at gmail.com
Tue Jun 21 09:22:24 PDT 2016


Hello Nathan,

This works! Thank you so much!

Best,
Hansheng

2016-06-21 11:22 GMT-04:00 Nathan Goldbaum <nathan12343 at gmail.com>:

> Hi Hansheng,
>
> Given a ProjectionPlot instance, you can get at the 2D image buffer using
> the "frb" attribute of the plot object:
>
>     plot = ProjectionPlot(ds, 2, 'density')
>     density_image = plot.frb['density']
>
> In this example, 'density_image' will be a 2D array containing an image of
> the projected gas density.
>
> One can do this manually without going through ProjectionPlot to customize
> the FixedResolutionBuffer:
>
> http://yt-project.org/docs/dev/visualizing/manual_plotting.html
>
> Hope that helps,
>
> Nathan
>
> On Tue, Jun 21, 2016 at 11:19 AM, Hansheng Chen <jasonhs1221 at gmail.com>
> wrote:
>
>> Hello Britton,
>>
>> Thank you for your response. I am able to load data by yt, and get a
>> projection plot of the data. However, what I would like to do is to get a
>> projected data of gas density in 2-D, because the original data is in 3-D.
>> I do not know how to get a projected data through yt. Could you please give
>> me some help?
>>
>> Thank you very much!
>>
>> Sincerely,
>> Hansheng
>>
>> 2016-06-21 5:52 GMT-04:00 Britton Smith <brittonsmith at gmail.com>:
>>
>>> Hi Hansheng,
>>>
>>> What you want to do is referred to as a projection in yt.  I assume that
>>> you are already able to load your data with yt.  If that is not the case,
>>> let us know.  The function to check out is yt.ProjectionPlot.  Have a look
>>> here for some more information on this:
>>> http://yt-project.org/doc/visualizing/plots.html
>>> It will do the integration and also generate a figure for you.
>>>
>>> Britton
>>>
>>> On Mon, Jun 20, 2016 at 8:59 PM, Hansheng Chen <jasonhs1221 at gmail.com>
>>> wrote:
>>>
>>>> Hello,
>>>>
>>>> I would like to use yt to analyze the electron density of a galaxy. I
>>>> have the data of the electron density in 3-D, but I would like to get the
>>>> projected electron density in 2-dimensional. This means that I need to
>>>> integrate the electron density in 3-D along the z-axis and show the
>>>> integrated data in x-y coordinates. I do not know how to integrate the 3-D
>>>> data along one direction by using yt. Could you please give me some help?
>>>>
>>>> Thank you very much!
>>>>
>>>> Sincerely,
>>>> Hansheng Chen
>>>>
>>>> _______________________________________________
>>>> yt-users mailing list
>>>> yt-users at lists.spacepope.org
>>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>>
>>>>
>>>
>>> _______________________________________________
>>> yt-users mailing list
>>> yt-users at lists.spacepope.org
>>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>>
>>>
>>
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.spacepope.org
>> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>>
>>
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20160621/1f6f1c52/attachment-0001.htm>


More information about the yt-users mailing list