<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi Dave,</div><div class=""><br class=""></div>Also, I know that you’re talking about the projection object itself, but for completeness, this was merged in yesterday:<div class=""><br class=""></div><div class=""><a href="https://bitbucket.org/yt_analysis/yt/pull-request/1593/export-fixedresolutionbuffers-as-datasets/" class="">https://bitbucket.org/yt_analysis/yt/pull-request/1593/export-fixedresolutionbuffers-as-datasets/</a></div><div class=""><br class=""></div><div class="">Which takes an FRB and makes a dataset out of it. </div><div class=""><br class=""></div><div class="">Best,</div><div class=""><br class=""></div><div class="">John</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 2, 2015, at 1:54 PM, Nathan Goldbaum <<a href="mailto:nathan12343@gmail.com" class="">nathan12343@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><div class="gmail_extra"><br class="Apple-interchange-newline"><br class=""><div class="gmail_quote">On Tue, Jun 2, 2015 at 8:21 AM, David Collins<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:dcollins4096@gmail.com" target="_blank" class="">dcollins4096@gmail.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class="">Hi, Everybody--<div class=""><br class=""></div><div class="">This was discussed a while back, but I wanted to further clarify, and possibly mooch a script or two off y'all.  </div><div class=""><br class=""></div><div class="">I'd like a PhasePlot from a projected region.  Earlier FRBs were discussed; has anyone successfully done the same on a YTQuadTreeProj?  I'd like to retain all the high resolution data, if possible.  </div><div class=""><br class=""></div><div class="">Cameron, back in Jan you mentioned you had a script.  Did you manage to track it down, and/or would you be willing to send it my way?</div><div class=""><br class=""></div></div></blockquote><div class=""><br class=""></div><div class="">This is buried a few layers deep in my code, but I use this to generate radial profiles from an image:</div><div class=""><br class=""></div><div class=""><a href="https://bitbucket.org/ngoldbaum/galaxy_analysis/src/eda50ae6dd8315bb23aab4baf2842f7e5faf4fa3/galanyl/galaxy_analyzer.py?at=default#cl-387" class="">https://bitbucket.org/ngoldbaum/galaxy_analysis/src/eda50ae6dd8315bb23aab4baf2842f7e5faf4fa3/galanyl/galaxy_analyzer.py?at=default#cl-387</a><br class=""></div><div class=""><br class=""></div><div class="">In lieu of a docstring on that function, 'data' is an image, 'weight' is a weight image (if you are doing a weighted profile), and x_bin_edges is a specification for bin edges that should be passed to np.histogram.</div><div class=""> </div><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class=""><div class="">Thanks!</div><div class="">d.</div><div class=""><br class=""></div><div class=""><br class=""></div></div><div class="gmail_extra"><div class=""><div class="h5"><br class=""><div class="gmail_quote">On Fri, Jan 16, 2015 at 10:31 PM, John ZuHone<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:jzuhone@gmail.com" target="_blank" class="">jzuhone@gmail.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="auto" class=""><div class="">This is a bit of a long way around, but you could write the FRB to a FITS file and read it in as a dataset. You would get the coordinate system, units, etc., and the whole YT machinery.</div><div class=""><br class=""></div><div class="">Use the export_fits method:</div><div class=""><br class=""></div><div class="">my_frb.export_fits("myfile.fits", fields)</div><div class=""><br class=""></div><div class="">Then:</div><div class=""><br class=""></div><div class="">ds = yt.load("my_file.fits")</div><div class=""><br class=""></div><div class="">I'm not at a computer so I don't remember the exact signature, but it should be in the code and you can check using help(my_frb.export_fits). If you're interested I can write back with more info later.</div><div class=""><br class=""></div><div class="">The other advantage of this is that you can store the data to disk. You'll have to install the AstroPy package.</div><div class=""><br class=""></div><div class=""><div class=""><span style="background-color: rgba(255, 255, 255, 0);" class="">Kavli Center for Astrophysics and Space Research<br class="">Massachusetts Institute of Technology<br class=""><a class="">77 Massachusetts Ave.</a>, 37-582G<br class=""><a class="">Cambridge, MA 02139</a><br class="">(w) <a href="tel:617-253-2354" target="_blank" class="">617-253-2354</a><br class="">(m) <a href="tel:781-708-5004" target="_blank" class="">781-708-5004</a><br class=""><a href="mailto:jzuhone@space.mit.edu" target="_blank" class="">jzuhone@space.mit.edu</a><br class=""><a href="mailto:jzuhone@gmail.com" target="_blank" class="">jzuhone@gmail.com</a><br class=""><a href="http://www.jzuhone.com/" target="_blank" class="">http://www.jzuhone.com</a></span><br style="font-family: UICTFontTextStyleBody;" class=""></div></div><div class=""><div class=""><div class=""><br class="">On Jan 16, 2015, at 8:34 PM, Ben Thompson <<a href="mailto:bthompson2090@gmail.com" target="_blank" class="">bthompson2090@gmail.com</a>> wrote:<br class=""><br class=""></div><blockquote type="cite" class=""><div class=""><p dir="ltr" class="">Hey guys.</p><p dir="ltr" class="">I have a solution together for myself involving the new particle_position_relative_[xyz] fields and multiple instances of np.histogram and np.linspace which seems to do the trick.</p><p dir="ltr" class="">Although I would not complain if a piece of code that would be more native to the inner workings of YT existed that made use of the FRB data objects :). So that would be very nice Cameron. Don't feel the need to rush with it though, as I made a numpy solution for myself. But I would be interested to see that code.</p><p dir="ltr" class="">Ben</p><div class="gmail_quote">On 17 Jan 2015 01:27, "Britton Smith" <<a href="mailto:brittonsmith@gmail.com" target="_blank" class="">brittonsmith@gmail.com</a>> wrote:<br type="attribution" class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class="">Hi Ben,<div class=""><br class=""></div><div class="">I seem to recall people on this list doing similar things in the past with their own external code.  Does anyone still have their 2D radial profile code around anymore?</div><div class=""><br class=""></div><div class="">Would it perhaps work to create a uniform grid dataset from an FRB array?</div><div class=""><br class=""></div><div class="">Britton</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Tue, Jan 13, 2015 at 12:49 PM, Ben Thompson<span class="Apple-converted-space"> </span><span dir="ltr" class=""><<a href="mailto:bthompson2090@gmail.com" target="_blank" class="">bthompson2090@gmail.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br class=""><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-color: rgb(204, 204, 204); border-left-style: solid; padding-left: 1ex;"><div dir="ltr" class=""><div class=""><div class=""><div class="">Hello everyone.<br class=""><br class=""></div>I was wondering if anyone has had experience with producing a profile plot from a 2d projection object (FRB object).<br class=""><br class=""></div>Essentially, what I am trying to do is plot the stellar surface density of a galaxy as a function of radius.<br class=""><br class=""></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 class=""><br class=""><div class="">center = cylinder.get_field_parameter("center")<br class="">normal = cylinder.get_field_parameter("normal")<br class="">image_width = (100,"kpc")<br class="">three_image_width = YTArray((image_width[0], image_width[0], image_width[0]),image_width[1])<br class="">left = center - image_width<br class="">right = center + image_width<br class="">region = shot.region(center, left, right)<br class=""><br class="">proj = yt.ProjectionPlot(cylinder.ds,"z",[("deposit","stars_density")],center=center,width=image_width,data_source=region,axes_unit="kpc")<br class=""><br class=""></div><div class="">the error arrises here<br class=""></div><div class=""><br class="">prof = yt.create_profile(proj,bin_fields="cylindrical_r",fields=[("deposit","stars_density")],n_bins=128,weight_field=None )<br class=""><br class=""></div><div class="">where I get the error<br class=""><br class=""><br class="">/gpfs/home/........./profiles.pyc in create_profile(data_source, bin_fields, fields, n_bins, extrema, logs, units, weight_field, accumulation, fractional)<br class="">  <span class="Apple-converted-space"> </span>1304     else:<br class="">  <span class="Apple-converted-space"> </span>1305         raise NotImplementedError<br class="">-> 1306     bin_fields = data_source._determine_fields(bin_fields)<br class="">  <span class="Apple-converted-space"> </span>1307     fields = data_source._determine_fields(fields)<br class="">  <span class="Apple-converted-space"> </span>1308     if units is not None:<br class=""><br class="">AttributeError: 'FixedResolutionBuffer' object has no attribute '_determine_fields'<br class=""><br class=""></div><div class="">Any ideas how to get around this error?<span class="Apple-converted-space"> </span><br class=""><br class=""><br class=""></div><div class="">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 class=""><br class=""><br class=""></div></div><br class="">_______________________________________________<br class="">yt-users mailing list<br class=""><a href="mailto:yt-users@lists.spacepope.org" target="_blank" class="">yt-users@lists.spacepope.org</a><br class=""><a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank" class="">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br class=""><br class=""></blockquote></div><br class=""></div><br class="">_______________________________________________<br class="">yt-users mailing list<br class=""><a href="mailto:yt-users@lists.spacepope.org" target="_blank" class="">yt-users@lists.spacepope.org</a><br class=""><a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank" class="">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br class=""><br class=""></blockquote></div></div></blockquote><blockquote type="cite" class=""><div class=""><span class="">_______________________________________________</span><br class=""><span class="">yt-users mailing list</span><br class=""><span class=""><a href="mailto:yt-users@lists.spacepope.org" target="_blank" class="">yt-users@lists.spacepope.org</a></span><br class=""><span class=""><a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank" class="">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a></span><br class=""></div></blockquote></div></div></div><br class="">_______________________________________________<br class="">yt-users mailing list<br class=""><a href="mailto:yt-users@lists.spacepope.org" target="_blank" class="">yt-users@lists.spacepope.org</a><br class=""><a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank" class="">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br class=""><br class=""></blockquote></div><br class=""><br clear="all" class=""><div class=""><br class=""></div></div></div><span class=""><font color="#888888" class="">--<span class="Apple-converted-space"> </span><br class=""><div class=""><div dir="ltr" class="">-- Sent from a computer.<br class=""></div></div></font></span></div><br class="">_______________________________________________<br class="">yt-users mailing list<br class=""><a href="mailto:yt-users@lists.spacepope.org" class="">yt-users@lists.spacepope.org</a><br class=""><a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank" class="">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br class=""><br class=""></blockquote></div><br class=""></div></div><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_______________________________________________</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">yt-users mailing list</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="mailto:yt-users@lists.spacepope.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">yt-users@lists.spacepope.org</a><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a></div></blockquote></div><br class=""></div></body></html>