<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 16, 2016 at 9:04 PM, Lukas Bystricky <span dir="ltr"><<a href="mailto:lukasbystricky@gmail.com" target="_blank">lukasbystricky@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>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">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><br></div><div>ds = yt.load("lid_driven_cavity_20.vtk")</div><div><br></div><div>When I try that however I get the error message:</div><div><div><br></div><div>Traceback (most recent call last):</div><div>  File "visualization.py", line 3, in <module></div><div>    ds = yt.load("lid_driven_cavity_20.vtk")</div><div>  File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\convenience.py", line 84, in load</div><div>    return candidates[0](*args, **kwargs)</div><div>  File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\frontends\athena\data_structures.py", line 470, in __init__</div><div>    Dataset.__init__(self, filename, dataset_type, units_override=units_override)</div><div>  File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\data_objects\static_output.py", line 190, in __init__</div><div>    self._parse_parameter_file()</div><div>  File "C:\Users\Dave\Anaconda2\lib\site-packages\yt\frontends\athena\data_structures.py", line 528, in _parse_parameter_file</div><div>    self.domain_left_edge = grid['left_edge']</div><div>KeyError: 'left_edge'</div></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><br></div><div>Is it possible to load in such a file to yt? </div></div></div></blockquote><div><br></div><div>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.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div>If not, since I'm writing my own data file, how could I edit it to make it readable by yt?</div></div><div><br></div></div></blockquote><div><br></div><div>If the data are small enough to fit in memory, you could load them in using the stream frontend:</div><div><br></div><div><a href="http://yt-project.org/docs/dev/examining/generic_array_data.html">http://yt-project.org/docs/dev/examining/generic_array_data.html</a><br></div><div><br></div><div>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.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div></div><div>Thanks in advance,</div><div><br></div><div>Lukas</div></div>
<br>_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" rel="noreferrer" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
<br></blockquote></div><br></div></div>