Hi all,
I'm trying to plot the density profile of a 1D simulation, but can't find any instruction on how to do this.
I tried ray=pf.h.ortho_ray(0,[ord1,ord2]) with several different ord1 and ord2, including [0.5, 0.5]; while "ray['x']" returns an array of values, "ray[FieldName]" (where FieldName can be Density, TotalEnergy, GasEnergy, etc) returns nothing but "YTArray([],dtype=float 64) (dimensionless)".
Using ortho_ray on the 2D simulation of the same problem gives correct answer. Also, the "all_data" and "sphere" object do not work for 1D (they work for 2D, too).
Thanks,
Hao
I just did the following (after using the patch to BoxLib 1-d data) here:
https://bitbucket.org/yt_analysis/yt/pull-request/1153/fixe-to-boxlib-geomet...
import yt
ds = yt.load("sod_x_plt00032") dd = ds.all_data()
import numpy as np x = dd["x"] ix = np.argsort(x)
import pylab pylab.plot(x[ix], dd["density"][ix]) pylab.savefig("test.png")
and this gave me a nice plot of the 1-d data. This is using the latest development version of yt.
On Tue, Aug 19, 2014 at 4:39 AM, Hao Wang hwang.phy@gmail.com wrote:
Hi all,
I'm trying to plot the density profile of a 1D simulation, but can't find any instruction on how to do this.
I tried ray=pf.h.ortho_ray(0,[ord1,ord2]) with several different ord1 and ord2, including [0.5, 0.5]; while "ray['x']" returns an array of values, "ray[FieldName]" (where FieldName can be Density, TotalEnergy, GasEnergy, etc) returns nothing but "YTArray([],dtype=float 64) (dimensionless)".
Using ortho_ray on the 2D simulation of the same problem gives correct answer. Also, the "all_data" and "sphere" object do not work for 1D (they work for 2D, too).
Thanks,
Hao
yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
I'm able to reproduce this using an Enzo Sod Shock dataset I just generated. Thanks for the report!
Next time you come across something like this please feel free to open an issue on the bug tracker. It also helps if you say which simulation code you're working with and which yt version you're using.
I've opened an issue on our bug tracker about this: https://bitbucket.org/yt_analysis/yt/issue/883/1d-enzo-data-is-incorrectly-p...
On Tue, Aug 19, 2014 at 1:39 AM, Hao Wang hwang.phy@gmail.com wrote:
Hi all,
I'm trying to plot the density profile of a 1D simulation, but can't find any instruction on how to do this.
I tried ray=pf.h.ortho_ray(0,[ord1,ord2]) with several different ord1 and ord2, including [0.5, 0.5]; while "ray['x']" returns an array of values, "ray[FieldName]" (where FieldName can be Density, TotalEnergy, GasEnergy, etc) returns nothing but "YTArray([],dtype=float 64) (dimensionless)".
Using ortho_ray on the 2D simulation of the same problem gives correct answer. Also, the "all_data" and "sphere" object do not work for 1D (they work for 2D, too).
Thanks,
Hao
yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hi, Michael and Nathan,
Thanks for your replies.
@Michael: I tried your solution, but it didn't solve my problem. I updated to yt 3.1-dev which included the patch you mentioned. Might be due to the difference in the data?
I just changed to yt 2.x branch which has no such problem and gives desired plots.
(And sorry I did forget to mention that my data was from Enzo simulation, and I was using yt 3.0-stable then.)
Hao
On Wed, Aug 20, 2014 at 1:29 AM, Nathan Goldbaum nathan12343@gmail.com wrote:
I'm able to reproduce this using an Enzo Sod Shock dataset I just generated. Thanks for the report!
Next time you come across something like this please feel free to open an issue on the bug tracker. It also helps if you say which simulation code you're working with and which yt version you're using.
I've opened an issue on our bug tracker about this: https://bitbucket.org/yt_analysis/yt/issue/883/1d-enzo-data-is-incorrectly-p...
On Tue, Aug 19, 2014 at 1:39 AM, Hao Wang hwang.phy@gmail.com wrote:
Hi all,
I'm trying to plot the density profile of a 1D simulation, but can't find any instruction on how to do this.
I tried ray=pf.h.ortho_ray(0,[ord1,ord2]) with several different ord1 and ord2, including [0.5, 0.5]; while "ray['x']" returns an array of values, "ray[FieldName]" (where FieldName can be Density, TotalEnergy, GasEnergy, etc) returns nothing but "YTArray([],dtype=float 64) (dimensionless)".
Using ortho_ray on the 2D simulation of the same problem gives correct answer. Also, the "all_data" and "sphere" object do not work for 1D (they work for 2D, too).
Thanks,
Hao
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
Hi Hao,
I have an open PR that should fix the issue you ran into:
https://bitbucket.org/yt_analysis/yt/pull-requests
Nathan
On Tuesday, August 19, 2014, Hao Wang hwang.phy@gmail.com wrote:
Hi, Michael and Nathan,
Thanks for your replies.
@Michael: I tried your solution, but it didn't solve my problem. I updated to yt 3.1-dev which included the patch you mentioned. Might be due to the difference in the data?
I just changed to yt 2.x branch which has no such problem and gives desired plots.
(And sorry I did forget to mention that my data was from Enzo simulation, and I was using yt 3.0-stable then.)
Hao
On Wed, Aug 20, 2014 at 1:29 AM, Nathan Goldbaum <nathan12343@gmail.com javascript:_e(%7B%7D,'cvml','nathan12343@gmail.com');> wrote:
I'm able to reproduce this using an Enzo Sod Shock dataset I just generated. Thanks for the report!
Next time you come across something like this please feel free to open an issue on the bug tracker. It also helps if you say which simulation code you're working with and which yt version you're using.
I've opened an issue on our bug tracker about this: https://bitbucket.org/yt_analysis/yt/issue/883/1d-enzo-data-is-incorrectly-p...
On Tue, Aug 19, 2014 at 1:39 AM, Hao Wang <hwang.phy@gmail.com javascript:_e(%7B%7D,'cvml','hwang.phy@gmail.com');> wrote:
Hi all,
I'm trying to plot the density profile of a 1D simulation, but can't find any instruction on how to do this.
I tried ray=pf.h.ortho_ray(0,[ord1,ord2]) with several different ord1 and ord2, including [0.5, 0.5]; while "ray['x']" returns an array of values, "ray[FieldName]" (where FieldName can be Density, TotalEnergy, GasEnergy, etc) returns nothing but "YTArray([],dtype=float 64) (dimensionless)".
Using ortho_ray on the 2D simulation of the same problem gives correct answer. Also, the "all_data" and "sphere" object do not work for 1D (they work for 2D, too).
Thanks,
Hao
yt-users mailing list yt-users@lists.spacepope.org javascript:_e(%7B%7D,'cvml','yt-users@lists.spacepope.org'); http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
yt-users mailing list yt-users@lists.spacepope.org javascript:_e(%7B%7D,'cvml','yt-users@lists.spacepope.org'); http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
-- WANG Hao
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Hi Nathan,
Just get back to work. Yes, now it works. Thanks!
Hao
On Wed, Aug 20, 2014 at 3:11 PM, Nathan Goldbaum nathan12343@gmail.com wrote:
Hi Hao,
I have an open PR that should fix the issue you ran into:
https://bitbucket.org/yt_analysis/yt/pull-requests
Nathan
On Tuesday, August 19, 2014, Hao Wang hwang.phy@gmail.com wrote:
Hi, Michael and Nathan,
Thanks for your replies.
@Michael: I tried your solution, but it didn't solve my problem. I updated to yt 3.1-dev which included the patch you mentioned. Might be due to the difference in the data?
I just changed to yt 2.x branch which has no such problem and gives desired plots.
(And sorry I did forget to mention that my data was from Enzo simulation, and I was using yt 3.0-stable then.)
Hao
On Wed, Aug 20, 2014 at 1:29 AM, Nathan Goldbaum nathan12343@gmail.com wrote:
I'm able to reproduce this using an Enzo Sod Shock dataset I just generated. Thanks for the report!
Next time you come across something like this please feel free to open an issue on the bug tracker. It also helps if you say which simulation code you're working with and which yt version you're using.
I've opened an issue on our bug tracker about this: https://bitbucket.org/yt_analysis/yt/issue/883/1d-enzo-data-is-incorrectly-p...
On Tue, Aug 19, 2014 at 1:39 AM, Hao Wang hwang.phy@gmail.com wrote:
Hi all,
I'm trying to plot the density profile of a 1D simulation, but can't find any instruction on how to do this.
I tried ray=pf.h.ortho_ray(0,[ord1,ord2]) with several different ord1 and ord2, including [0.5, 0.5]; while "ray['x']" returns an array of values, "ray[FieldName]" (where FieldName can be Density, TotalEnergy, GasEnergy, etc) returns nothing but "YTArray([],dtype=float 64) (dimensionless)".
Using ortho_ray on the 2D simulation of the same problem gives correct answer. Also, the "all_data" and "sphere" object do not work for 1D (they work for 2D, too).
Thanks,
Hao
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
-- WANG Hao
yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org