[yt-users] Loading ASCII VTK data

Nathan Goldbaum nathan12343 at gmail.com
Wed May 18 08:30:22 PDT 2016


On Mon, May 16, 2016 at 9:04 PM, Lukas Bystricky <lukasbystricky at gmail.com>
wrote:

> Hi all,
>
> I'm trying to load in some data from an ASCII VTK file (attached for
> reference) that I created following the guidelines here:
> http://www.vtk.org/wp-content/uploads/2015/04/file-formats.pdf. I can
> load this file into Visit and I was hoping that to load it into yt would be
> as simple as :
>
> ds = yt.load("lid_driven_cavity_20.vtk")
>
> When I try that however I get the error message:
>
> Traceback (most recent call last):
>   File "visualization.py", line 3, in <module>
>     ds = yt.load("lid_driven_cavity_20.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'
>

> Is it possible to load in such a file to yt?
>

We can read the VTK format output by the Athena code, which seems to be
similar but not identical to the file you're reading.


> If not, since I'm writing my own data file, how could I edit it to make it
> readable by yt?
>
>
If the data are small enough to fit in memory, you could load them in using
the stream frontend:

http://yt-project.org/docs/dev/examining/generic_array_data.html

In the long term, we should think about adding a frontend for the data
format described in the PDF you linked to. It could probably be based on
the Athena frontend. If you wanted to work on that, there are two other
people who are actively working on writing frontends right now for their
codes, so they should be able to help answer questions.


> Thanks in advance,
>
> Lukas
>
> _______________________________________________
> yt-users mailing list
> yt-users at lists.spacepope.org
> http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20160518/3da727f7/attachment.htm>


More information about the yt-users mailing list