Ionospheric Background Models
MSIS (Neutral Atmosphere)
AURORA.find_msis_file — Function
find_msis_file(; year=2018, month=12, day=7, hour=11, minute=15,
lat=76, lon=5, height=85:1:700)Find or create a MSIS model data file for the specified conditions.
It first searches for an existing MSIS file matching the given parameters. If no matching file is found, it calculates new MSIS data using the Python pymsis package and saves it to a file. The pymsis package will download, compile and run some fortran code under the hood.
Keyword Arguments
year::Int=2018: Yearmonth::Int=12: Month (1-12)day::Int=7: Day of month (1-31)hour::Int=11: Hour in Universal Time (0-23)minute::Int=15: Minute (0-59)lat::Real=76: Geographic latitude in degrees Northlon::Real=5: Geographic longitude in degrees Eastheight::AbstractRange=85:1:700: Altitude range in km
Returns
String: Full path to the MSIS data file
Notes
- Default parameters correspond to the VISIONS-2 rocket launch conditions
- Files are stored in
internal_data/data_neutrals/directory
IRI (Ionosphere)
AURORA.find_iri_file — Function
find_iri_file(; year=2018, month=12, day=7, hour=11, minute=15,
lat=76, lon=5, height=85:1:700)Find or create an IRI model data file for the specified conditions.
It first searches for an existing IRI file matching the given parameters. If no matching file is found, it calculates new IRI data using the Python iri2020 package and saves it to a file. The iri2020 package will compile and run some fortran code under the hood.
Keyword Arguments
year::Int=2018: Yearmonth::Int=12: Month (1-12)day::Int=7: Day of month (1-31)hour::Int=11: Hour in Universal Time (0-23)minute::Int=15: Minute (0-59)lat::Real=76: Geographic latitude in degrees Northlon::Real=5: Geographic longitude in degrees Eastheight::AbstractRange=85:1:700: Altitude range in km
Returns
String: Full path to the IRI data file
Notes
- Default parameters correspond to the VISIONS-2 rocket launch conditions
- Files are stored in
internal_data/data_electron/directory
Species density profiles and laws
AURORA.MSISDensity — Type
MSISDensity(msis_file, species)Density profile backed by an MSIS file. Callable on an altitude grid (m), returns the density vector (m⁻³) for the requested species (:N2, :O2, or :O).
Example
profile = MSISDensity(find_msis_file(), :N2)
n = profile(altitude_grid.h) # Vector{Float64}, length == length(altitude_grid.h)AURORA.VectorDensity — Type
VectorDensity(h, n)Density profile defined by user-supplied altitude (h, m) and density (n, m⁻³) vectors. Callable on any altitude grid (m); evaluates via PCHIP interpolation in log-space, consistent with AURORA's MSIS interpolation convention.
Example
profile = VectorDensity(h_msis_m, n_N2)
n = profile(altitude_grid.h)AURORA.@law — Macro
@law exprWrap a law expr (e.g. z -> exp(-z)) into an ExprLaw, capturing its source text so it can be saved and reloaded verbatim. Use this instead of a bare anonymous function for any density profile, cascading law, or phase-function generator.
AURORA.ExprLaw — Type
ExprLawSerialization-friendly wrapper around a user-supplied physical law. This can be a density profile, a cascading secondary-distribution law, a phase-function generator, etc. It stores the law's source as a string so the model can round-trip through JLD2: only the string is written to disk, and the callable is rebuilt by parsing and evaluating that string on load.
Build one with the @law macro:
density = @law z -> 1e18 .* exp.(-(z .- 100e3) ./ 30e3)
secondary_e_law = @law (E_s, E_p) -> 1 / (11.4^2 + E_s^2)To ensure reproducibility, laws must be self-contained: closed-form expressions referencing only their arguments and names available in AURORA/Base. A law that needs to carry e.g. parameters should be constructed as a functor struct instead. To ensure this, trying to build a @law that captures local variables will throw an error.