[yt-users] BinnedProfile1D
Jean-Claude Passy
jcpassy at gmail.com
Fri Sep 3 17:35:29 PDT 2010
Hi all,
I need to get radial profiles of my sims - like density as a function or
radius. I know how to plot them using the method pc.add_profile_sphere
but I now need to print out the values in a txt file. For this reason, I
tried to use the class BinnedProfile1D. Below is my script:
##################################
file = 'DD0000/CommonEnvelope0021'
pf = load(file)
r_min = pf.h.get_smallest_dx()
r_max = 0.4
sphere = pf.h.sphere([0.5, 0.5, 0.5], r_max)
prof1d = L.BinnedProfile1D(sphere, 32, "Radius", r_min,
r_max,log_space=False, lazy_reader=True)
prof1d.add_fields("Density")
prof1d.write_out('test.txt','%0.6e','left')
##################################
It run well but returned a density profile equal to 0:
##############################
[17:25:54] litai05:$ more test.txt
# Radius Density
7.812500e-03 0.000000e+00
2.006836e-02 0.000000e+00
3.232422e-02 0.000000e+00
4.458008e-02 0.000000e+00
5.683594e-02 0.000000e+00
6.909180e-02 0.000000e+00
8.134766e-02 0.000000e+00
9.360352e-02 0.000000e+00
1.058594e-01 0.000000e+00
1.181152e-01 0.000000e+00
1.303711e-01 0.000000e+00
1.426270e-01 0.000000e+00
1.548828e-01 0.000000e+00
1.671387e-01 0.000000e+00
1.793945e-01 0.000000e+00
1.916504e-01 0.000000e+00
2.039063e-01 0.000000e+00
2.161621e-01 0.000000e+00
2.284180e-01 0.000000e+00
2.406738e-01 0.000000e+00
2.529297e-01 0.000000e+00
2.651855e-01 0.000000e+00
2.774414e-01 0.000000e+00
2.896973e-01 0.000000e+00
3.019531e-01 0.000000e+00
3.142090e-01 0.000000e+00
3.264648e-01 0.000000e+00
3.387207e-01 0.000000e+00
3.509766e-01 0.000000e+00
3.632324e-01 0.000000e+00
3.754883e-01 0.000000e+00
3.877441e-01 0.000000e+00
##############################
Could someone tell me what I am doing wrong ?
Thanks,
JC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20100903/1a5c666f/attachment.htm>
More information about the yt-users
mailing list