Visualization

AURORA.jl provides functions to visualize and animate simulation results.

Currently, the only animation function available is animate_Ie_in_time.

Requirements

The plotting and animation functions require a Makie backend.

We recommend:

  • GLMakie - if you have a GPU. It is fast and interactive
  • CairoMakie - if you work on a server without a GPU or want high quality figures (e.g. for publication). It is however non-interactive and slower than GLMakie
Installing Makie

You need to install GLMakie or CairoMakie yourself, for example in your global Julia environment (@v1.XX)

To use the visualization functions, import a backend before or after importing AURORA

# For example
using AURORA
using GLMakie

# Do some visualization

Functions

AURORA.animate_Ie_in_timeFunction
animate_Ie_in_time(directory_to_process; angles_to_plot=nothing, colorrange=nothing, ...)

Plot a heatmap of Ie over height and energy, and animate it in time. It will load the result files one by one. The animation will be saved as a .mp4 file under the directory_to_process.

Example

julia> directory_to_process = "Visions2/Alfven_475s";

# Using defaults for angles and colorrange:
julia> animate_Ie_in_time(directory_to_process)

# Or with custom angles and colorrange:
julia> angles_to_plot = [(180, 170)  (170, 150)  (150, 120)  (120, 100)  (100, 90);   # DOWN
                         (0, 10)     (10, 30)    (30, 60)    (60, 80)    (80, 90)];   # UP
julia> animate_Ie_in_time(directory_to_process; angles_to_plot, colorrange=(1e5, 1e9), plot_Ietop=true)

# Using nothing for empty panels:
julia> angles_to_plot = [(180, 90)  nothing;
                         (0, 45)    (45, 90)];
julia> animate_Ie_in_time(directory_to_process; angles_to_plot)

The angles_to_plot is a matrix of tuples, where each tuple defines a pitch-angle range from 0° to 180° (where 180° is field-aligned down and 0° is field-aligned up). A panel will be created for each matrix element at the corresponding row/column position. Angles > 90° are labeled as "DOWN", angles < 90° as "UP". Use nothing for empty panels.

The limits of angles_to_plot need to match existing limits of the beams used in the simulation. E.g. if θ_lims = 180:-10:0 was used in the simulation, (150, 120) will be fine as 150° and 120° exist as limits, but (155, 120) will not as 155° does not exist as a limit.

Arguments

  • directory_to_process: directory containing the simulation results (absolute or relative path).

Keyword Arguments

  • angles_to_plot = nothing: limits of the angles to plot as a matrix of tuples with angles in range 0-180°. Use nothing for empty panels. If the whole argument is nothing, uses the θ_lims grid from the simulation with down-flux on the first row and up-flux on the second row.
  • colorrange = nothing: limits for the colormap/colorbar as a tuple (min, max). If nothing, automatically computed as (maxvalue / 1e4, maxvalue) spanning 4 orders of magnitude.
  • save_to_file = true: if true, saves the animation to a .mp4 file in the data directory.
  • plot_Ietop = false: if true, also plots the precipitating Ie at the top of the ionosphere by loading it from the file Ie_top.mat.
  • Ietop_angle_cone = [170, 180]: angle cone (in degrees) for the precipitating Ie to plot.
source