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

(*,+) Movie and summary changes, new parameter to shut off neutrino reactions. #32

Merged
merged 12 commits into from
Nov 15, 2024
Prev Previous commit
(+) description of interactive mode, poss. to turn off flows
Added describtion to the readme of the flow plot. Also added a
possibility to turn on/off flow arrows and mass fractions
  • Loading branch information
Mreichert91 committed Nov 15, 2024
commit c341d93fddd75340ed21bff306ee2b5df302ec5b
33 changes: 33 additions & 0 deletions bin/movie_script/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,3 +165,36 @@ This command will display the movie in a separate window. Note that this process
An example output could look like the following:

![Simulation visualization](../../doc/doxygen/figures/winteler_mhd.gif)


#### Interactive Mode

The **Interactive Mode** enhances the functionality of the nuclear reaction flow visualization by enabling real-time interaction with the plots. Below are the features and instructions for using the interactive mode effectively:


1. **Dynamic Controls:**
- **Slider**: Allows the user to navigate through the simulation timeline seamlessly.
- **Play/Pause Button**: Toggles the animation playback.
- **Zoom Button**: Enables zooming in and out on the low mass region of the chart.

2. **Toggle Data Layers:**
- Activate or deactivate specific plots (e.g., `tracked nuclei`, `timescales`, `energy`) with dedicated buttons.

3. **R-process path**
- Highlight the r-process path that is calculated assuming (n,gamma) equilibrium.

4. **Highlight sunet**
- Highlight the nuclei that have been used in the calculation with a red outline.

5. **Neutron freezeout**
- Neutron freezeout is indicated as red vertical line on the slider.

6. **Flow and Abundance Adjustments:**
- Fine-tune flow and abundance ranges dynamically using buttons to increment, decrement, or reset the values.
- Toggle visualization elements such as arrows for flow or background mass fractions.

7. **Custom Backgrounds:**
- Switch between different background visualizations (e.g., Binding energy, Neutron separation energy) for a tailored view of nuclear properties.


![Interactive mode](../../doc/doxygen/figures/interactive.png)
7 changes: 5 additions & 2 deletions bin/movie_script/src_files/FlowAnimation.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,7 @@ def __init__(
self.__background_Y_2[N,Z] = df['binding energy'].values/(Z+N)
self.__background_Y_3 = np.zeros_like(self.__background_Y_1)*np.nan
self.__background_Y_3[N,Z] = df['Sn'].values
self.forward_mode = 0


def __init_ngamma_eq(self):
Expand Down Expand Up @@ -615,7 +616,6 @@ def __init_interactive(self):
self.fig.canvas.mpl_connect('key_press_event', self.arrow_update)
self.__interactive_ax = None


# Add a bookmark at a certain time in the slider
# Calculate neutron freeze-out time
min_val = 1-self.wreader.mainout['yn']/self.wreader.mainout['yheavy']
Expand Down Expand Up @@ -807,9 +807,10 @@ def flow_button_event(self, event):
elif event.inaxes == self.flow_buttons[5].ax:
if self.flow_adapt_width:
self.flow_patch.set_visible(not self.flow_patch.get_visible())
self.flow_buttons[5].label.set_text("○" if self.flow_patch.get_visible() else "●")
else:
self.quiver.set_visible(not self.quiver.get_visible())
self.flow_buttons[5].label.set_text("○" if self.quiver.get_visible() else "●")
self.flow_buttons[5].label.set_text("○" if self.quiver.get_visible() else "●")


# Refresh the animation at current position
Expand Down Expand Up @@ -1503,6 +1504,8 @@ def save_frame(self, ii):
def get_funcanimation(self, frames=None, **kwargs):
if frames is None:
frames = range(self.n_timesteps)
if self.interactive and self.forward_mode == 1:
frames = frames[::100]
self.frames=frames
self.animation = FuncAnimation(self.fig, self.update_frame,
frames=frames, **kwargs)
Expand Down
Binary file added doc/doxygen/figures/interactive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading