Usage¶
Main function is Mshpy.msh_param, which provides magnetosheath parameters along certain spacecraft orbit.
- Args:
path: File directory to save outputs.
Start time: in the format of ‘2012-03-01T02:00’
End time: in the same format
Spacecraft name. It should be same as one used in SscWs. See https://sscweb.gsfc.nasa.gov/WebServices/REST/jupyter/SscWsExample.html.
- mpoff: Optional; Manual magnetopause offset along x axis.
Magnetopause model for the MHD-based MSH model is Shue et al. 1998.
- bsoff: Optional; Manual bow shock offset along x axis
Bow shock model for the MHD-based MSH model is Jelinek et al. 2012
- Returns:
Following files are saved in the ‘path’.
Msh_MHD_out.txt: MHD-based model result.
Format:
time Bx[nT] By Bz n[cm^-3] T[eV] Vx[km/s] Vy Vz f x[Re] y z
Msh_Soucek_out.txt: Soucek & Escoubet [2012] model plasma velocity results.
Format:
time x[Re] y z f Vx[km/s] Vy Vz
Msh_Romashets_out.txt: Romashets et al. [2019] model magnetic field results.
Format:
time Bx[nT] By Bz |B|
Msh_Spreiter_out.txt: Spreiter et al. [1966] model plasma speed, density, and temperature results.
Format:
time f n[cm^-3] n[cm^-3] T[eV] |V|[km/s]
Custom trace usage¶
Mshpy.msh_param_custom runs the MHD-based model on an arbitrary trace
under a fixed or externally-supplied solar wind condition, rather than a
real spacecraft orbit with a live OMNI/SSCWeb fetch. Useful for sampling
along a synthetic ray – e.g. a line of sight – rather than an actual orbit.
- Args:
- xyz: (N,3) array of GSE positions (Earth radii), e.g. points sampled
along a line of sight. A file path in the virtual sc trace format (see ‘Datasets’) also works, exactly as with
msh_param.
- sw: dict of scalar solar wind/IMF conditions – keys
Bx, By, Bz, Vx, Vy, Vz, n, Pd, Ma, Mm(nT, nT, nT, km/s, km/s, km/s, cm-3, nPa, unitless, unitless), applied as a constant condition across the whole trace. A file path in the OMNIweb whitespace format (see above) also works.
mpoff: Optional; manual magnetopause offset along x axis.
bsoff: Optional; manual bow shock offset along x axis.
model: Bow shock model,
'jel'(Jelinek et al. 2012) by default.- out_dir: Optional; if given, also writes Msh_MHD_out.txt there, like
msh_paramdoes. DefaultNone– in-memory only, no files written.
- Returns:
A pandas DataFrame (not written to disk unless
out_diris given).Format:
time Bx[nT] By Bz n[cm^-3] Tev[eV] Vx[km/s] Vy Vz f x[Re] y z mpd bsd
f is the fractional distance between the magnetopause and bow shock
along that point’s direction (0 at the MP, 1 at the BS); it is NaN
within 10% of either boundary, per the model’s own reliability cut.
mpd/bsd are the magnetopause/bow shock distances (Earth radii)
along that point’s direction.