Making an animation in Shape by example
FYI: I made my own Library (copying Erica). I wrote an outline about the 2007 Shape paper, here. In case anyone is interested about the point of Shape.
Since our group is trying to utilize the Shape software for our simulations, I figure I would start to document helpful components to visualizing and modeling in Shape. Here I will briefly explain how one can make a movie, or animation in Shape. Some days toward the end of the day, I am going to go through the templates on their website. With Shape however, I have two main objectives:
- Learn how to convert our hdf5 simulation data to ASCII, so that it can be fed into Shape.
- Learn how to visualize this external data in Shape. What limits are there and what can Shape tell us about our data compared to other visualization softwares?
So if the template I check out is useful, I'll make a blog post about it explaining the objective of the template. Eventually I'll use these to make a series of wikipages documenting Shape for our purposes. However I am yet to be a "Shape Master." Otherwise I would have done 1 & 2 already. This template is quite simple: how do you make a movie in Shape?
Results:
(Make sure you check out the .gifs! They are really pretty.)
Image 1 | Image 2 |
BW GIF Red/Blue GIF | GIF |
Image 3 | Image 4 |
GIF | GIF |
This data is from one of the Shape templates, titled Animation 1 - Rotation. It is a bipolar nebula rotating around all three x-y-z Cartesian axes. Image 1 is a 2D projection, comparable to our column density map movies. However the object is not evolving in time. Image 2 is the line profile for the velocity vs. pixel intensity as the object rotates. Image 3 is the mesh used for the object. Image 4 is its PV-Diagram.
Guide:
This screen-shot was taken post-rendering. Click the big button with the Shape-S in the top, left-hand corner to view the data as seen here. Prior to rendering, the PV-diagrams will be black. Note that all of the data parameters are already in the template. You can adjust the colors if you want too. For instance I have also made a movie color coded to indicate Doppler-shifting, i.e. Red/Blue (see above). Other options include grey scale, rainbow (color), red/blue, gradient, and spectrum. Click the movie-film looking button in the same row as the renderer to get to the animation module.
Image 6 is what the animation module looks like. Instead of clicking the rendering button, you'll click the animation button (which is circled and marked as the second step). First you want to adjust what format your output will be. Note the timeline at the bottom of the GUI. As Shape makes your animation, it will tell you how far it is in the process. On the right hand side of the Animation module is the variable tree. Below the variable tree, in the table, is what is referred to as the variable stack. Essentially the functionality of this part of the animation module in v. 5 seems not much different from v. 4. Y
Here is a table of screen shots of all the parameters listed in the animation module.
Image 7. General | Image 8. Variable | Image 9. Output |
Image 7 (in order from top to bottom):
- Name of your file output
- Number of frames (where you want them to start and end in the simulation)
- Current frame tells you when Shape is in spitting your .png output (there is also a timeline at the bottom of the GUI that starts from first frame and ends at the number of the last frame) relative to the simulation
- Start and end times of your simulation for some given time units (years, days, hours, minutes, seconds).
- Like current frame, it tells you what current time your simulation is being animated at in your chosen units.
- Distribute & Fields: Using particles for rendering or output velocity vector information may require Shape to redistribute the particles in every frame. This is done by default. If you are not using particles, then disabling the distribution can save processing time.
- Render: Render while you animate. This is essentially required.
Image 8. (Currently investigating)
Image 9. Above in the results section of this post, you can see all of the options visualized that are listed here: 2D Maps, PV Diagrams, 3D Mesh, Hydro, Plots (Images) (Note: the numbers to the right indicate LxW size of the image, so these plots are 512x512), Plots (Ascii), Math Variables, and Time Units. You can denote the image type, and indicate where you want the images to be saved (a working directory).
Meeting Update 08/25/2014: I made a shape!
So in an attempt to visualize the pn data that Baowei set aside for me in SHAPE, I need to learn the ropes of the software first. So that is what I've been up to. The SHAPE guys have a youtube channel, so I am going through all their videos, copying what they do on my own computer with the software (see: SHAPE 3D Interactive Astrophysics)
So I made a torus. Understand the 3D view ports in SHAPE now, it is pretty intuitive when you know where things are located. Turns out you can also add observational photos to the background, which might be useful as a reference when you're creating detailed objects. In the SHAPE tutorials, they have a Jet Template Project in their Hydrodynamics module. My short term goal is to recreate that, and perhaps a few other templates until I can convert the data we have (see: SHAPE Templates).
Another issue is converting hdf5 to ascii, which Martin informed me is the necessary format to feed into SHAPE. Baowei has a script (see: Baowei's Page) where one first needs to rewrite each chombo with a single core, and then conver to ascii.
For fun I threw the chombo files into VisIt to see what they looked like:
Both sets have the same max and min.
Going forward:
- Attempting to become a shape aficionado, try to visualize the data we have in SHAPE… and understand it. Dig on some literature about p/pns.
- Working on doing the post processing for Erica's runs. They should all be complete now.
- Once I'm done making some of the typical movies of the colliding flows bovs, I'll work on doing the movie fly-throughs. Martin said he needed some pretty graphics, so I am going to try to get as much of this done as I can soon. Also for the VISTA contest in September 5th.
Meeting Update 08/18
No science this week for me. Still working on Erica's runs, and starting to delve into more development related topics.
On High Res Runs
- Transferring materials currently to Stampede, about to start submitting jobs today (beta 1, shear 60 & beta 10, shear 15). The other two will run on Bluestreak.
- Submitting jobs to Bluestreak. Waiting on Carl to respond to renew reservation, having beta 10 shear 60 running in standard queue at 128 nodes.
- Aiming to update the CF Production Runs Page. Some of our runs are almost done. For instance beta 10 shear 60 is nearly to chombo 190.
Computing Resources
See previous post.
Development
Had a meeting with Jonathan last Friday to start working on development projects.
- Once I am done working with Erica's data I am going to focus on creating a nap sack algorithm (which Eddie kindly gave to me ). Jonathan and I took a look at the current algorithm we use (see: (17) http://arxiv.org/pdf/1112.1710.pdf). Found this thesis by Pierre Schaus (see: http://becool.info.ucl.ac.be/pub/theses/thesis-pschaus.pdf). Planning to contact both Pierre Schaus (nurse - patient algorithm) and Mark Kremholtz (about load balancing on the accretion module for Orion (astrophysical AMR)). We also came across this Zoltan code which might be useful to look at?
- Cleaning up unused variables in the code.
- Implementing hydrostatic equilibrium in the disk module. For which I assume I'll have to consider:
We know hydrostatic equilibrium is defined generally to be
which I'll define to be
for some cylindrical coordinate system (with a distance from the disk axis, and height above the plane). Then balancing with the ideal gas law and isothermal sound speed, we can integrate our equation, yielding:
If anyone wants to go over the derivation with me, that is fine, I just included some highlights here. It is a pretty standard derivation, I think it can be found in some books. Given this would be implemented for the disk module, I just assumed a central mass
and an infinitesimal chunk of mass at for a cylindrical coordinate system.However for now I'll be focusing primarily on the napsack problem since it'll be more beneficial for the code.
SHAPE
Downloaded the software. It looks pretty neat. Haven't had any creative ideas of what to do with it yet in order to understand its capabilities.