[yt-users] Obtaining projection data value

Nathan Goldbaum goldbaum at ucolick.org
Mon Feb 6 14:02:13 PST 2012


Hi Jun-Hwan,

You can also generate a fixed resolution buffer by operating on the object.  For your script you would have:

frb = FixedResolutionBuffer(proj,(leftx,rightx,lefty,righty),res)

Where (leftx,rightx,lefty,righty) are the bottom left and upper right coordinates of the window.

There may not be a to_frb() method for that particular object yet.

Another, possible slower but definitely more general option is to use the offaxis projection interface: http://yt-project.org/doc/cookbook/index.html#offaxis-projection

Best,

Nathan Goldbaum
Graduate Student
Astronomy & Astrophysics, UCSC
goldbaum at ucolick.org
http://www.ucolick.org/~goldbaum

On Feb 6, 2012, at 1:45 PM, Jun-Hwan Choi 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/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
>>>    
>> _______________________________________________
>> yt-users mailing list
>> yt-users at lists.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
> 
> !DSPAM:10175,4f3049fb87972478223174!
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20120206/f184b42a/attachment.htm>


More information about the yt-users mailing list