Electron-scale measurements of magnetic reconnection in space

On 2015-10-16 around 13:07:02 UT, MMS2 crossed an electron diffusion region (EDR) of magnetopause reconnection, the first such crossing reported by Burch et al. (2016). This tutorial rebuilds the core of their Figure 2 from burst-mode CDAWeb data: fields and moments in boundary-normal (LMN) coordinates, energy spectrograms, and the current density from the plasma moments, then zooms in on the EDR with the electron energy spectrograms parallel, perpendicular and antiparallel to B of their Figure 3.

Data are read into DataVariables, which keep the CDF coordinates, such as the time-varying energy bins of FPI spectra.

Code
using CDAWeb, SPEDAS
using SpaceDataModel: DataVariable
using Dates, LinearAlgebra, Unitful
using CairoMakie, SpacePhysicsMakie

t0, t1 = DateTime("2015-10-16T13:05:30"), DateTime("2015-10-16T13:07:30")

B = DataVariable(cda"MMS2_FGM_BRST_L2/mms2_fgm_b_gse_brst_l2"(t0, t1))[1:3, :]  # drop |B|
E = DataVariable(cda"MMS2_EDP_BRST_L2_DCE/mms2_edp_dce_gse_brst_l2"(t0, t1))
Ni, Vi, Si = DataVariable.(getdata.(cda"MMS2_FPI_BRST_L2_DIS-MOMS/mms2_dis_numberdensity_brst,mms2_dis_bulkv_gse_brst,mms2_dis_energyspectr_omni_brst", t0, t1))
Ne, Ve, Se = DataVariable.(getdata.(cda"MMS2_FPI_BRST_L2_DES-MOMS/mms2_des_numberdensity_brst,mms2_des_bulkv_gse_brst,mms2_des_energyspectr_omni_brst", t0, t1))
3-element Vector{DataVariable{Float32, N, D, A, DataVariable{CommonDataFormat.TT2000, 1, nothing, Vector{CommonDataFormat.TT2000}, Nothing, CommonDataFormat.LazyVAttrib{CommonDataFormat.CDFDataset{Int64}, Int32}}, CommonDataFormat.LazyVAttrib{CommonDataFormat.CDFDataset{Int64}, Int32}} where {N, D, A<:AbstractArray{Float32, N}}}:
 mms2_des_numberdensity_brst [Time Range: 2015-10-16T13:05:30.014031 to 2015-10-16T13:07:29.985733, Units: cm^-3, Size: (4000,)]
 mms2_des_bulkv_gse_brst [Time Range: 2015-10-16T13:05:30.014031 to 2015-10-16T13:07:29.985733, Units: km/s, Size: (3, 4000)]
 mms2_des_energyspectr_omni_brst [Time Range: 2015-10-16T13:05:30.014031 to 2015-10-16T13:07:29.985733, Units: keV/(cm^2 s sr keV), Size: (32, 4000)]

Boundary-normal coordinates

Minimum variance analysis of the magnetic field across the clean magnetopause crossing at 13:05:40 gives the LMN frame: L along the reconnecting field, N normal to the boundary.

Code
F = mva_eigen(tview(B, DateTime("2015-10-16T13:05:40"), DateTime("2015-10-16T13:06:09")))
F.vectors  # columns: L, M, N in GSE
3×3 StaticArraysCore.SMatrix{3, 3, Float32, 9} with indices SOneTo(3)×SOneTo(3):
  0.368769   0.573991   0.731125
 -0.123627  -0.749286   0.650605
  0.921263  -0.33031   -0.205352

These match the axes of Burch et al.: L = (0.3665, −0.1201, 0.9226), M = (0.5694, −0.7553, −0.3245), N = (0.7358, 0.6443, −0.2084) GSE.

mva(x, F) rotates any vector series into this frame; setcoord updates its coordinate metadata.

