[yt-users] getting abundance of elements contained within a sphere through Profile1D funcion
tazkera haque
h.tazkera at gmail.com
Thu Jun 30 07:10:19 PDT 2016
Hi,
I am trying to find abundance of C contained within a sphere through the
Profile1D function in yt. I tried something like this:
*ds=yt.load(filename)*
* sp = ds.sphere("max", (10.0, 'kpc'))*
* profile = yt.Profile1D(sp, "x", 32, rmin, rmax, False, weight_field=None)*
* profile.add_fields(["cell_mass"])*
* profile.add_fields(["c12 "])*
* profile.add_fields(["x"])*
*print profile ["cell_mass"].sum()/Msun*
*print profile ["c12 "]*["cell_mass"].sum()/Msun*
and got the following error:
* File "profile_1D.py", line 74, in <module>*
* print profile ((["c12 "]*["cell_mass"]).sum())/Msun*
*TypeError: can't multiply sequence by non-int of type 'list'*
*is there any way I can calculate the C12 abundance here?*
*Best*
*Tazkera*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20160630/1aa382ca/attachment.htm>
More information about the yt-users
mailing list