I am trying to use ortho_ray. If I do: c = ds.find_max("temperature") coords = c[1] ray = ds.ortho_ray(0, (coords[1], coords[2])) and then plot ray["density"] vs. ray["x"] , I get a jumbled mess. Printing ray["x"], I see that it is not monotonic -- should I expect it to be? The docs seem to suggest that it would be sorted properly. -- Michael Zingale Associate Professor Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800 *phone*: 631-632-8225 *e-mail*: Michael.Zingale@stonybrook.edu *web*: http://www.astro.sunysb.edu/mzingale
On Tue, Jul 22, 2014 at 11:19 PM, Michael Zingale
I am trying to use ortho_ray.
If I do:
c = ds.find_max("temperature") coords = c[1]
ray = ds.ortho_ray(0, (coords[1], coords[2]))
and then plot ray["density"] vs. ray["x"] , I get a jumbled mess. Printing ray["x"], I see that it is not monotonic -- should I expect it to be? The docs seem to suggest that it would be sorted properly.
It's not sorted, no. You can sort via the 't' field, which sorts based on the parameter from start to finish. -Matt
-- Michael Zingale Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800 phone: 631-632-8225 e-mail: Michael.Zingale@stonybrook.edu web: http://www.astro.sunysb.edu/mzingale
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
ok, thanks. I'll take a look at the docs again, and if it was not obvious
there, I'll add a statement.
On Wed, Jul 23, 2014 at 12:15 PM, Matthew Turk
On Tue, Jul 22, 2014 at 11:19 PM, Michael Zingale
wrote: I am trying to use ortho_ray.
If I do:
c = ds.find_max("temperature") coords = c[1]
ray = ds.ortho_ray(0, (coords[1], coords[2]))
and then plot ray["density"] vs. ray["x"] , I get a jumbled mess. Printing ray["x"], I see that it is not monotonic -- should I expect it to be? The docs seem to suggest that it would be sorted properly.
It's not sorted, no. You can sort via the 't' field, which sorts based on the parameter from start to finish.
-Matt
-- Michael Zingale Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800 phone: 631-632-8225 e-mail: Michael.Zingale@stonybrook.edu web: http://www.astro.sunysb.edu/mzingale
_______________________________________________ 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
-- Michael Zingale Associate Professor Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800 *phone*: 631-632-8225 *e-mail*: Michael.Zingale@stonybrook.edu *web*: http://www.astro.sunysb.edu/mzingale
On Wed, Jul 23, 2014 at 11:29 AM, Michael Zingale
ok, thanks. I'll take a look at the docs again, and if it was not obvious there, I'll add a statement.
Ah! They used to be sorted. Right now the default chunking scheme is unsorted, and can do partial queries, so I think that's why it's not sorted. I can possibly fix this -- we put in a partial fix for non-ortho rays.
On Wed, Jul 23, 2014 at 12:15 PM, Matthew Turk
wrote: On Tue, Jul 22, 2014 at 11:19 PM, Michael Zingale
wrote: I am trying to use ortho_ray.
If I do:
c = ds.find_max("temperature") coords = c[1]
ray = ds.ortho_ray(0, (coords[1], coords[2]))
and then plot ray["density"] vs. ray["x"] , I get a jumbled mess. Printing ray["x"], I see that it is not monotonic -- should I expect it to be? The docs seem to suggest that it would be sorted properly.
It's not sorted, no. You can sort via the 't' field, which sorts based on the parameter from start to finish.
-Matt
-- Michael Zingale Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800 phone: 631-632-8225 e-mail: Michael.Zingale@stonybrook.edu web: http://www.astro.sunysb.edu/mzingale
_______________________________________________ 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
-- Michael Zingale Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800 phone: 631-632-8225 e-mail: Michael.Zingale@stonybrook.edu web: http://www.astro.sunysb.edu/mzingale
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
I'm not worried either way -- I just wanted to make sure there was not a
bug.
On Wed, Jul 23, 2014 at 12:30 PM, Matthew Turk
On Wed, Jul 23, 2014 at 11:29 AM, Michael Zingale
wrote: ok, thanks. I'll take a look at the docs again, and if it was not obvious there, I'll add a statement.
Ah! They used to be sorted. Right now the default chunking scheme is unsorted, and can do partial queries, so I think that's why it's not sorted. I can possibly fix this -- we put in a partial fix for non-ortho rays.
On Wed, Jul 23, 2014 at 12:15 PM, Matthew Turk
wrote: On Tue, Jul 22, 2014 at 11:19 PM, Michael Zingale
wrote: I am trying to use ortho_ray.
If I do:
c = ds.find_max("temperature") coords = c[1]
ray = ds.ortho_ray(0, (coords[1], coords[2]))
and then plot ray["density"] vs. ray["x"] , I get a jumbled mess. Printing ray["x"], I see that it is not monotonic -- should I expect it to be? The docs seem to suggest that it would be sorted properly.
It's not sorted, no. You can sort via the 't' field, which sorts based on the parameter from start to finish.
-Matt
-- Michael Zingale Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook,
NY
11794-3800 phone: 631-632-8225 e-mail: Michael.Zingale@stonybrook.edu web: http://www.astro.sunysb.edu/mzingale
_______________________________________________ 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
-- Michael Zingale Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800 phone: 631-632-8225 e-mail: Michael.Zingale@stonybrook.edu web: http://www.astro.sunysb.edu/mzingale
_______________________________________________ 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
-- Michael Zingale Associate Professor Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800 *phone*: 631-632-8225 *e-mail*: Michael.Zingale@stonybrook.edu *web*: http://www.astro.sunysb.edu/mzingale
Here's the doc I think refers to this, which says it's an order list: http://yt-project.org/docs/dev-3.0/reference/api/generated/yt.data_objects.s... I found this functionality via google. But I don't have a t field here. I can sort based on "x" though. On Wed, Jul 23, 2014 at 12:32 PM, Michael Zingale < michael.zingale@stonybrook.edu> wrote:
I'm not worried either way -- I just wanted to make sure there was not a bug.
On Wed, Jul 23, 2014 at 12:30 PM, Matthew Turk
wrote: On Wed, Jul 23, 2014 at 11:29 AM, Michael Zingale
wrote: ok, thanks. I'll take a look at the docs again, and if it was not obvious there, I'll add a statement.
Ah! They used to be sorted. Right now the default chunking scheme is unsorted, and can do partial queries, so I think that's why it's not sorted. I can possibly fix this -- we put in a partial fix for non-ortho rays.
On Wed, Jul 23, 2014 at 12:15 PM, Matthew Turk
wrote: On Tue, Jul 22, 2014 at 11:19 PM, Michael Zingale
wrote: I am trying to use ortho_ray.
If I do:
c = ds.find_max("temperature") coords = c[1]
ray = ds.ortho_ray(0, (coords[1], coords[2]))
and then plot ray["density"] vs. ray["x"] , I get a jumbled mess. Printing ray["x"], I see that it is not monotonic -- should I expect it to be? The docs seem to suggest that it would be sorted properly.
It's not sorted, no. You can sort via the 't' field, which sorts based on the parameter from start to finish.
-Matt
-- Michael Zingale Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook,
NY
11794-3800 phone: 631-632-8225 e-mail: Michael.Zingale@stonybrook.edu web: http://www.astro.sunysb.edu/mzingale
_______________________________________________ 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
-- Michael Zingale Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800 phone: 631-632-8225 e-mail: Michael.Zingale@stonybrook.edu web: http://www.astro.sunysb.edu/mzingale
_______________________________________________ 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
-- Michael Zingale Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800 *phone*: 631-632-8225 *e-mail*: Michael.Zingale@stonybrook.edu *web*: http://www.astro.sunysb.edu/mzingale
-- Michael Zingale Associate Professor Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800 *phone*: 631-632-8225 *e-mail*: Michael.Zingale@stonybrook.edu *web*: http://www.astro.sunysb.edu/mzingale
On Wed, Jul 23, 2014 at 10:07 AM, Michael Zingale < michael.zingale@stonybrook.edu> wrote:
Here's the doc I think refers to this, which says it's an order list:
http://yt-project.org/docs/dev-3.0/reference/api/generated/yt.data_objects.s...
I found this functionality via google. But I don't have a t field here. I can sort based on "x" though.
It's possible this docstring is out of date. I think it might be possible to fix this issue by adding a call to argsort in the ortho_ray's __getitem__, but I believe britton had trouble getting that to work when he tried it.
On Wed, Jul 23, 2014 at 12:32 PM, Michael Zingale < michael.zingale@stonybrook.edu> wrote:
I'm not worried either way -- I just wanted to make sure there was not a bug.
On Wed, Jul 23, 2014 at 12:30 PM, Matthew Turk
wrote: On Wed, Jul 23, 2014 at 11:29 AM, Michael Zingale
wrote: ok, thanks. I'll take a look at the docs again, and if it was not obvious there, I'll add a statement.
Ah! They used to be sorted. Right now the default chunking scheme is unsorted, and can do partial queries, so I think that's why it's not sorted. I can possibly fix this -- we put in a partial fix for non-ortho rays.
On Wed, Jul 23, 2014 at 12:15 PM, Matthew Turk
wrote: On Tue, Jul 22, 2014 at 11:19 PM, Michael Zingale
wrote: I am trying to use ortho_ray.
If I do:
c = ds.find_max("temperature") coords = c[1]
ray = ds.ortho_ray(0, (coords[1], coords[2]))
and then plot ray["density"] vs. ray["x"] , I get a jumbled mess. Printing ray["x"], I see that it is not monotonic -- should I expect it to
be?
The docs seem to suggest that it would be sorted properly.
It's not sorted, no. You can sort via the 't' field, which sorts based on the parameter from start to finish.
-Matt
-- Michael Zingale Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony
Brook, NY
11794-3800 phone: 631-632-8225 e-mail: Michael.Zingale@stonybrook.edu web: http://www.astro.sunysb.edu/mzingale
_______________________________________________ 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
-- Michael Zingale Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800 phone: 631-632-8225 e-mail: Michael.Zingale@stonybrook.edu web: http://www.astro.sunysb.edu/mzingale
_______________________________________________ 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
-- Michael Zingale Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800 *phone*: 631-632-8225 *e-mail*: Michael.Zingale@stonybrook.edu *web*: http://www.astro.sunysb.edu/mzingale
-- Michael Zingale Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800 *phone*: 631-632-8225 *e-mail*: Michael.Zingale@stonybrook.edu *web*: http://www.astro.sunysb.edu/mzingale
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
I'm fine with just fixing the docstring.
This worked for me:
x = ray["x"]
ix = argsort(x)
then I can plot any field indexed by ix
On Wed, Jul 23, 2014 at 1:12 PM, Nathan Goldbaum
On Wed, Jul 23, 2014 at 10:07 AM, Michael Zingale < michael.zingale@stonybrook.edu> wrote:
Here's the doc I think refers to this, which says it's an order list:
http://yt-project.org/docs/dev-3.0/reference/api/generated/yt.data_objects.s...
I found this functionality via google. But I don't have a t field here. I can sort based on "x" though.
It's possible this docstring is out of date.
I think it might be possible to fix this issue by adding a call to argsort in the ortho_ray's __getitem__, but I believe britton had trouble getting that to work when he tried it.
On Wed, Jul 23, 2014 at 12:32 PM, Michael Zingale < michael.zingale@stonybrook.edu> wrote:
I'm not worried either way -- I just wanted to make sure there was not a bug.
On Wed, Jul 23, 2014 at 12:30 PM, Matthew Turk
wrote: On Wed, Jul 23, 2014 at 11:29 AM, Michael Zingale
wrote: ok, thanks. I'll take a look at the docs again, and if it was not obvious there, I'll add a statement.
Ah! They used to be sorted. Right now the default chunking scheme is unsorted, and can do partial queries, so I think that's why it's not sorted. I can possibly fix this -- we put in a partial fix for non-ortho rays.
On Wed, Jul 23, 2014 at 12:15 PM, Matthew Turk
wrote:
On Tue, Jul 22, 2014 at 11:19 PM, Michael Zingale
wrote: > I am trying to use ortho_ray. > > If I do: > > > c = ds.find_max("temperature") > coords = c[1] > > ray = ds.ortho_ray(0, (coords[1], coords[2])) > > and then plot ray["density"] vs. ray["x"] , I get a jumbled mess. > Printing > ray["x"], I see that it is not monotonic -- should I expect it to be?
> The > docs seem to suggest that it would be sorted properly.
It's not sorted, no. You can sort via the 't' field, which sorts based on the parameter from start to finish.
-Matt
> > -- > Michael Zingale > Associate Professor > > Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY > 11794-3800 > phone: 631-632-8225 > e-mail: Michael.Zingale@stonybrook.edu > web: http://www.astro.sunysb.edu/mzingale > > _______________________________________________ > 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
-- Michael Zingale Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800 phone: 631-632-8225 e-mail: Michael.Zingale@stonybrook.edu web: http://www.astro.sunysb.edu/mzingale
_______________________________________________ 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
-- Michael Zingale Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800 *phone*: 631-632-8225 *e-mail*: Michael.Zingale@stonybrook.edu *web*: http://www.astro.sunysb.edu/mzingale
-- Michael Zingale Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800 *phone*: 631-632-8225 *e-mail*: Michael.Zingale@stonybrook.edu *web*: http://www.astro.sunysb.edu/mzingale
_______________________________________________ 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
-- Michael Zingale Associate Professor Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800 *phone*: 631-632-8225 *e-mail*: Michael.Zingale@stonybrook.edu *web*: http://www.astro.sunysb.edu/mzingale
On Wed, Jul 23, 2014 at 12:12 PM, Nathan Goldbaum
On Wed, Jul 23, 2014 at 10:07 AM, Michael Zingale
wrote: Here's the doc I think refers to this, which says it's an order list:
http://yt-project.org/docs/dev-3.0/reference/api/generated/yt.data_objects.s...
I found this functionality via google. But I don't have a t field here. I can sort based on "x" though.
It's possible this docstring is out of date.
I think it might be possible to fix this issue by adding a call to argsort in the ortho_ray's __getitem__, but I believe britton had trouble getting that to work when he tried it.
Yeah -- it works for chunking style "all" (which is the default if you do a __getitem__ on the object) but if you want to do parallel or chunk-by-chunk work, you can't sort the global array without first collecting it, so it is non-functional. i.e., internal to the chunks, the ordering will be different than external. -Matt
On Wed, Jul 23, 2014 at 12:32 PM, Michael Zingale
wrote: I'm not worried either way -- I just wanted to make sure there was not a bug.
On Wed, Jul 23, 2014 at 12:30 PM, Matthew Turk
wrote: On Wed, Jul 23, 2014 at 11:29 AM, Michael Zingale
wrote: ok, thanks. I'll take a look at the docs again, and if it was not obvious there, I'll add a statement.
Ah! They used to be sorted. Right now the default chunking scheme is unsorted, and can do partial queries, so I think that's why it's not sorted. I can possibly fix this -- we put in a partial fix for non-ortho rays.
On Wed, Jul 23, 2014 at 12:15 PM, Matthew Turk
wrote: On Tue, Jul 22, 2014 at 11:19 PM, Michael Zingale
wrote: > I am trying to use ortho_ray. > > If I do: > > > c = ds.find_max("temperature") > coords = c[1] > > ray = ds.ortho_ray(0, (coords[1], coords[2])) > > and then plot ray["density"] vs. ray["x"] , I get a jumbled mess. > Printing > ray["x"], I see that it is not monotonic -- should I expect it to > be? > The > docs seem to suggest that it would be sorted properly. It's not sorted, no. You can sort via the 't' field, which sorts based on the parameter from start to finish.
-Matt
> > -- > Michael Zingale > Associate Professor > > Dept. of Physics & Astronomy • Stony Brook University • Stony > Brook, NY > 11794-3800 > phone: 631-632-8225 > e-mail: Michael.Zingale@stonybrook.edu > web: http://www.astro.sunysb.edu/mzingale > > _______________________________________________ > 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
-- Michael Zingale Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800 phone: 631-632-8225 e-mail: Michael.Zingale@stonybrook.edu web: http://www.astro.sunysb.edu/mzingale
_______________________________________________ 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
-- Michael Zingale Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800 phone: 631-632-8225 e-mail: Michael.Zingale@stonybrook.edu web: http://www.astro.sunysb.edu/mzingale
-- Michael Zingale Associate Professor
Dept. of Physics & Astronomy • Stony Brook University • Stony Brook, NY 11794-3800 phone: 631-632-8225 e-mail: Michael.Zingale@stonybrook.edu web: http://www.astro.sunysb.edu/mzingale
_______________________________________________ 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
participants (3)
-
Matthew Turk
-
Michael Zingale
-
Nathan Goldbaum