Hello all, This is a followup to my question here ( http://lists.spacepope.org/pipermail/yt-users-spacepope.org/2016-May/007830....). Apologies, but I can't seem to figure out how to reply since I was never sent an e-mail for either my question or Nathan's response. I'm trying to load a legacy VTK file into YT (see format description http://www.vtk.org/wp-content/uploads/2015/04/file-formats.pdf), but I when I try: ds = yt.load("file.vtk") I get the error: traceback (most recent call last): File "visualization.py", line 3, in <module> ds = yt.load("file.vtk") File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\convenience.py", line 84, in load return candidates[0](*args, **kwargs) File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\frontends\athena\data_structures.py", line 470, in __init__ Dataset.__init__(self, filename, dataset_type, units_override=units_override) File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\data_objects\static_output.py", line 190, in __init__ self._parse_parameter_file() File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\frontends\athena\data_structures.py", line 528, in _parse_parameter_file self.domain_left_edge = grid['left_edge'] KeyError: 'left_edge' Nathan Goldbaum pointed out is his answer that YT can read in VTK files from Athena. I looked into this and it seems like the difference between my file and Athena's files is that mine are ASCII while Athena's are binary. Is that right? On another note, Nathan also pointed out there are people working on a frontend for the VTK format I'm using. Could I provide any help there? Thanks again, and sorry for the double posting. Lukas
Hi Lukas, I think Nathan's point was that there are other people working on new frontends currently, and they are smoothing over the instructions for how to make a new one. Probably the best thing to do in the short run is to figure out how to read your data in using the Athena frontend. If you have a sample dataset you can post somewhere for us to try that would help. I nominally maintain the Athena frontend, but I don't have a ton of time at the moment, so it sort of depends on how difficult it will be to make the changes in terms of how long it will take. If you're up for giving it a shot yourself I'm happy to give you pointers. Is this uniformly gridded data, or something else? Best, John ================================ John ZuHone, Chandra/ACIS Operations Harvard-Smithsonian Center for Astrophysics 60 Garden St., MS-67 (w) 617-496-1816 Cambridge, MA 02138. (m) 781-708-5004 john.zuhone@cfa.harvard.edu http://hea-www.cfa.harvard.edu/~jzuhone ================================
On May 29, 2016, at 3:41 PM, Lukas Bystricky
wrote: Hello all,
This is a followup to my question here (http://lists.spacepope.org/pipermail/yt-users-spacepope.org/2016-May/007830....). Apologies, but I can't seem to figure out how to reply since I was never sent an e-mail for either my question or Nathan's response.
I'm trying to load a legacy VTK file into YT (see format description http://www.vtk.org/wp-content/uploads/2015/04/file-formats.pdf), but I when I try:
ds = yt.load("file.vtk") I get the error: traceback (most recent call last): File "visualization.py", line 3, in <module> ds = yt.load("file.vtk") File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\convenience.py", line 84, in load return candidates[0](*args, **kwargs) File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\frontends\athena\data_structures.py", line 470, in __init__ Dataset.__init__(self, filename, dataset_type, units_override=units_override) File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\data_objects\static_output.py", line 190, in __init__ self._parse_parameter_file() File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\frontends\athena\data_structures.py", line 528, in _parse_parameter_file self.domain_left_edge = grid['left_edge'] KeyError: 'left_edge'
Nathan Goldbaum pointed out is his answer that YT can read in VTK files from Athena. I looked into this and it seems like the difference between my file and Athena's files is that mine are ASCII while Athena's are binary. Is that right?
On another note, Nathan also pointed out there are people working on a frontend for the VTK format I'm using. Could I provide any help there?
Thanks again, and sorry for the double posting.
Lukas
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
Thanks John for your quick response. I've attached a sample file VTK file
that I have. This is from a finite difference simulation, so grids will
always be uniform.
I found the Athena source code for how they write their VTK files (
http://www.astro.princeton.edu/~jstone/Athena/doxygen/html.with_source/outpu...)
and it looks similar to mine, except that theirs is in binary and they use
a different dataset structure.
I'm an extremely new YT user (and I've never done any YT development), so I
don't know how much help I'd be but if you'd like a hand developing a new
frontend let me know.
On Sun, May 29, 2016 at 4:08 PM, John ZuHone
Hi Lukas,
I think Nathan's point was that there are other people working on new frontends currently, and they are smoothing over the instructions for how to make a new one.
Probably the best thing to do in the short run is to figure out how to read your data in using the Athena frontend. If you have a sample dataset you can post somewhere for us to try that would help.
I nominally maintain the Athena frontend, but I don't have a ton of time at the moment, so it sort of depends on how difficult it will be to make the changes in terms of how long it will take. If you're up for giving it a shot yourself I'm happy to give you pointers.
Is this uniformly gridded data, or something else?
Best,
John
================================ John ZuHone, Chandra/ACIS Operations Harvard-Smithsonian Center for Astrophysics
60 Garden St., MS-67 (w) 617-496-1816 Cambridge, MA 02138. (m) 781-708-5004
john.zuhone@cfa.harvard.edu http://hea-www.cfa.harvard.edu/~jzuhone ================================
On May 29, 2016, at 3:41 PM, Lukas Bystricky
wrote: Hello all,
This is a followup to my question here ( http://lists.spacepope.org/pipermail/yt-users-spacepope.org/2016-May/007830....). Apologies, but I can't seem to figure out how to reply since I was never sent an e-mail for either my question or Nathan's response.
I'm trying to load a legacy VTK file into YT (see format description http://www.vtk.org/wp-content/uploads/2015/04/file-formats.pdf), but I when I try:
ds = yt.load("file.vtk")
I get the error:
traceback (most recent call last): File "visualization.py", line 3, in <module> ds = yt.load("file.vtk") File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\convenience.py", line 84, in load return candidates[0](*args, **kwargs) File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\frontends\athena\data_structures.py", line 470, in __init__ Dataset.__init__(self, filename, dataset_type, units_override=units_override) File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\data_objects\static_output.py", line 190, in __init__ self._parse_parameter_file() File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\frontends\athena\data_structures.py", line 528, in _parse_parameter_file self.domain_left_edge = grid['left_edge'] KeyError: 'left_edge'
Nathan Goldbaum pointed out is his answer that YT can read in VTK files from Athena. I looked into this and it seems like the difference between my file and Athena's files is that mine are ASCII while Athena's are binary. Is that right?
On another note, Nathan also pointed out there are people working on a frontend for the VTK format I'm using. Could I provide any help there?
Thanks again, and sorry for the double posting.
Lukas
_______________________________________________ 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 Lukas,
If I were in your shoes, probably the first thing I would do is just use
python to change your ascii file into a binary file outside yt, then see
what happens when you try and load the binary version into yt. If the
problem is just the file type that might be the easiest fix, and python
help pages make me think that changing your file from ascii to binary is
not super difficult.
Looking at my old Athena vtk files, there is a lot more info in the header
than you seem to have. You may have to manually put equivalent lines in
the header, but it seems pretty doable.
It may end up that you should just edit yt, but in the short term it may be
easier to make the file format changes necessary to use the athena reader.
Figuring out what those changes are may also help when trying to update a
frontend reader.
Best,
Stephanie
--
Dr. Stephanie Tonnesen
Alvin E. Nashman Postdoctoral Fellow
Carnegie Observatories, Pasadena, CA
stonnes@gmail.com
On Sun, May 29, 2016 at 1:36 PM, Lukas Bystricky
Thanks John for your quick response. I've attached a sample file VTK file that I have. This is from a finite difference simulation, so grids will always be uniform.
I found the Athena source code for how they write their VTK files ( http://www.astro.princeton.edu/~jstone/Athena/doxygen/html.with_source/outpu...) and it looks similar to mine, except that theirs is in binary and they use a different dataset structure.
I'm an extremely new YT user (and I've never done any YT development), so I don't know how much help I'd be but if you'd like a hand developing a new frontend let me know.
On Sun, May 29, 2016 at 4:08 PM, John ZuHone
wrote: Hi Lukas,
I think Nathan's point was that there are other people working on new frontends currently, and they are smoothing over the instructions for how to make a new one.
Probably the best thing to do in the short run is to figure out how to read your data in using the Athena frontend. If you have a sample dataset you can post somewhere for us to try that would help.
I nominally maintain the Athena frontend, but I don't have a ton of time at the moment, so it sort of depends on how difficult it will be to make the changes in terms of how long it will take. If you're up for giving it a shot yourself I'm happy to give you pointers.
Is this uniformly gridded data, or something else?
Best,
John
================================ John ZuHone, Chandra/ACIS Operations Harvard-Smithsonian Center for Astrophysics
60 Garden St., MS-67 (w) 617-496-1816 Cambridge, MA 02138. (m) 781-708-5004
john.zuhone@cfa.harvard.edu http://hea-www.cfa.harvard.edu/~jzuhone ================================
On May 29, 2016, at 3:41 PM, Lukas Bystricky
wrote: Hello all,
This is a followup to my question here ( http://lists.spacepope.org/pipermail/yt-users-spacepope.org/2016-May/007830....). Apologies, but I can't seem to figure out how to reply since I was never sent an e-mail for either my question or Nathan's response.
I'm trying to load a legacy VTK file into YT (see format description http://www.vtk.org/wp-content/uploads/2015/04/file-formats.pdf), but I when I try:
ds = yt.load("file.vtk")
I get the error:
traceback (most recent call last): File "visualization.py", line 3, in <module> ds = yt.load("file.vtk") File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\convenience.py", line 84, in load return candidates[0](*args, **kwargs) File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\frontends\athena\data_structures.py", line 470, in __init__ Dataset.__init__(self, filename, dataset_type, units_override=units_override) File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\data_objects\static_output.py", line 190, in __init__ self._parse_parameter_file() File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\frontends\athena\data_structures.py", line 528, in _parse_parameter_file self.domain_left_edge = grid['left_edge'] KeyError: 'left_edge'
Nathan Goldbaum pointed out is his answer that YT can read in VTK files from Athena. I looked into this and it seems like the difference between my file and Athena's files is that mine are ASCII while Athena's are binary. Is that right?
On another note, Nathan also pointed out there are people working on a frontend for the VTK format I'm using. Could I provide any help there?
Thanks again, and sorry for the double posting.
Lukas
_______________________________________________ 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
This is probably a good first-pass solution—I’m finding at first glance that the changes to the Athena frontend to handle ASCII files are not trivial. Doable, but not trivial. Also, Lukas, is your data vertex-centered or cell-centered?
On May 31, 2016, at 1:43 PM, Stephanie Tonnesen
wrote: Hi Lukas,
If I were in your shoes, probably the first thing I would do is just use python to change your ascii file into a binary file outside yt, then see what happens when you try and load the binary version into yt. If the problem is just the file type that might be the easiest fix, and python help pages make me think that changing your file from ascii to binary is not super difficult.
Looking at my old Athena vtk files, there is a lot more info in the header than you seem to have. You may have to manually put equivalent lines in the header, but it seems pretty doable.
It may end up that you should just edit yt, but in the short term it may be easier to make the file format changes necessary to use the athena reader. Figuring out what those changes are may also help when trying to update a frontend reader.
Best, Stephanie
-- Dr. Stephanie Tonnesen Alvin E. Nashman Postdoctoral Fellow Carnegie Observatories, Pasadena, CA stonnes@gmail.com mailto:stonnes@gmail.com
On Sun, May 29, 2016 at 1:36 PM, Lukas Bystricky
mailto:lukasbystricky@gmail.com> wrote: Thanks John for your quick response. I've attached a sample file VTK file that I have. This is from a finite difference simulation, so grids will always be uniform. I found the Athena source code for how they write their VTK files (http://www.astro.princeton.edu/~jstone/Athena/doxygen/html.with_source/outpu... http://www.astro.princeton.edu/~jstone/Athena/doxygen/html.with_source/outpu...) and it looks similar to mine, except that theirs is in binary and they use a different dataset structure.
I'm an extremely new YT user (and I've never done any YT development), so I don't know how much help I'd be but if you'd like a hand developing a new frontend let me know.
On Sun, May 29, 2016 at 4:08 PM, John ZuHone
mailto:jzuhone@gmail.com> wrote: Hi Lukas, I think Nathan's point was that there are other people working on new frontends currently, and they are smoothing over the instructions for how to make a new one.
Probably the best thing to do in the short run is to figure out how to read your data in using the Athena frontend. If you have a sample dataset you can post somewhere for us to try that would help.
I nominally maintain the Athena frontend, but I don't have a ton of time at the moment, so it sort of depends on how difficult it will be to make the changes in terms of how long it will take. If you're up for giving it a shot yourself I'm happy to give you pointers.
Is this uniformly gridded data, or something else?
Best,
John
================================ John ZuHone, Chandra/ACIS Operations Harvard-Smithsonian Center for Astrophysics
60 Garden St. <>, MS-67 (w) 617-496-1816 tel:617-496-1816 Cambridge, MA 02138 <>. (m) 781-708-5004 tel:781-708-5004
john.zuhone@cfa.harvard.edu mailto:john.zuhone@cfa.harvard.edu http://hea-www.cfa.harvard.edu/~jzuhone http://hea-www.cfa.harvard.edu/~jzuhone ================================
On May 29, 2016, at 3:41 PM, Lukas Bystricky
mailto:lukasbystricky@gmail.com> wrote: Hello all,
This is a followup to my question here (http://lists.spacepope.org/pipermail/yt-users-spacepope.org/2016-May/007830.... http://lists.spacepope.org/pipermail/yt-users-spacepope.org/2016-May/007830....). Apologies, but I can't seem to figure out how to reply since I was never sent an e-mail for either my question or Nathan's response.
I'm trying to load a legacy VTK file into YT (see format description http://www.vtk.org/wp-content/uploads/2015/04/file-formats.pdf http://www.vtk.org/wp-content/uploads/2015/04/file-formats.pdf), but I when I try:
ds = yt.load("file.vtk") I get the error: traceback (most recent call last): File "visualization.py", line 3, in <module> ds = yt.load("file.vtk") File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\convenience.py", line 84, in load return candidates[0](*args, **kwargs) File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\frontends\athena\data_structures.py", line 470, in __init__ Dataset.__init__(self, filename, dataset_type, units_override=units_override) File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\data_objects\static_output.py", line 190, in __init__ self._parse_parameter_file() File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\frontends\athena\data_structures.py", line 528, in _parse_parameter_file self.domain_left_edge = grid['left_edge'] KeyError: 'left_edge'
Nathan Goldbaum pointed out is his answer that YT can read in VTK files from Athena. I looked into this and it seems like the difference between my file and Athena's files is that mine are ASCII while Athena's are binary. Is that right?
On another note, Nathan also pointed out there are people working on a frontend for the VTK format I'm using. Could I provide any help there?
Thanks again, and sorry for the double posting.
Lukas
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org mailto:yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org mailto:yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
_______________________________________________ yt-users mailing list yt-users@lists.spacepope.org mailto:yt-users@lists.spacepope.org http://lists.spacepope.org/listinfo.cgi/yt-users-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
If you're able to read your data into Python outside yt, the oath of least
resistance would most likely be to use load_uniform_grid rather than trying
to emulate Athena VTK files.
If you can load your data using load_uniform_grid, that would also be a
good place to start to figure out what it would take to write a frontend
for this data format.
On Tuesday, May 31, 2016, John ZuHone
This is probably a good first-pass solution—I’m finding at first glance that the changes to the Athena frontend to handle ASCII files are not trivial. Doable, but not trivial.
Also, Lukas, is your data vertex-centered or cell-centered?
On May 31, 2016, at 1:43 PM, Stephanie Tonnesen
javascript:_e(%7B%7D,'cvml','stonnes@gmail.com');> wrote: Hi Lukas,
If I were in your shoes, probably the first thing I would do is just use python to change your ascii file into a binary file outside yt, then see what happens when you try and load the binary version into yt. If the problem is just the file type that might be the easiest fix, and python help pages make me think that changing your file from ascii to binary is not super difficult.
Looking at my old Athena vtk files, there is a lot more info in the header than you seem to have. You may have to manually put equivalent lines in the header, but it seems pretty doable.
It may end up that you should just edit yt, but in the short term it may be easier to make the file format changes necessary to use the athena reader. Figuring out what those changes are may also help when trying to update a frontend reader.
Best, Stephanie
-- Dr. Stephanie Tonnesen Alvin E. Nashman Postdoctoral Fellow Carnegie Observatories, Pasadena, CA stonnes@gmail.com javascript:_e(%7B%7D,'cvml','stonnes@gmail.com');
On Sun, May 29, 2016 at 1:36 PM, Lukas Bystricky
javascript:_e(%7B%7D,'cvml','lukasbystricky@gmail.com');> wrote: Thanks John for your quick response. I've attached a sample file VTK file that I have. This is from a finite difference simulation, so grids will always be uniform.
I found the Athena source code for how they write their VTK files ( http://www.astro.princeton.edu/~jstone/Athena/doxygen/html.with_source/outpu...) and it looks similar to mine, except that theirs is in binary and they use a different dataset structure.
I'm an extremely new YT user (and I've never done any YT development), so I don't know how much help I'd be but if you'd like a hand developing a new frontend let me know.
On Sun, May 29, 2016 at 4:08 PM, John ZuHone
javascript:_e(%7B%7D,'cvml','jzuhone@gmail.com');> wrote: Hi Lukas,
I think Nathan's point was that there are other people working on new frontends currently, and they are smoothing over the instructions for how to make a new one.
Probably the best thing to do in the short run is to figure out how to read your data in using the Athena frontend. If you have a sample dataset you can post somewhere for us to try that would help.
I nominally maintain the Athena frontend, but I don't have a ton of time at the moment, so it sort of depends on how difficult it will be to make the changes in terms of how long it will take. If you're up for giving it a shot yourself I'm happy to give you pointers.
Is this uniformly gridded data, or something else?
Best,
John
================================ John ZuHone, Chandra/ACIS Operations Harvard-Smithsonian Center for Astrophysics
60 Garden St., MS-67 (w) 617-496-1816 Cambridge, MA 02138. (m) 781-708-5004
john.zuhone@cfa.harvard.edu javascript:_e(%7B%7D,'cvml','john.zuhone@cfa.harvard.edu'); http://hea-www.cfa.harvard.edu/~jzuhone ================================
On May 29, 2016, at 3:41 PM, Lukas Bystricky
javascript:_e(%7B%7D,'cvml','lukasbystricky@gmail.com');> wrote: Hello all,
This is a followup to my question here ( http://lists.spacepope.org/pipermail/yt-users-spacepope.org/2016-May/007830....). Apologies, but I can't seem to figure out how to reply since I was never sent an e-mail for either my question or Nathan's response.
I'm trying to load a legacy VTK file into YT (see format description http://www.vtk.org/wp-content/uploads/2015/04/file-formats.pdf), but I when I try:
ds = yt.load("file.vtk")
I get the error:
traceback (most recent call last): File "visualization.py", line 3, in <module> ds = yt.load("file.vtk") File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\convenience.py", line 84, in load return candidates[0](*args, **kwargs) File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\frontends\athena\data_structures.py", line 470, in __init__ Dataset.__init__(self, filename, dataset_type, units_override=units_override) File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\data_objects\static_output.py", line 190, in __init__ self._parse_parameter_file() File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\frontends\athena\data_structures.py", line 528, in _parse_parameter_file self.domain_left_edge = grid['left_edge'] KeyError: 'left_edge'
Nathan Goldbaum pointed out is his answer that YT can read in VTK files from Athena. I looked into this and it seems like the difference between my file and Athena's files is that mine are ASCII while Athena's are binary. Is that right?
On another note, Nathan also pointed out there are people working on a frontend for the VTK format I'm using. Could I provide any help there?
Thanks again, and sorry for the double posting.
Lukas
_______________________________________________ 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
_______________________________________________ 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
participants (4)
-
John ZuHone
-
Lukas Bystricky
-
Nathan Goldbaum
-
Stephanie Tonnesen