RT1D O-Mode: Appleton vs Sen-Wyller¶
1D O-Mode Formulation Comparison
Compare Appleton-Hartree and Sen-Wyller tracer outputs on the same IRI profile, frequency sweep, and plotting frame.
This page explains:
examples/rtmodel_omode_appleton_sw_demo.py
Call Flow¶
main()parses config/time/frequency arguments (--fmin,--fmax,--nfreq,--mode).load_config_1D(...)loads bundled or user-providedconfig1D.json.RT1D(...)creates the 1D profile and fetches IRI (and geomag unless--no-geomag).- Two tracer runs are executed with the same mode and sweep:
formulation="appleton"formulation="senwyller"- A single-panel figure is built with:
- Appleton and Sen-Wyller virtual-height traces
- IRI
f_pprofile on main axis - IRI
N_eprofile on top axis - Script logs numerical summaries and output path via
loguru.
Key Code (From rtmodel_omode_appleton_sw_demo.py)¶
1) Shared Profile Setup¶
cfg = load_config_1D(config_path)
rt = RT1D(
cfg=cfg,
time=event_time,
fetch_iri=True,
fetch_geomag=not args.no_geomag,
fetch_msise=False,
workers=max(1, int(getattr(cfg, "worker", 1))),
)
2) Same-Mode, Different-Formulation Tracers¶
out_a = rt.NVIS_tracer(
freq_mhz=freqs_mhz,
mode=args.mode,
formulation="appleton",
use_nonuniform_grid=not args.uniform_grid,
nonuniform_points=int(args.nonuniform_points),
nonuniform_sharpness=float(args.nonuniform_sharpness),
)
out_s = rt.NVIS_tracer(
freq_mhz=freqs_mhz,
mode=args.mode,
formulation="senwyller",
use_nonuniform_grid=not args.uniform_grid,
nonuniform_points=int(args.nonuniform_points),
nonuniform_sharpness=float(args.nonuniform_sharpness),
)
3) Overlay Plot (Trace + f_p + N_e)¶
ax.plot(freqs_mhz, vh_app, ...)
ax.plot(freqs_mhz, vh_sw, ...)
ax.plot(pf_mhz, alt_km, ..., label="IRI fp profile")
ax_top = ax.twiny()
ax_top.semilogx(ne_m3, alt_km, ..., label="IRI Ne profile")
Run¶
O-mode sweep:
cd /home/chakras4/Research/CodeBase/trace
python examples/rtmodel_omode_appleton_sw_demo.py \
--fmin 3 --fmax 7 --nfreq 51 --mode O
Three-frequency compact run:
Interpretation Note¶
At upper frequencies, Sen-Wyller may deviate strongly from Appleton-Hartree due to generalized collisional response behavior. Keep all profile/config inputs the same when comparing formulations.
Output Figure¶
Default output:
docs/examples/figures/rt1d_omode_appleton_vs_sw.png
Related Files¶
examples/rtmodel_omode_appleton_sw_demo.pyhfpytrace/model/rt1d.pyhfpytrace/model/dispersion.pyhfpytrace/density/iri.pyhfpytrace/geomag.py
