scripts
Scripts are not included in the main Analysator module import; instead, these are separate scripts utilising Analysator to some purpose.
biot_savart
Follow Welling et al. (2020) calculate the magnetic field at Earth’s surface.
Integrate Biot-Savart over:
All currents within the Vlasov domain
Birkeland currents (FACs) in the “gap region” between the MHD inner boundary and the ionosphere, mapped (assuming J propto B) along the field lines connecting ionosphere radius R_IONO to coupling radius r_C
Horizontal Ionospheric currents (altitude 100 km)
The integration is a discrete summation over the 3 domains.
Integrating the domain #2 will likely require this mesh to be ‘refined’ in order to resolve the FAC structures see the functions refine_mesh() and graded_mesh()
This script has been tested with the Vlasiator runs EGL, FHA, FIA note that the usefulness for EGL is limited because there is no ionosphere (domain #3) for that run
To run this script, require access to the data reducer/variable ‘vg_J’ in the .vlsv file This may be supplied by a .vlsv file’s vlsvReader object, see keyword f_J_sidecar
This script is written for the UH environment. Adapt file paths as needed.
###
EXAMPLE CALL (1 thread): python biot_savart.py -nproc 1 -task 1 -run FHA
- Example sidecar .vlsv files, containing ground magnetic field data, can be found at:
/wrk-vakka/group/spacephysics/vlasiator/3D/{run name}/sidecars/ig_B/
gics
Given a batch of .vlsv files, containing ground magnetic field vector data at different times, calculate the north & east components of induced ground electric field [V/m], and save in corresponding .vlsv files
This script has been tested with the Vlasiator runs EGL, FHA, FIA note that the usefulness for EGL is limited because there is no ionosphere (domain #3) for that run
Note that the Geomagnetically Induced Currents (GICs) can be computed immediately from the geoelectric field: The surface current density is J = sigma*E, where E, sigma are respectively the ground electric field and conductivity.
This script is written for the UH environment. Adapt file paths as needed.
###
- EXAMPLE CALL:
python gics.py
- Example sidecar .vlsv files, containing ground magnetic field data (over the ionosphere mesh), can be found at:
/wrk-vakka/group/spacephysics/vlasiator/3D/FHA/bulk1_sidecars/geoelectric_field/
magnetopause2d
Finds the magnetopause position by tracing steamines of the plasma flow for two-dimensional Vlasiator runs. Needs the yt package.
magnetopause3d
Finds the magnetopause position by tracing steamines of the plasma flow for three-dimensional Vlasiator runs. Needs the yt package.
obliqueshock
Calculates shock crossing values from Rankine-Hugoniot relations in the deHoffmann-Teller (dHT) frame.
obliqueshock_nif
Script calculates shock crossing values from Rankine-Hugoniot relations in the normal incidence frame (NIF).
shue
See Shue et al. (1997): “A new functional form to study the solar wind control of the magnetopause size and shape”
They describe a model where the radial magnetopause position r is treated as a function of angle wrt x-GSE axis
r(theta) = r_0 * (2 / (1+ cos(theta)))^alpha
r_0 is the subsolar standoff distance [in earth radii], alpha is a dimensionless parameter
- The parameters r_0, alpha depend on the solar wind parameters:
B_z: z-component (GSE) of the magnetic field [nT] n_p: number density [cm^-3] v_sw: solar wind speed [km/sec]
Different Vlasiator runs had
Example usage (plot magnetopause for run ‘EGI’):
import numpy as np import matplotlib.pyplot as plt
theta = np.linspace(0,np.pi / 2, 1000) r, r0, alpha = f_shue(theta, run=’EGI’) x = r*np.cos(theta) y = r*np.sin(theta) plt.plot(x,y)