Hi Matthew,<br><br>It depends, what do you mean by "helping us"? As I said I'm new to python (and to visualization in general, my work is more focused on I/O). Yet I can tell you what my use cases are, what I would like to be able to do with YT, and give feedbacks on the API and documentation when they are ready.<div>
<br></div><div>I should mention also that my current work involves building a simulation's side library to uniformly and easily integrate multiple visualization backends (YT, matplotlib, VisIt, etc.) in simulations. VisIt provides a way to instrument simulations to act as visualization engines when required, and by embedding python like Enzo does one can transfert data from the simulation to YT or matplotlib. The goal would be to make this data exposure more transparent and more generic. Thus I'm following your progress with a lot of interest, as the way YT can work from in-memory data immediately impacts the design of my library.</div>
<div>
<br>Matthieu</div><div><br><div class="gmail_quote">2011/11/8 Matthew Turk <span dir="ltr"><<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Hi Matthieu,<br>
<br>
There's been quite a bit of interest in providing data to yt from<br>
in-memory datasets.  You can try something like this:<br>
<br>
<a href="http://hg.yt-project.org/yt/wiki/InterfacingWithYT" target="_blank">http://hg.yt-project.org/yt/wiki/InterfacingWithYT</a><br>
<br>
The idea would be that if you *have* the arrays, you should be able to<br>
describe their mesh to yt very easily.  Unfortunately, the API is as<br>
you can see clunky.  But I must warn you, the interface is in flux.<br>
Fixing this up is a goal for the month of December, both documentation<br>
and API-wise.  Would you be interested in helping us make this process<br>
more streamlined?<br>
<br>
-Matt<br>
<br>
On Tue, Nov 8, 2011 at 2:31 PM, Matthieu Dorier<br>
<div><div><<a href="mailto:matthieu.dorier@gmail.com" target="_blank">matthieu.dorier@gmail.com</a>> wrote:<br>
> Thanks, I managed to make what I wanted with matplotlib.<br>
><br>
> Matthieu<br>
><br>
> 2011/11/8 Britton Smith <<a href="mailto:brittonsmith@gmail.com" target="_blank">brittonsmith@gmail.com</a>><br>
>><br>
>> Hi Matthieu,<br>
>><br>
>> If you already have arrays that you are ready to plot, you are probably<br>
>> better going straight to matplotlib from here.  You can find their<br>
>> documentation here: <a href="http://matplotlib.sourceforge.net/" target="_blank">http://matplotlib.sourceforge.net/</a><br>
>> This is the package used for most of the plotting and visualization that<br>
>> yt does.<br>
>><br>
>> For example, you would probably want to use pcolormesh to plot up a 2D<br>
>> numpy array:<br>
>><br>
>> <a href="http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.pcolormesh" target="_blank">http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.pcolormesh</a><br>
>><br>
>> Britton<br>
>><br>
>> On Tue, Nov 8, 2011 at 8:50 AM, Matthieu Dorier<br>
>> <<a href="mailto:matthieu.dorier@gmail.com" target="_blank">matthieu.dorier@gmail.com</a>> wrote:<br>
>>><br>
>>> Hello,<br>
>>> I come back to this discussion, as I have instrumented my simulation to<br>
>>> wrap the C++ arrays into NumPy arrays and call a python script in each<br>
>>> process.<br>
>>> This currently works and now I would like to actually do something with<br>
>>> these NumPy arrays. I can't find any tutorial on the YT homepage on how to<br>
>>> create an image from a NumPy array.<br>
>>> (I'm not only new to YT, I'm also new to Python and learned the basic<br>
>>> syntax while coding the wrapper).<br>
>>> Let's imagine I have a 2D NumPy array of floating point values, and I<br>
>>> want to plot it as an image, how would the python code look like?<br>
>>> Thanks<br>
>>> Matthieu<br>
>>> 2011/10/5 Matthew Turk <<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>><br>
>>>><br>
>>>> Hi Matthieu,<br>
>>>><br>
>>>> On Wed, Oct 5, 2011 at 11:45 AM, Matthieu Dorier<br>
>>>> <<a href="mailto:matthieu.dorier@gmail.com" target="_blank">matthieu.dorier@gmail.com</a>> wrote:<br>
>>>> > Hello Matthew,<br>
>>>> ><br>
>>>> > Thank you for your answer.<br>
>>>> ><br>
>>>> > Can YT work in parallel?<br>
>>>><br>
>>>> Yup.<br>
>>>><br>
>>>> > I intend to embed a python interpreter within my simulation in order<br>
>>>> > to<br>
>>>> > allow<br>
>>>> > some simple data analysis to be performed without having to re-compile<br>
>>>> > the<br>
>>>> > application every time this analysis changes, so maybe it would be<br>
>>>> > possible<br>
>>>> > to call YT from an embedded python interpreter? I guess the problem is<br>
>>>> > transferring raw data from the simulation to the interpreter without<br>
>>>> > too<br>
>>>> > much<br>
>>>> > overhead...<br>
>>>><br>
>>>> That's actually how Enzo works as well.  We then construct numpy array<br>
>>>> wrappers around the already-allocated data, and then feed those to yt<br>
>>>> in a dict.<br>
>>>><br>
>>>> ><br>
>>>> > My output is actually very simple, consisting in 2D arrays, each MPI<br>
>>>> > rank<br>
>>>> > being responsible for several chunks (equally sized, but not<br>
>>>> > necessarily<br>
>>>> > contiguous). I would like to avoid writing these 2D arrays into HDF5<br>
>>>> > file<br>
>>>> > and perform visualization on these files, but automatically make the<br>
>>>> > processes<br>
>>>> > synchronize to compute a single image from all these parts.<br>
>>>><br>
>>>> That's what we do with Enzo, except with 3D.  There may be some<br>
>>>> oddities to work out with 2D data.<br>
>>>><br>
>>>> ><br>
>>>> > Do you think it is worth investigating the use of YT for that or<br>
>>>> > should I<br>
>>>> > try other<br>
>>>> > softwares?<br>
>>>> > Thanks<br>
>>>> ><br>
>>>> > Matthieu<br>
>>>><br>
>>>> I think you should give a look at yt -- but also guide your views by<br>
>>>> reading how we do in situ with Enzo.  If you look in the Enzo source<br>
>>>> code at InitializePythonInterface.C and ExposeDataHierarchy.C you can<br>
>>>> see our current method, although I believe in the future with better<br>
>>>> memory-pool allocations in Enzo we'll make this a bit more<br>
>>>> streamlined.<br>
>>>><br>
>>>> Please don't hesitate to write back with more questions!<br>
>>>><br>
>>>> Best,<br>
>>>><br>
>>>> Matt<br>
>>>><br>
>>>> ><br>
>>>> > 2011/10/5 Matthew Turk <<a href="mailto:matthewturk@gmail.com" target="_blank">matthewturk@gmail.com</a>><br>
>>>> >><br>
>>>> >> Hi Matthieu,<br>
>>>> >><br>
>>>> >> The short answer is that for some codes, yes, yt works as an<br>
>>>> >> embedding<br>
>>>> >> system.  The only code that this has been used extensively in is<br>
>>>> >> Enzo,<br>
>>>> >> and it will likely take a bit of work to get it to work.  We're eager<br>
>>>> >> to test it out on other codes, however; the first and easiest<br>
>>>> >> application would be a non-Enzo, patch-based AMR code.<br>
>>>> >><br>
>>>> >> The current state is:<br>
>>>> >><br>
>>>> >>  * In-memory between Enzo and yt works (Britton Smith can speak more<br>
>>>> >> to<br>
>>>> >> this)<br>
>>>> >>  * Creation of arbitrary sources (using the Stream frontend)<br>
>>>> >> currently<br>
>>>> >> works, which can be used from within any Python code<br>
>>>> >>  * No protocol exists (yet) for MPI inter-communicator data loading<br>
>>>> >><br>
>>>> >> Our strategies for the future:<br>
>>>> >><br>
>>>> >>  * We're working to create simple C libraries that can create the<br>
>>>> >> necessary in-memory data objects to link against yt directly<br>
>>>> >>  * The Stream frontend is usable and should be used by non-Enzo codes<br>
>>>> >> as a prototyping mechanism<br>
>>>> >>  * ParaView can call yt for serial calculations, and we are working<br>
>>>> >> to<br>
>>>> >> utilize its CoProcessing facilities to analyze and visualize in<br>
>>>> >> parallel from running simulations<br>
>>>> >><br>
>>>> >> So I think you should be able to add a code to in situ viz/analysis,<br>
>>>> >> but it will likely take a bit of work at the current time to make<br>
>>>> >> sure<br>
>>>> >> everything correctly passes.  I'd be able to help you and send you<br>
>>>> >> demo code if you would like.  Alternately, we intend to instrument yt<br>
>>>> >> to use ParaView as a data loader, which will enable the CoProcessing<br>
>>>> >> techniques from ParaView to be used as well.<br>
>>>> >><br>
>>>> >> Let me know what you think,<br>
>>>> >><br>
>>>> >> Matt<br>
>>>> >><br>
>>>> >> On Tue, Oct 4, 2011 at 1:28 PM, Matthieu Dorier<br>
>>>> >> <<a href="mailto:matthieu.dorier@gmail.com" target="_blank">matthieu.dorier@gmail.com</a>> wrote:<br>
>>>> >> > Hello,<br>
>>>> >> ><br>
>>>> >> > I'm trying to make in-situ visualization available for a<br>
>>>> >> > simulation,<br>
>>>> >> > and I'm considering different softwares for that (VisIt, YT,...).<br>
>>>> >> > I've never used YT, so my question is: is it possible to add<br>
>>>> >> > some code in a simulation (written in C++) to have some kind of<br>
>>>> >> > distributed rendering engine using YT, just like VisIt does with<br>
>>>> >> > code-instrumentation?<br>
>>>> >> > Thanks,<br>
>>>> >> ><br>
>>>> >> > Matthieu<br>
>>>> >> ><br>
>>>> >> > --<br>
>>>> >> > Matthieu Dorier<br>
>>>> >> > ENS Cachan, antenne de Bretagne<br>
>>>> >> > Département informatique et télécommunication<br>
>>>> >> > <a href="http://perso.eleves.bretagne.ens-cachan.fr/%7Emdori307/wiki/" target="_blank">http://perso.eleves.bretagne.ens-cachan.fr/~mdori307/wiki/</a><br>
>>>> >> ><br>
>>>> >> > _______________________________________________<br>
>>>> >> > yt-users mailing list<br>
>>>> >> > <a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
>>>> >> > <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>>>> >> ><br>
>>>> >> ><br>
>>>> >> _______________________________________________<br>
>>>> >> yt-users mailing list<br>
>>>> >> <a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
>>>> >> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>>>> ><br>
>>>> ><br>
>>>> ><br>
>>>> > --<br>
>>>> > Matthieu Dorier<br>
>>>> > ENS Cachan, antenne de Bretagne<br>
>>>> > Département informatique et télécommunication<br>
>>>> > <a href="http://perso.eleves.bretagne.ens-cachan.fr/%7Emdori307/wiki/" target="_blank">http://perso.eleves.bretagne.ens-cachan.fr/~mdori307/wiki/</a><br>
>>>> ><br>
>>>> > _______________________________________________<br>
>>>> > yt-users mailing list<br>
>>>> > <a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
>>>> > <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>>>> ><br>
>>>> ><br>
>>>> _______________________________________________<br>
>>>> yt-users mailing list<br>
>>>> <a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
>>>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>>><br>
>>><br>
>>><br>
>>> --<br>
>>> Matthieu Dorier<br>
>>> ENS Cachan, antenne de Bretagne<br>
>>> Département informatique et télécommunication<br>
>>> <a href="http://perso.eleves.bretagne.ens-cachan.fr/%7Emdori307/wiki/" target="_blank">http://perso.eleves.bretagne.ens-cachan.fr/~mdori307/wiki/</a><br>
>>><br>
>>> _______________________________________________<br>
>>> yt-users mailing list<br>
>>> <a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
>>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>>><br>
>><br>
>><br>
>> _______________________________________________<br>
>> yt-users mailing list<br>
>> <a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
>> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
>><br>
><br>
><br>
><br>
> --<br>
> Matthieu Dorier<br>
> ENS Cachan, antenne de Bretagne<br>
> Département informatique et télécommunication<br>
> <a href="http://perso.eleves.bretagne.ens-cachan.fr/%7Emdori307/wiki/" target="_blank">http://perso.eleves.bretagne.ens-cachan.fr/~mdori307/wiki/</a><br>
><br>
> _______________________________________________<br>
> yt-users mailing list<br>
> <a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
> <a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
><br>
><br>
_______________________________________________<br>
yt-users mailing list<br>
<a href="mailto:yt-users@lists.spacepope.org" target="_blank">yt-users@lists.spacepope.org</a><br>
<a href="http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org" target="_blank">http://lists.spacepope.org/listinfo.cgi/yt-users-spacepope.org</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Matthieu Dorier<br>ENS Cachan, antenne de Bretagne<br>Département informatique et télécommunication<br><a href="http://perso.eleves.bretagne.ens-cachan.fr/%7Emdori307/wiki" target="_blank">http://perso.eleves.bretagne.ens-cachan.fr/~mdori307/wiki/</a><br>


</div>