and yt does not like that. Nor does it like take_log or log_space. Can someone tell me what I should be setting there?Thank you both! I ended up generally following Suoqing's method, but tried to use create_profile. I want my radial spacing to be linear, and when I look at the help page:I read that I should set logs=False
http://yt-project.org/docs/dev/reference/api/generated/yt.data_objects.profiles.create_profile.html#yt.data_objects.profiles.create_profile
So I type in:
profile = yt.create_profile(gal,
[('index', 'cylindrical_r')], # the bin field
[('gas', 'cell_mass')], # profile field
weight_field=None, logs=False)
Thanks again!
Stephaniestonnes@gmail.comCarnegie Observatories, Pasadena, CA--Alvin E. Nashman Postdoctoral Fellow
Dr. Stephanie TonnesenOn Mon, Nov 3, 2014 at 9:45 PM, Suoqing JI <suoqing@physics.ucsb.edu> wrote:Hi Stephanie,profile.add_fields(‘cell_mass’, weight=None)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:profile = BinnedProfile1D(mydisk, Nbin, 'cylindrical_r', rmin, rmax, log_space=True, lazy_reader=True, end_collect=False)profile.add_fields('cell_mass', weight=None)R = profile['cylindrical_r’]Sigma = profile[‘cell_mass']R_edge = np.logspace(np.log10(rmin), np.log10(rmax), num=Nbin+1)for i in range(0, Nbin): Sigma[i] = Sigma[i] / (np.pi*(R_edge[i+1]**2 - R_edge[i]**2.))And Nathan’s approach which takes the advantage of image buffer should also work.Best wishes,--Suoqing JIPh.D StudentDepartment of PhysicsUniversity of California, Santa BarbaraCA 93106, USAOn Nov 3, 2014, at 8:40 PM, Nathan Goldbaum <nathan12343@gmail.com> wrote:_______________________________________________On Mon, Nov 3, 2014 at 5:29 PM, Suoqing JI <suoqing@physics.ucsb.edu> wrote:Hi Stephanie,Maybe you could specify a disk, use BinnedProfile1D to create bins along cylindrical radial ('cylindrical_r'), and doprofile.add_fields(‘cell_mass’, weight=None)then you could plot profile[‘cell_mass’] vs. profile['cylindrical_r’] and get the 1-D plot the surface density.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.Best wishes,--Suoqing JIPh.D StudentDepartment of PhysicsUniversity of California, Santa BarbaraCA 93106, USAOn Nov 3, 2014, at 5:17 PM, Stephanie Tonnesen <stonnes@gmail.com> wrote:Hi yt-users,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?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:
http://nbviewer.ipython.org/gist/ngoldbaum/af8e7f317efe8f115e8bThis 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:
https://bitbucket.org/ngoldbaum/galaxy_analysis/src/910f5a7e278247a36f25d62bdc478a7b5a7fe8ce/galanyl/galaxy_analyzer.py?at=default#cl-338_______________________________________________Thanks!
Stephaniestonnes@gmail.comCarnegie Observatories, Pasadena, CA--Alvin E. Nashman Postdoctoral Fellow
Dr. Stephanie Tonnesen
yt-users mailing list
yt-users@lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________
yt-users mailing list
yt-users@lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
yt-users mailing list
yt-users@lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________
yt-users mailing list
yt-users@lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________
yt-users mailing list
yt-users@lists.spacepope.org
http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org