[yt-users] Obtaining projection data value

Matthew Turk matthewturk at gmail.com
Mon Feb 6 14:04:08 PST 2012


Hi Jun-has,

Probably means you're on an older version. You can upgrade with "yt update"
or just use the manual interface to a FixedResolutionBuffer, which is also
documented.

Matt
On Feb 6, 2012 4:46 PM, "Jun-Hwan Choi" <jhchoi at pa.uky.edu> wrote:

> Hi Matthew,
>
> I try the following script
> from yt.mods import *
> import matplotlib.pylab as pylab
>
> # load up a dataset
> index = 30
> pf = load("DD%04d/DD%04d" % (index,index))
> all_center = pf.h.find_max("Density")[1]
> #sphere = pf.h.sphere(all_center, (50, 'pc'))
> #sphere_center = sphere.quantities["**CenterOfMass"]()
>
> # create density slices   proj = pf.h.proj(2, 'Density')
> width = 100/pf['pc']
> res = [1000,1000]
> frb = proj.to_frb(width, res, center=all_center)
>
> pylab.imshow(frb['Density'])
> pylab.xlabel(r'$x\ \mathrm{pc}$')
> pylab.ylabel(r'$x\ \mathrm{furlongs}$')
> pylab.savefig('my_perfect_**figure.png')
>
> and I got following error message:
> frb = proj.to_frb(width, res, center=sphere_center)
> AttributeError: 'AMRQuadTreeProj' object has no attribute 'to_frb'
>
> What does error mean?
>
> Thank you,
> Junhwan
> Matthew Turk wrote:
>
>> Hi Jun-Hwan,
>>
>> On Mon, Feb 6, 2012 at 4:09 PM, Jun-Hwan Choi <jhchoi at pa.uky.edu> wrote:
>>
>>
>>> Hi all,
>>>
>>> I wonder whether that I can obtain the value that generate projection
>>> plot.
>>> I can make a projection image for my disk using add_projection  in the
>>> plot_collation.
>>> I am interested in to get the projected density value and its position
>>> (and
>>> its pixel size) to perform the FFT analysis in order to find the
>>> non-axisymmertic feature such as disk-bar.
>>> Is there way to get this values using yt?
>>>
>>>
>>
>> Yes.
>>
>> http://yt-project.org/docs/2.**3/visualizing/manual_plotting.**html<http://yt-project.org/docs/2.3/visualizing/manual_plotting.html>
>> http://yt-project.org/docs/2.**3/analyzing/generating_**
>> processed_data.html#d-image-**arrays<http://yt-project.org/docs/2.3/analyzing/generating_processed_data.html#d-image-arrays>
>>
>> The function you're looking for is "to_frb" which is a method on the
>> projection object.
>>
>> pf = load(...)
>> proj = pf.h.proj(axis, field, weight)
>> frb = proj.to_frb()
>> field = frb[field]
>>
>> -Matt
>>
>>
>>
>>> Thank you in advance,
>>> Junhwan
>>>
>>> --
>>> ------------------------------**------------------------------**--
>>> Jun-Hwan Choi, Ph.D.
>>> Department of Physics and Astronomy, University of Kentucky
>>> Tel: (859) 897-6737        Fax: (859) 323-2846
>>> Email: jhchoi at pa.uky.edu   URL: http://www.pa.uky.edu/~jhchoi
>>> ------------------------------**------------------------------**--
>>>
>>> ______________________________**_________________
>>> yt-users mailing list
>>> yt-users at lists.spacepope.org
>>> http://lists.spacepope.org/**listinfo.cgi/yt-users-**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<http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org>
>>
>>
>
>
> --
> ------------------------------**------------------------------**--
> Jun-Hwan Choi, Ph.D.
> Department of Physics and Astronomy, University of Kentucky
> Tel: (859) 897-6737        Fax: (859) 323-2846
> Email: jhchoi at pa.uky.edu   URL: http://www.pa.uky.edu/~jhchoi
> ------------------------------**------------------------------**--
>
> ______________________________**_________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/**listinfo.cgi/yt-users-**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/20120206/207a607a/attachment.html>


More information about the yt-users mailing list