<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Hi Lukas,<div class=""><br class=""></div><div class="">At the moment, to my knowledge we do not handle staggered grids at all, unfortunately. </div><div class=""><br class=""></div><div class="">Interpolating everything to the cell-centered grid would make the most sense at least for yt. </div><div class=""><br class=""></div><div class="">I suppose then the VTK file would have to be “structured_points” or something similar. </div><div class=""><br class=""></div><div class="">Best,</div><div class=""><br class=""></div><div class="">John</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Jun 2, 2016, at 4:47 PM, Lukas Bystricky <<a href="mailto:lukasbystricky@gmail.com" class="">lukasbystricky@gmail.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hi John,<div class=""><br class=""></div><div class="">Yes, sorry it is vertex centered, I forgot to mention that. The data comes from a staggered grid however, (the velocities and pressures defined on separate grids); currently I'm just interpolating everything to the same grid. In principle I could interpolate everything to a cell centered grid (which is the native grid for the pressure), but I'd have to think about how to handle boundary conditions in that case. Does YT handle staggered grids in a natural way?  </div><div class=""><br class=""></div><div class="">Thanks again,</div><div class=""><br class=""></div><div class="">Lukas</div></div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Thu, Jun 2, 2016 at 3:49 PM, John Zuhone <span dir="ltr" class=""><<a href="mailto:jzuhone@gmail.com" target="_blank" class="">jzuhone@gmail.com</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word" class="">Hi Lukas,<div class=""><br class=""></div><div class="">So I was actually able to convert your file to binary VTK and get started with it in yt, but I hit a roadblock. </div><div class=""><br class=""></div><div class="">Your data is “vertex-centered” in our parlance, but we don’t as of yet support vertex-centered data. </div><div class=""><br class=""></div><div class="">If you can convert to cell-centered data, we can probably support you out of the box, but for now vertex-centered data is not yet implemented. </div><div class=""><br class=""></div><div class="">For example, here is what the header for an Athena VTK file looks like:</div><div class=""><br class=""></div><div class=""><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class=""><span class=""># vtk DataFile Version 3.0</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class=""><span class="">PRIMITIVE vars at time= 2.700111e+03, level= 0, domain= 0</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class=""><span class="">BINARY</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class=""><span class="">DATASET STRUCTURED_POINTS</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class=""><span class="">DIMENSIONS 257 257 257</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class=""><span class="">ORIGIN -2.000000e+00 -2.000000e+00 -2.000000e+00</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class=""><span class="">SPACING 1.562500e-02 1.562500e-02 1.562500e-02</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class=""><span class="">CELL_DATA 16777216</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class=""><span class="">SCALARS density float</span></div><div style="margin:0px;font-size:11px;line-height:normal;font-family:Menlo" class=""><span class="">LOOKUP_TABLE default</span></div><div class=""><span class=""><br class=""></span></div><div class=""><span class="">Let us know…</span></div><div class=""><span class=""><br class=""></span></div><div class=""><span class="">John</span></div><div class=""><span class=""><br class=""></span></div><div class=""><blockquote type="cite" class=""><div class=""><div class="h5"><div class="">On May 16, 2016, at 10:04 PM, Lukas Bystricky <<a href="mailto:lukasbystricky@gmail.com" target="_blank" class="">lukasbystricky@gmail.com</a>> wrote:</div><br class=""></div></div><div class=""><div class=""><div class="h5"><div dir="ltr" class="">Hi all,<div class=""><br class=""></div><div class="">I'm trying to load in some data from an ASCII VTK file (attached for reference) that I created following the guidelines here: <a href="http://www.vtk.org/wp-content/uploads/2015/04/file-formats.pdf" target="_blank" class="">http://www.vtk.org/wp-content/uploads/2015/04/file-formats.pdf</a>. I can load this file into Visit and I was hoping that to load it into yt would be as simple as :</div><div class=""><br class=""></div><div class="">ds = yt.load("lid_driven_cavity_20.vtk")</div><div class=""><br class=""></div><div class="">When I try that however I get the error message:</div><div class=""><div class=""><br class=""></div><div class="">Traceback (most recent call last):</div><div class="">  File "visualization.py", line 3, in <module></div><div class="">    ds = yt.load("lid_driven_cavity_20.vtk")</div><div class="">  File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\convenience.py", line 84, in load</div><div class="">    return candidates[0](*args, **kwargs)</div><div class="">  File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\frontends\athena\data_structures.py", line 470, in __init__</div><div class="">    Dataset.__init__(self, filename, dataset_type, units_override=units_override)</div><div class="">  File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\data_objects\static_output.py", line 190, in __init__</div><div class="">    self._parse_parameter_file()</div><div class="">  File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\frontends\athena\data_structures.py", line 528, in _parse_parameter_file</div><div class="">    self.domain_left_edge = grid['left_edge']</div><div class="">KeyError: 'left_edge'</div><div class=""><br class=""></div><div class="">Is it possible to load in such a file to yt? If not, since I'm writing my own data file, how could I edit it to make it readable by yt?</div></div><div class=""><br class=""></div><div class="">Thanks in advance,</div><div class=""><br class=""></div><div class="">Lukas</div></div>
</div></div><span class=""><lid_driven_cavity_20.vtk></span>_______________________________________________<br class="">yt-users mailing list<br class=""><a href="mailto:yt-users@lists.spacepope.org" target="_blank" class="">yt-users@lists.spacepope.org</a><br class=""><a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank" class="">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br class=""></div></blockquote></div><br class=""></div></div><br class="">_______________________________________________<br class="">
yt-users mailing list<br class="">
<a href="mailto:yt-users@lists.spacepope.org" class="">yt-users@lists.spacepope.org</a><br class="">
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank" class="">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br class="">
<br class=""></blockquote></div><br class=""></div>
_______________________________________________<br class="">yt-users mailing list<br class=""><a href="mailto:yt-users@lists.spacepope.org" class="">yt-users@lists.spacepope.org</a><br class="">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org<br class=""></div></blockquote></div><br class=""></div></body></html>