Code
using CairoMakie, SpacePhysicsMakieWe demonstrate here how to load data from a variety of data sources and visualize them using SpacePhysicsMakie.jl.
CDAWebCDAWeb.jl provides direct access to NASA’s CDAWeb RESTful services with local caching and fine-grained control over data retrieval.
It could be installed at REPL via using Pkg; Pkg.add("CDAWeb").
V_GSE (3 × 1350) dims=? × Epoch [Solar Wind Velocity in GSE coord., 3 components; km/s]
SpeasySpeasy.jl provides functions to load data from main Space Physics WebServices (CDA,SSC,AMDA,..).
It could be installed at REPL via using Pkg; Pkg.add("Speasy").
CondaPkg Found dependencies: /Users/zijin/.julia/packages/Speasy/ejrsN/CondaPkg.toml CondaPkg Found dependencies: /Users/zijin/.julia/packages/CondaPkg/Pc7ZA/CondaPkg.toml CondaPkg Found dependencies: /Users/zijin/.julia/packages/PySPEDAS/3mgxR/CondaPkg.toml CondaPkg Found dependencies: /Users/zijin/.julia/packages/PythonCall/trYos/CondaPkg.toml CondaPkg Resolving changes + certifi + libpython + netcdf4 + openssl + pyspedas (pip) + python + python-gil + speasy (pip) + sqlite + uv CondaPkg Initialising pixi │ /Users/zijin/.julia/artifacts/2d933917be1d230d096513e1ae50dd7ad28a92e0/bin/pixi │ init │ --format pixi └ /Users/zijin/src/JuliaSpacePhysics/juliaspacephysics.github.io/tutorials/data_loading/.CondaPkg ✔ Created /Users/zijin/src/JuliaSpacePhysics/juliaspacephysics.github.io/tutorials/data_loading/.CondaPkg/pixi.toml CondaPkg Wrote /Users/zijin/src/JuliaSpacePhysics/juliaspacephysics.github.io/tutorials/data_loading/.CondaPkg/pixi.toml │ [dependencies] │ python-gil = "*" │ openssl = ">=3, <3.6" │ uv = ">=0.4" │ sqlite = "!=3.49.1" │ certifi = "*" │ netcdf4 = ">=0" │ │ [dependencies.python] │ version = ">=3.10,<3.15, >=3.10,!=3.14.0,!=3.14.1,<4" │ build = "*cp*" │ channel = "conda-forge" │ │ [dependencies.libpython] │ version = "*" │ channel = "conda-forge" │ │ [pypi-dependencies] │ pyspedas = ">=2.2.2" │ speasy = ">=1.9.1, <2" │ │ [workspace] │ name = ".CondaPkg" │ description = "automatically generated by CondaPkg.jl" │ platforms = ["osx-arm64"] │ channel-priority = "strict" └ channels = ["conda-forge"] CondaPkg Installing packages │ /Users/zijin/.julia/artifacts/2d933917be1d230d096513e1ae50dd7ad28a92e0/bin/pixi │ install └ --manifest-path /Users/zijin/src/JuliaSpacePhysics/juliaspacephysics.github.io/tutorials/data_loading/.CondaPkg/pixi.toml ✔ The default environment has been installed. Precompiling QuartoNotebookWorkerPythonCallExt... 1 dependency successfully precompiled in 1 seconds
Speasy.SpeasyVariable{Float32, 2, PythonCall.PyArray{Float32, 2, true, true, Float32}, Tuple{Nothing, Speasy.VariableAxis{Dates.Timestamp{Dates.Nanosecond}, 1, Base.ReinterpretArray{Dates.Timestamp{Dates.Nanosecond}, 1, Int64, PythonCall.PyArray{Int64, 1, true, true, Int64}, false}}}, String, SpaceDataModel.OverlayDict{Union{String, Symbol}, Any, PythonCall.PyDict{String, Any}, Dict{Union{String, Symbol}, Any}}}: Pressure
Time Range: 2024-01-02T00:00:00 to 2024-01-02T23:59:00
Units: nPa
Size: (1, 1440)
Memory Usage: 18.014 KiB
Metadata:
FIELDNAM: Flow pressure
VALIDMIN: Any[0.0]
VALIDMAX: Any[100.0]
SCALEMIN: Any[0.0]
SCALEMAX: Any[100.0]
UNITS: nPa
FORMAT: F5.2
FILLVAL: Any[99.98999786376953]
VAR_TYPE: data
CATDESC: Flow pressure (nPa)
VAR_NOTES: Derived parameters are obtained from the following equations. Flow pressure = (2*10**-6)*Np*Vp**2 nPa (Np in cm**-3, Vp in km/s, subscript p for proton)
DISPLAY_TYPE: time_series
DEPEND_0: Epoch
LABLAXIS: Flow pressure
BIN_LOCATION: 0.0
HAPIClient.jl provides functions to load data from HAPI-compliant servers.
It could be installed at REPL via using Pkg; Pkg.add("HAPIClient").
HAPIVariables: CDAWeb/AC_H0_MFI (https://cdaweb.gsfc.nasa.gov/hapi/data?parameters=Magnitude%2CBGSEc&id=AC_H0_MFI&time.max=2024-01-03T00%3A00%3A00.000Z&format=csv&time.min=2024-01-02T00%3A00%3A00.000Z) Magnitude [Time Range: 2024-01-02T00:00:12 to 2024-01-02T23:59:56, Units: nT, Size: (5400,)] BGSEc [Time Range: 2024-01-02T00:00:12 to 2024-01-02T23:59:56, Units: nT, Size: (5400, 3)] Metadata - SpaceDataModel.NoMetadata()
PySPEDASPySPEDAS.jl provides a Julia interface to the PySPEDAS Python package, offering a similar API for Julia users to utilize the existing Python routines.
It could be installed at REPL via using Pkg; Pkg.add("PySPEDAS").
Precompiling PySPEDAS...
1 dependency successfully precompiled in 1 seconds. 89 already precompiled.
24-Oct-26 09:50:08: File is current: /Users/zijin/data/themis/thd/l2/fgm/2024/thd_l2_fgm_20240102_v01.cdf
Combine all the data into a single plot with multiple panels.
Julia Version 1.14.0-alpha1
Build Info:
Official https://julialang.org release
Commit 30593bd2a76 (2026-10-20 06:21 UTC)
GC: Built with stock GC
Platform Info:
OS: macOS (arm64-apple-darwin25.6.0)
CPU: 10 × Apple M5 (apple-m5)
WORD_SIZE: 64
LLVM: libLLVM-23.1.4 (ORCJIT, apple-m5)
Threads: 1 default, 1 interactive, 1 GC (on 10 virtual cores)
Environment:
JULIA_LOAD_PATH = @:@stdlib
JULIA_MAX_NUM_PRECOMPILE_FILES = 3
JULIA_APPS_JULIA_CMD = julia
JULIA_PROJECT = @.
---
title: Load and visualize data from a variety of sources
---
We demonstrate here how to load data from a variety of data sources and visualize them using [`SpacePhysicsMakie.jl`](https://juliaspacephysics.github.io/SpacePhysicsMakie.jl/).
```{julia}
using CairoMakie, SpacePhysicsMakie
```
## Get data with `CDAWeb`
[CDAWeb.jl](https://github.com/JuliaSpacePhysics/CDAWeb.jl) provides direct access to NASA's CDAWeb RESTful services with local caching and fine-grained control over data retrieval.
It could be installed at REPL via `using Pkg; Pkg.add("CDAWeb")`.
```{julia}
using CDAWeb
t0 = "2024-01-02"
t1 = "2024-01-03"
# ACE solar wind velocity
data1 = cda"AC_H0_SWE/V_GSE"(t0, t1)
```
### Plot the data
```{julia}
tplot(data1, add_title=true)
```
## Get data with `Speasy`
[Speasy.jl](https://github.com/SciQLop/Speasy.jl) provides functions to load data from main Space Physics WebServices (CDA,SSC,AMDA,..).
It could be installed at REPL via `using Pkg; Pkg.add("Speasy")`.
```{julia}
import Speasy
data2 = Speasy.get_data("cda/OMNI_HRO_1MIN/Pressure", t0, t1)
```
### Plot the data
```{julia}
tplot(data2)
```
## Get data using Heliophysics Application Programmer's Interface (HAPI)
[HAPIClient.jl](https://github.com/JuliaSpacePhysics/HAPIClient.jl) provides functions to load data from HAPI-compliant servers.
It could be installed at REPL via `using Pkg; Pkg.add("HAPIClient")`.
```{julia}
import HAPIClient
vars = HAPIClient.get_data("CDAWeb/AC_H0_MFI/Magnitude,BGSEc", t0, t1)
```
### Plot the data
```{julia}
tplot(vars)
```
## Get data with `PySPEDAS`
[PySPEDAS.jl](https://github.com/JuliaSpacePhysics/PySPEDAS.jl) provides a Julia interface to the [PySPEDAS](https://github.com/spedas/pyspedas) Python package, offering a similar API for Julia users to utilize the existing Python routines.
It could be installed at REPL via `using Pkg; Pkg.add("PySPEDAS")`.
```{julia}
using PySPEDAS.Projects
# Same as more verbose `pyspedas.projects.themis.fgm(...)`
tvars = themis.fgm([t0, t1], time_clip=true, probe="d");
```
### Plot the data
```{julia}
tplot((tvars.thd_fgs_gsm, tvars.thd_fgs_btotal))
```
## Composite plot
Combine all the data into a single plot with multiple panels.
```{julia}
tplot((data1, data2, vars..., tvars.thd_fgs_gsm), add_title=true)
```
## Reproducibility
::: {.callout-note collapse="true"}
## This tutorial was built using these direct dependencies
```{julia}
using Pkg
Pkg.status()
```
:::
::: {.callout-note collapse="true"}
## Machine and Julia version information
```{julia}
using InteractiveUtils # hide
versioninfo()
```
:::