Setup: install the required packages
using Pkg
Pkg.add(["CDAWeb", "WGLMakie", "SpacePhysicsMakie"])Explore data with interactive plots
This tutorial demonstrates interactive visualization of space physics data using WebGL-powered plots. Unlike static plots, these visualizations allow you to pan, zoom, and explore your data directly.
We use BonitoBook in Colab, which is a Julia native notebook with many additional features compared to Colab (we mainly use Colab as a computation platform). Using WGLMakie directly in Colab is currently not possible due to this limitation.
This example loads OMNI solar wind data:
Precompiling packages... 2061.7 ms ✓ QuartoNotebookWorkerJSON3Ext (serial) 1 dependency successfully precompiled in 2 seconds Precompiling packages... 904.9 ms ✓ QuartoNotebookWorkerTablesExt (serial) 1 dependency successfully precompiled in 1 seconds Precompiling packages... 1165.8 ms ✓ QuartoNotebookWorkerJSONExt (serial) 1 dependency successfully precompiled in 1 seconds Precompiling packages... 918.9 ms ✓ QuartoNotebookWorkerLaTeXStringsExt (serial) 1 dependency successfully precompiled in 1 seconds Precompiling packages... 6524.4 ms ✓ QuartoNotebookWorkerMakieExt (serial) 1 dependency successfully precompiled in 7 seconds
Try interacting with the plot:
See SpacePhysicsMakie.jl webpage for an example using Speasy.jl.
---
title: "Interactive Space Physics Visualization"
subtitle: "Explore data with interactive plots"
format:
html: default
ipynb: default
---
This tutorial demonstrates interactive visualization of space physics data using WebGL-powered plots. Unlike static plots, these visualizations allow you to pan, zoom, and explore your data directly.
::: {.callout-note}
We use BonitoBook in Colab, which is a Julia native notebook with many additional features compared to Colab (we mainly use Colab as a computation platform). Using WGLMakie directly in Colab is currently not possible due to [this limitation](https://github.com/googlecolab/colabtools/issues/5369).
:::
```{julia}
#| code-summary: "Setup: install the required packages"
#| output: false
using Pkg
Pkg.add(["CDAWeb", "WGLMakie", "SpacePhysicsMakie"])
```
## Interactive Time Series Plot
This example loads OMNI solar wind data:
```{julia}
using CDAWeb
using WGLMakie, SpacePhysicsMakie
t0 = "2008-09-05T10:00:00"
t1 = "2008-09-05T22:00:00"
# The `cda` string macro provides a convenient way to fetch multiple variables from CDAWeb in a single line.
tvars = cda"OMNI_HRO_1MIN/flow_speed, Pressure"
f, axs = tplot(tvars, t0, t1)
f
```
Try interacting with the plot:
- **Scroll** to zoom in/out
- **Click and drag** to pan
- **ctrl+click** to reset the view
::: {.callout-note}
See [SpacePhysicsMakie.jl](https://juliaspacephysics.github.io/SpacePhysicsMakie.jl/dev/speasy/) webpage for an example using [`Speasy.jl`](https://sciqlop.github.io/Speasy.jl/dev/).
:::