<div dir="ltr">Hi Ben,<div><br></div><div>I have some code which does this, but I'm in the middle of job stuff at the moment, and it will take me a few days to extract out the relevant parts of the code to get to you (and upgrade to yt3).</div><div><br></div><div>Cameron</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 13, 2015 at 10:49 AM, Ben Thompson <span dir="ltr"><<a href="mailto:bthompson2090@gmail.com" target="_blank">bthompson2090@gmail.com</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"><div><div><div>Hello everyone.<br><br></div>I was wondering if anyone has had experience with producing a profile plot from a 2d projection object (FRB object).<br><br></div>Essentially, what I am trying to do is plot the stellar surface density of a galaxy as a function of radius.<br><br></div>This is achieved by doing the following from a disk YT object called cylinder (in which the origional simulation object is called shot)<br><br><div>center = cylinder.get_field_parameter("center")<br>normal = cylinder.get_field_parameter("normal")<br>image_width = (100,"kpc")<br>three_image_width = YTArray((image_width[0], image_width[0], image_width[0]),image_width[1])<br>left = center - image_width<br>right = center + image_width<br>region = shot.region(center, left, right)<br><br>proj = yt.ProjectionPlot(cylinder.ds,"z",[("deposit","stars_density")],center=center,width=image_width,data_source=region,axes_unit="kpc")<br><br></div><div>the error arrises here<br></div><div><br>prof = yt.create_profile(proj,bin_fields="cylindrical_r",fields=[("deposit","stars_density")],n_bins=128,weight_field=None )<br><br></div><div>where I get the error<br><br><br>/gpfs/home/........./profiles.pyc in create_profile(data_source, bin_fields, fields, n_bins, extrema, logs, units, weight_field, accumulation, fractional)<br>   1304     else:<br>   1305         raise NotImplementedError<br>-> 1306     bin_fields = data_source._determine_fields(bin_fields)<br>   1307     fields = data_source._determine_fields(fields)<br>   1308     if units is not None:<br><br>AttributeError: 'FixedResolutionBuffer' object has no attribute '_determine_fields'<br><br></div><div>Any ideas how to get around this error? <br><br><br></div><div>Also some other things to add as a postscript. Since how the projection works, if I provide weights=None as a keyword argument within the ProjectionPlot object, I get a surface density (g/cm^2). But also a "cylindrical_r" in cm^2 as well. I *think* the way to get around this is to do another projection where weights="ones", get the radius values out of that profile.. and then in matplotlib, useing the surface density array from the former profile, and the radius bin array from the latter... Produce a plot of the surface density as a function of radius from those two arrays (I might check by hand afterwards to see if this does the trick). This seems kinda convoluted so I am wondering if there is an easier way than this.<br><br><br></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><div class="gmail_signature">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>
</div>