Code
lmn(x, sym) = setmeta(setcoord(mva(x, F), "LMN"), "LABLAXIS" => sym, "LABL_PTR_1" => ["$(sym)_$c" for c in "LMN"])

B_lmn = lmn(B, "B")
Vi_lmn = lmn(Vi, "Vi")
E_lmn = lmn(tresample(E, Millisecond(30)), "E")  # 8192 S/s is more than a 2-minute panel can show
SpaceDataModel.DataVariable{Float32, 2, 2, Matrix{Float32}, StepRange{CommonDataFormat.TT2000, Dates.Millisecond}, Dict{Any, Any}}: mms2_edp_dce_lmn_brst_l2
  Time Range: 2015-10-16T13:05:30.000015218 to 2015-10-16T13:07:29.970015218
  Units: mV/m
  Size: (3, 4000)
  Memory Usage: 48.537 KiB
  Metadata:
    FIELDNAM: mms2_edp_dce_lmn_brst_l2
    DISPLAY_TYPE: time_series
    VAR_TYPE: data
    COORDINATE_SYSTEM: LMN
    FILLVAL: Float32[-1.0f31]
    UNITS: mV/m
    VALIDMIN: Float32[-700.0]
    REPRESENTATION_1: mms2_edp_representation1_brst_l2
    VALIDMAX: Float32[700.0]
    SI_CONVERSION: 1.0e-3>V m^-1
    TENSOR_ORDER: Int16[1]
    FORMAT: F8.3
    CATDESC: L2 DC E Field calibrated for SDP and ADP
    DEPEND_0: mms2_edp_epoch_brst_l2
    LABLAXIS: E
    LABL_PTR_1: ["E_L", "E_M", "E_N"]

Current density

The current carried by the plasma is \(\mathbf{J} = e\,n\,(\mathbf{V}_i - \mathbf{V}_e)\), evaluated at the electron cadence (30 ms) with the ion velocity (150 ms) interpolated onto it.

