<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="">Hi Stephanie,<div class=""><br class=""></div><div class=""><blockquote type="cite" class=""><div dir="ltr" class=""><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin: 0px 0px 0px 0.8ex; border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); padding-left: 1ex;"><div class="" style="word-wrap: break-word;"><div class="">profile.add_fields(‘cell_mass’, weight=None)</div></div></blockquote></div></div></div></blockquote><br class=""></div><div class="">Sorry I’ve missed the later part of my old script — after getting the profile[‘cell_mass’] it should be divided by the unit surface area. The following is the full code and it has been tested with AMR data:</div><div class=""><br class=""></div><div class=""><font face="Menlo" class="">profile = BinnedProfile1D(mydisk, Nbin, 'cylindrical_r', rmin, rmax, log_space=True, lazy_reader=True, end_collect=False)</font></div><div class=""><font face="Menlo" class="">profile.add_fields('cell_mass', weight=None)</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><font face="Menlo" class="">R = profile['cylindrical_r’]</font></div><div class=""><div class=""><font face="Menlo" class="">Sigma = profile[‘cell_mass']</font></div><div class=""><font face="Menlo" class=""><br class=""></font></div><div class=""><font face="Menlo" class="">R_edge = np.logspace(np.log10(rmin), np.log10(rmax), num=Nbin+1)</font></div><div class=""><font face="Menlo" class="">for i in range(0, Nbin): Sigma[i] = Sigma[i] / (np.pi*(R_edge[i+1]**2 - R_edge[i]**2.))</font></div></div><div class=""><br class=""></div><div class="">And Nathan’s approach which takes the advantage of image buffer should also work.</div><div class=""><br class=""></div><div class="">Best wishes,</div><div class=""><div class="">
<div style="color: rgb(0, 0, 0); letter-spacing: 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; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: 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; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: 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; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: 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; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">--</div><div class="">Suoqing JI</div><div class="">Ph.D Student</div><div class="">Department of Physics</div><div class="">University of California, Santa Barbara</div><div class="">CA 93106, USA</div></div></div></div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Nov 3, 2014, at 8:40 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" class=""><br class=""><div class="gmail_extra"><br class=""><div class="gmail_quote">On Mon, Nov 3, 2014 at 5:29 PM, Suoqing JI <span dir="ltr" class=""><<a href="mailto:suoqing@physics.ucsb.edu" target="_blank" class="">suoqing@physics.ucsb.edu</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word" class="">Hi Stephanie,<div class=""><br class=""></div><div class="">Maybe you could specify a disk, use BinnedProfile1D to create bins along cylindrical radial ('cylindrical_r'), and do</div><div class=""><br class=""></div><div class="">profile.add_fields(‘cell_mass’, weight=None)</div><div class=""><br class=""></div><div class="">then you could plot profile[‘cell_mass’] vs. profile['cylindrical_r’] and get the 1-D plot the surface density.<br class=""></div></div></blockquote><div class=""><br class=""></div><div class="">This will be a profile of the gas mass as a function of radius, but it's not quite a surface density profile.  That said, for an unweighted projection, I think it's the same up to a constant scaling factor.<br class=""></div><div class=""> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><br class=""></div><div class="">Best wishes,</div><div class=""><div class="">
<div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div style="letter-spacing: normal; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; word-spacing: 0px; word-wrap: break-word;" class=""><div class="">--</div><div class="">Suoqing JI</div><div class="">Ph.D Student</div><div class="">Department of Physics</div><div class="">University of California, Santa Barbara</div><div class="">CA 93106, USA</div></div></div></div></div>
</div>
<br class=""><div class=""><blockquote type="cite" class=""><div class=""><div class="h5"><div class="">On Nov 3, 2014, at 5:17 PM, Stephanie Tonnesen <<a href="mailto:stonnes@gmail.com" target="_blank" class="">stonnes@gmail.com</a>> wrote:</div><br class=""></div></div><div class=""><div class=""><div class="h5"><div dir="ltr" class=""><div class=""><div class="">Hi yt-users,<br class=""><br class=""></div>I would like to make a 1D plot of column density vs radius for a disk (to compare with observations).  I can make a projectionplot, but want something a bit more simple to look at.  I am using yt3.0.1--is there a nice way to to this?<br class=""></div></div></div></div></div></blockquote></div></div></div></blockquote><div class=""><br class=""></div>The key is to use the numpy.digitize and numpy.bincount functions to find the histogram of the surface density as a function of radius.  Here's an example:<br class=""><br class=""><a href="http://nbviewer.ipython.org/gist/ngoldbaum/af8e7f317efe8f115e8b" class="">http://nbviewer.ipython.org/gist/ngoldbaum/af8e7f317efe8f115e8b</a><br class=""></div><div class="gmail_quote"><div class=""> <br class=""></div><div class="">This is a simplified version of what I've done for a project I'm working on right now, which involves making a ton of radial plots of projected quantities:<br class=""><br class=""><a href="https://bitbucket.org/ngoldbaum/galaxy_analysis/src/910f5a7e278247a36f25d62bdc478a7b5a7fe8ce/galanyl/galaxy_analyzer.py?at=default#cl-338" class="">https://bitbucket.org/ngoldbaum/galaxy_analysis/src/910f5a7e278247a36f25d62bdc478a7b5a7fe8ce/galanyl/galaxy_analyzer.py?at=default#cl-338</a><br class=""></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div style="word-wrap:break-word" class=""><div class=""><div class=""><blockquote type="cite" class=""><div class=""><div class=""><div class="h5"><div dir="ltr" class=""><div class=""><br class=""></div>Thanks!<br class=""><br class="">Stephanie<br class=""><br clear="all" class=""><div class=""><div class=""><div class=""><div class=""><div class=""><div dir="ltr" class=""><div class=""><div class=""><div class=""><font face="garamond,serif" class="">--<br class="">Dr. Stephanie Tonnesen<br class=""></font></div><font face="garamond,serif" class="">Alvin E. Nashman Postdoctoral Fellow<br class=""></font></div><font face="garamond,serif" class="">Carnegie Observatories, Pasadena, CA<br class=""></font></div><font face="garamond,serif" class=""><a href="mailto:stonnes@gmail.com" target="_blank" class="">stonnes@gmail.com</a><br class=""></font></div></div></div>
</div></div></div></div></div></div>
_______________________________________________<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=""></div></blockquote></div><br class=""></div></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>
_______________________________________________<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="">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org<br class=""></div></blockquote></div><br class=""></div></body></html>