[Users] Query regarding visualisation software/packages

Gabriele Bozzola bozzola.gabriele at gmail.com
Mon May 17 13:49:48 CDT 2021


Dear Annamalai,

I don't know much about yt, so the help I can offer is limited and I can
only point out what you need to be able to do with yt
to make a video like the one I made. I personally think that yt is not the
correct tool to use for this kind of plots
because you need to be able to draw several kinds of structures (curves,
arrows, meshes, volume rendering), and I am not
sure what is the level of support for all these different kinds of plots in
yt. I used mayavi for the example.

1. Horizons are meshes (typically, 6 partially overlapping meshes). So, you
need to figure out how to draw meshes
    with yt. You can learn about how these are represented by kuibit in the
tutorial on horizons.
    (https://sbozzolo.github.io/kuibit/tutorials/cactus_horizons.html). I
report here one of the figures to give an idea
    of how horizons are represented
.
[image: image.png]

  You can obtain the 3D position of all the vertices with the function
`shape_at_iteration` or `shape_at_time`.

2. Spins are vectors. You have to find out how to draw arrows in yt. You
can use the function
    `ah_origin_at_iteration` to find the center of the horizon at any given
time, and then you can find the
    value of the vector you are interested in simply getting the quantity
with brackets, e.g. h["momentum_x"]
    would give you a timeseries with the value of the linear momentum along
the x direction for horizon h.
    h["momentum_x"](time) is the value of that component at the given time,
which you can use to draw the
    arrow.

3. Orbits are 3D curves. h.ah.centroid_x is a timeseries with the x
coordinate of the horizon h. You can use this
    to draw a 3D plot with the orbits. Read tutorial on timeseries for more
information
    (https://sbozzolo.github.io/kuibit/tutorials/timeseries.html)

4. The curvature is the only quantity for which I think it makes sense to
plot with yt. It is a 3D grid function. Normally,
    this has all the information about the refinement levels, but you can
resample everything to a uniform grid.
    This can be passed to yt as "generic data", as shown here
https://yt-project.org/doc/examining/generic_array_data.html.
    For information about grid data, have a look at the relevant tutorial
    https://sbozzolo.github.io/kuibit/tutorials/grid_data.html.

    When you use mayavi, this can be a 3D contour plot, but it still has to
be resampled onto an uniform grid.

5. Gravitational waves are 2D curves that live on a different space
compared to the main plot. I used matplotlib
    to draw this (plt.plot(strain)) and then joined the images with Pillow.
The tutorial on gravitational waves will
    tell you more about this:
https://sbozzolo.github.io/kuibit/tutorials/gravitational_waves.html

6. If you want to have something nice and user-friendly, you can take
inspiration from the examples in kuibit.
    These examples are command-line utilities that work out-of-the-box for
all the simulations. They have a lot
    of options and other nice features (e.g. tab-completion). Some
documentation about that is here
    https://sbozzolo.github.io/kuibit/argparse_helper.html, but the
examples themselves are great starting points.

My personal recommendation for how you should move forward is to
familiarize yourself with kuibit first. In this
email I sketched how you can achieve what you want, but I neglected a ton
of details. I suspect that it is only after
you learned the basics of kuibit that this email will make sense. Also, you
should ask yourself if you really want
to use yt for this specific use case. If you don't want to, everything I
described in this email is already implemented
(with mayavi) and you can simply customize the example that I pointed out
in the previous email for your needs.

To get started with kuibit, you can read the tutorials,
https://sbozzolo.github.io/kuibit/#tutorials and this page
https://sbozzolo.github.io/kuibit/simdir.html. Then, I'd suggest trying to
re-implement one of the examples on your
own, for example plot_ah_separation.py (
https://sbozzolo.github.io/kuibit/examples/bins/plot_ah_separation.html).
With this, you will gain enough experience to move to the next step and
make the movie you want to.

Every single function in kuibit is documented. In addition to the examples
and tutorials, we have two additional
types of documentation (for a total of four different types):
- Explanations of the various modules (
https://sbozzolo.github.io/kuibit/#usage), where you can see how the modules
  should be used and a broad overview on how they are structured and what
features they provide.
- Reference and technical details of the APIs (
https://sbozzolo.github.io/kuibit/#reference-material-classes-functions),
  where you can see the details of the function signatures, the types
expected, et cetera.
You will likely need the latter two forms of documentation when you will
start writing code with kuibit.

Best,
Gabriele



On Mon, May 17, 2021 at 11:05 AM Annnamalai P S <annamalaips.97 at gmail.com>
wrote:

> Dear Gabriele,
>
> Thank you for your reply and for taking the time to point out the
> resources you felt would be relevant to my current research.
>
> I'm currently not very well versed with yt package but am very much
> interested in the idea that you have suggested. But at the same time I'm
> new to kuibit as well. If you can share any resources/documentation that
> helps me to prepare data to be used for yt package that would be great. I
> hope to create animated volume rendering using yt package like the ones you
> have created. I also want to set it up as a user friendly and out of the
> box package that can yield plots for visualization.
>
> On Mon, May 17, 2021 at 8:52 PM Gabriele Bozzola <
> bozzola.gabriele at gmail.com> wrote:
>
>> Dear Annamalai,
>>
>> I am the author of kuibit, and I would like to highlight that the package
>> is capable of doing what you are looking for,
>> including 3D rendering. The package also comes with a lot of examples
>> that you can immediately use for your
>> goals. There are already some examples for 2D/3D plots of binary black
>> holes, and you can see an example of
>> rendering here:
>> https://github.com/Sbozzolo/kuibit/tree/experimental/examples
>> where I rendered a 3D movie with the apparent horizons, magnitude of the
>> spins, orbits, and gravitational wave
>> strain. You can produce the same movie for your simulation writing 0
>> lines of code [1].
>>
>> As for yt, kuibit can prepare the data so that it is trivial to use it
>> with yt (see GitHub issue
>> https://github.com/Sbozzolo/kuibit/issues/18). I've never used yt and I
>> don't even know where to start, but if you
>> are already familiar with it, you'll be able to use it with kuibit in no
>> time. [2]
>>
>> Finally, let me point to the documentation:
>> https://sbozzolo.github.io/kuibit/. kuibit is thoroughly documented and
>> there are lots of examples and tutorials that will help you get started.
>> In addition to that, we have a kuibit user
>> group chat on Telegram (https://t.me/kuibit) where you can ask questions
>> if you find that something is not clear.
>>
>> Let me know if you have any questions,
>> Gabriele
>>
>>
>> [1] The code is in the experimental branch, so I would actually not
>> recommend using it at the moment because it
>> will break in the future. However, you can still see how it is done there
>> and use the stable version of kuibit to
>> achieve a similar result. At this point in time, I would recommend NOT
>> using the experimental branch.
>>
>> [2] In that case, we would love you to contribute back to kuibit :)
>>
>> On Mon, May 17, 2021 at 8:05 AM Roland Haas <rhaas at illinois.edu> wrote:
>>
>>> Hello Annamalai,
>>>
>>> please take a look at our wiki:
>>>
>>> https://docs.einsteintoolkit.org/et-docs/Analysis_and_post-processing
>>>
>>> Linked in the "Analyzing Data Output by the Einstein Toolkit"
>>> bullet of "Documentation" section of the wiki at
>>>
>>> https://docs.einsteintoolkit.org/et-docs/Main_Page
>>>
>>> Please note that yt support is not currently functional since the
>>> repository linked to no longer exists.
>>>
>>> The most functionally complete packages are likely:
>>>
>>> * SimulationTools
>>> * PostCactus
>>> * Kuibit
>>>
>>> For 3d visualization I think you are pretty much limited to VisIt
>>> unless you convert the HDF5 files into a format understood by other
>>> packages.
>>>
>>> Yours,
>>> Roland
>>>
>>> > Hi Einstein Toolkit users,
>>> >
>>> > I'm a relatively new Einstein Toolkit user learning to simulate and
>>> > visualise binary black hole system mergers. I'm trying to write a code
>>> to
>>> > visualise animated trajectories, horizons, gravitational waveforms and
>>> > curvature of binary system merger using Python matplotlib and
>>> yt-project
>>> > packages.
>>> >
>>> > Before I proceed, I want to know what are the list of available
>>> > open-source/commercial visualisation software/packages that can produce
>>> > animated plots(2D and 3D) of binary system merger with data from
>>> Einstein
>>> > toolkit output, and get an idea of whether something similar already
>>> exists.
>>> >
>>> >
>>> > --
>>> > Best regards,
>>> > Annamalai P S
>>>
>>>
>>> --
>>> My email is as private as my paper mail. I therefore support encrypting
>>> and signing email messages. Get my PGP key from http://pgp.mit.edu .
>>> _______________________________________________
>>> Users mailing list
>>> Users at einsteintoolkit.org
>>> http://lists.einsteintoolkit.org/mailman/listinfo/users
>>>
>>
>
> --
> Annamalai P S
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.einsteintoolkit.org/pipermail/users/attachments/20210517/67bcb1b6/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 43579 bytes
Desc: not available
Url : http://lists.einsteintoolkit.org/pipermail/users/attachments/20210517/67bcb1b6/attachment-0001.png 


More information about the Users mailing list