Code
Ve_s, Vi_s, Ne_s = tsync(Ve, Vi, Ne)
J = uconvert.(u"μA/m^2", Unitful.q .* parent(Ne_s)' .* (Vi_s .- Ve_s) .* u"cm^-3 * km/s")
J_lmn = lmn(J, "J")
SpaceDataModel.DataVariable{Unitful.Quantity{Float64, 𝐈 𝐋⁻², Unitful.FreeUnits{(μA, m⁻²), 𝐈 𝐋⁻², nothing}}, 2, 2, Matrix{Unitful.Quantity{Float64, 𝐈 𝐋⁻², Unitful.FreeUnits{(μA, m⁻²), 𝐈 𝐋⁻², nothing}}}, Vector{CommonDataFormat.TT2000}, Dict{Any, Any}}: mms2_dis_bulkv_lmn_brst
  Time Range: 2015-10-16T13:05:30.044031 to 2015-10-16T13:07:29.895733
  Units: km/s
  Size: (3, 3996)
  Memory Usage: 126.686 KiB
  Metadata:
    FIELDNAM: MMS2 FPI/DIS LMN bulk v
    DISPLAY_TYPE: time_series
    VAR_TYPE: data
    DELTA_MINUS_VAR: mms2_dis_bulkv_err_brst
    COORDINATE_SYSTEM: LMN
    FILLVAL: Float32[-1.0f31]
    UNITS: km/s
    DELTA_PLUS_VAR: mms2_dis_bulkv_err_brst
    VALIDMIN: Float32[-2500.0]
    REPRESENTATION_1: mms2_dis_cartrep_brst
    VALIDMAX: Float32[2500.0]
    SI_CONVERSION: 1.0e3>m s^-1
    TENSOR_ORDER: UInt8[0x01]
    FORMAT: E12.2
    CATDESC: MMS2 FPI/DIS ion bulk-velocity vector in LMN during this burst
    SCALETYP: linear
    DEPEND_0: Epoch
    LABLAXIS: J
    LABL_PTR_1: ["J_L", "J_M", "J_N"]

Convection speeds

The perpendicular (convection) speed is \(|\mathbf{V} \times \mathbf{B}| / |\mathbf{B}|\), with B interpolated onto the velocity samples. Electrons and ions convect together where the plasma is frozen-in; their speeds separate where the ions decouple from the field.

Code
vperp(V, sym) = setmeta(mapsamples((v, b) -> norm(v × b) / norm(b), tsync(V, B)...), "LABLAXIS" => sym)
Vperp = [vperp(Vi, "|Vi⊥|"), vperp(Ve, "|Ve⊥|")]
2-element Vector{DataVariable{Float32, 1, 1, Vector{Float32}, DataVariable{CommonDataFormat.TT2000, 1, nothing, Vector{CommonDataFormat.TT2000}, Nothing, SpaceDataModel.OverlayDict{String, Union{String, Vector}, CommonDataFormat.LazyVAttrib{CommonDataFormat.CDFDataset{Int64}, Int32}, Dict{String, Union{String, Vector}}}}, Dict{Any, Union{String, Vector}}}}:
 mms2_dis_bulkv_gse_brst [Time Range: 2015-10-16T13:05:30.044031 to 2015-10-16T13:07:29.895733, Units: km/s, Size: (800,)]
 mms2_des_bulkv_gse_brst [Time Range: 2015-10-16T13:05:30.014031 to 2015-10-16T13:07:29.985733, Units: km/s, Size: (4000,)]

Overview

Code
density = [setmeta(Ni, "LABLAXIS" => "Ni"), setmeta(Ne, "LABLAXIS" => "Ne")]
f = tplot((B_lmn, density, Si, Se, Vi_lmn, Vperp, J_lmn, E_lmn))
tlines!(f, DateTime("2015-10-16T13:07:02.2"))
f

From top: B_L reverses across the magnetopause at 13:05:40 and again near the EDR; magnetosheath ions (~1 keV) and electrons (~100 eV) replace the hot, tenuous magnetospheric plasma; the ion jet in −L marks the reconnection exhaust; electrons convect far faster than ions (|Ve⊥| ≫ |Vi⊥|) as the spacecraft approaches the EDR; J_M peaks at the EDR (vertical line), where E also spikes.

Electron diffusion region

Over three seconds around the EDR, B_L reverses sign, J_M and E peak, and the electron spectra parallel, perpendicular and antiparallel to B change abruptly at 13:07:02.2.

Code
tz0, tz1 = DateTime("2015-10-16T13:07:00.5"), DateTime("2015-10-16T13:07:03.5")
spectra = DataVariable.(getdata.(cda"MMS2_FPI_BRST_L2_DES-MOMS/mms2_des_energyspectr_par_brst,mms2_des_energyspectr_perp_brst,mms2_des_energyspectr_anti_brst", tz0, tz1))
f = tplot((tview(B_lmn, tz0, tz1), tview(J_lmn, tz0, tz1), lmn(tview(E, tz0, tz1), "E"), spectra...))
tlines!(f, DateTime("2015-10-16T13:07:02.2"))
f

Reproducibility

Code
using Pkg
Pkg.status()
Status `~/src/JuliaSpacePhysics/juliaspacephysics.github.io/tutorials/mms_e_mr/Project.toml`
  [950ff2a9] CDAWeb v0.3.3
  [13f3f980] CairoMakie v0.15.16
  [3930f61c] SPEDAS v0.4.0 `~/src/JuliaSpacePhysics/SPEDAS.jl`
  [0b37b92c] SpaceDataModel v0.7.0
  [0c28ffd8] SpacePhysicsMakie v0.4.2
  [1986cc42] Unitful v1.29.0
  [ade2ca70] Dates v1.11.0
  [37e2e46d] LinearAlgebra v1.14.0
Code
using InteractiveUtils # hide
versioninfo()
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 = @.
Back to top