SolarEnergeticParticle.SolarEnergeticParticle — Module
SolarEnergeticParticle.jl
Solar Energetic Particle (SEP) event analysis: onset determination and velocity dispersion analysis.
Quick Start
Work on any time series (see TimeseriesUtilities's data model), e.g. data from CDAWeb.jl for most SEP instruments:
using Pkg; Pkg.add("SolarEnergeticParticle")
using SolarEnergeticParticle, CDAWeb, Dates
PH = cda"SOHO_ERNE-HED_L2-1MIN/PH"("2021-10-28T06", "2021-10-29") # proton flux, channels × time
bg = (DateTime("2021-10-28T10"), DateTime("2021-10-28T12")) # background interval
find_onset(view(PH, 4, :), bg) # (; time, N, bg_mean, bg_std) of channel 4
find_onset(NSigma(n = 3), PH, bg) # one per channel
r = vda(PH, bg) # release time and path length from the channel onsets
r.release_time, r.path_lengthAPI
find_onset([f = CUSUM()], x, (t0, t1); N = Minute(30), dim): onset of each channel ofxaftert1, judged against the background[t0, t1]: the sample before the firstNconsecutive warnings.Nis a sample count or a duration (Minute(30)is 30 samples at 1-minute cadence). Returns(; time, N, bg_mean, bg_std)for a vector, else an array of them;timeisnothingwithout onset. Throws if[t0, t1]has no samples or fewer than 2 follow it.f(bg, I)returns which samples ofIwarn (aBoolvector), given the background samplesbg. NaN samples are excluded from both; they neither extend nor break a run. A warning on the first sample ofIis ignored.CUSUM(; n = 2, k, h): Poisson-CUSUM. No onset (time = nothing) when the background has no spread (e.g. all-zero counts;NSigmastill works there) or fewer than 2 samples.NSigma(; n = 2): samples aboveμ + n σof the background.
vda(onsets, energies; particle = :proton, mass): velocity dispersion analysis, fittingt = t₀ + (s/c) β⁻¹to onset times at kinetic energies in MeV;mass(MeV/c²) overridesparticle(:proton,:electron).nothingonsets are skipped.vda([f = CUSUM()], x, (t0, t1); energies, dim, particle, mass, N): from the channel onsetsfind_onset(f, x, (t0, t1); dim, N)ofx.energiesdefaults to the channel coordinate, converted to MeV from itsUNITS(eV, keV, MeV, GeV).- Returns
(; release_time, path_length, release_time_error, path_length_error, r2, onsets, energies, inverse_betas, slope, intercept): path length in AU, standard errors (NaNwith two onsets), the release time error in seconds.
- Returns
References
- Palmroos, C., Gieseler, J., Dresing, N., et al. (2022). Solar energetic particle time series analysis with Python. Front. Astron. Space Sci. 9. doi:10.3389/fspas.2022.1073578
- Huttunen-Heikinmaa, K., Valtonen, E., & Laitinen, T. (2005). Proton and helium release times in SEP events observed with SOHO/ERNE. A&A 442, 673. doi:10.1051/0004-6361:20042620
Elsewhere
- SEPpy, SERPENTINE (Python)
- VDA (Python)
Tutorials
- Onset Analysis: CUSUM and n-sigma onset determination
- Velocity Dispersion Analysis (VDA): particle release times and path lengths
Missions
Any CDAWeb dataset loads with CDAWeb.jl; these pages show SEP instruments of
API Reference
SolarEnergeticParticle.find_onset — Function
find_onset([f = CUSUM()], x, (t0, t1); N = Minute(30), dim = nothing)SolarEnergeticParticle.vda — Function
vda(onsets, energies; particle = :proton, mass = MASS[particle])
vda([f = CUSUM()], x, (t0, t1); energies, dim, particle, mass, N)Least-squares fit of
\[t = t_0 + \frac{s}{c} β^{-1}, \quad β = \sqrt{1 - \left(\frac{1}{1 + E / mc^2}\right)^2}\]
with slope $s/c$ (s) and intercept $t_0$ (Unix s).
SolarEnergeticParticle.CUSUM — Type
CUSUM(; n = 2, k = nothing, h = nothing)Poisson-CUSUM warnings of intensity I over background bg with mean μ and standard deviation σ. The CUSUM function of the standardized intensity $I_z = (I - μ) / σ$ is
\[S_i = \max(0, I_{z,i} - k + S_{i-1}), \quad S_1 = 0\]
and each $S_i > h$ is a warning.
- $k = n / (\ln(μ + nσ) - \ln μ)$ unless given, rounded to the nearest integer when $k > 1$.
- $h = 1$ when $k ≤ 1$, else $2$ (Huttunen-Heikinmaa et al. 2005), unless given.
SolarEnergeticParticle.NSigma — Type
NSigma(; n = 2)Warnings where intensity I exceeds the background mean plus n standard deviations.