Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create video animations in Ubermag? #144

Open
ninadjadkar opened this issue May 31, 2021 · 4 comments
Open

How to create video animations in Ubermag? #144

ninadjadkar opened this issue May 31, 2021 · 4 comments
Labels
backlog Good idea, has been added to our todo list. (No time to do it, though.) documentation low priority question General question

Comments

@ninadjadkar
Copy link

Hey!
Can anyone tell me a way to create a video animation in Ubermag? In tutorial 1 of Ubermag (https://www.youtube.com/watch?v=YvONq0dSWsI&list=PL2e4GE4u3Jp9Pj15Xgb3u5-SIbFAF2OhA&index=1&t=1921s ) where the presenter explains the different kind of energies, he puts some animation in the slides as well. He mentions that these are created using ubermag itself, but nothing much is talked about it in subsequent tutorial lectures.
The interactive plot provides a slider which we can drag to visualize the change with time, but how to convert that into animation?
Regards.

@code-whale
Copy link

@ninadjadkar ,Hi! I currently use matplotlib for drawing, and matplotlib itself has a matplotlib.animation that can animate multiple pictures. I enclose a link to this module here.https://matplotlib.org/stable/api/animation_api.html
I hope it will be helpful to you! I'm also curious about how the interactive animation in the ubermag tutorial demo you mentioned is implemented. Hope the ubermag team can answer our questions! In addition, if you think that using animation to make animation is more complicated, you can try to use the for loop sentence to save the results on some time nodes in your simulation (the time nodes you want to show) as pictures, and then use some online web pages to convert pictures into animation to achieve animation output!

@marijanbeg marijanbeg transferred this issue from ubermag/workshop Jun 10, 2021
@marijanbeg
Copy link
Member

Hi @ninadjadkar, thank you for your question and for using Ubermag. I transferred your issue to our help repository (https://github.com/ubermag/help). This is the repository we monitor regularly and where you can get support from others in the community. Therefore, we would encourage you to raise future issues in this repository.

The way I created those animations was:

  1. I ran the simulations
  2. Using micromagneticdata, I converted all output files to VTK
  3. I used Paraview (https://www.paraview.org/) to create a movie.

Please let us know if you need any further details.

@ninadjadkar
Copy link
Author

@code-whale can you share a simple code of how to make an animation. I attach a "Zeeman" Jupyter notebook with this comment. This one is from the worship repository of ubermag itself.
I'm also learning to make an animation in Paraview, but facing some scaling issues.

zeeman.zip

Regards.

@code-whale
Copy link

@ninadjad, Hi, I attach the updated notebook here. I have attached two ways to output animation. One needs to install an additional Python package, and the other can output directly using Matplotlib. It should be emphasized that due to the limitation of MAC system, I can only output GIF animation at present. If you need avi or MP4 video, I suggest you use adobe or Final Cut Pro for format conversion.
zeeman.ipynb.zip
In addition, if you find a way to convert VTK to video by using paraview, please teach me how to do it. I have tried to convert VTK by using paraview before, but after importing multiple VTK files, I don't know how to batch operate them, and I don't know how to create a timeline for animation conversion. I hope you and @marijanbeg can teach me how to do this.

@marijanbeg marijanbeg added documentation backlog Good idea, has been added to our todo list. (No time to do it, though.) low priority question General question labels Jul 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backlog Good idea, has been added to our todo list. (No time to do it, though.) documentation low priority question General question
Projects
None yet
Development

No branches or pull requests

3 participants