Skip to content

RT2D Spherical Oblique Rays from IRI

2D Spherical Gradient Tracing Workflow

Build a route-based 2D IRI grid, run spherical oblique rays with RT2D.oblique_trace(..., coordinate_system="spherical"), and visualize spherical-ray outputs on the same route section.

This page explains:

  • examples/run_rt2d_iri_spherical.py

Call Flow

  1. main() parses CLI (--config, --event, --mode, --formulation, --r-earth-km).
  2. _run(...) fetches IRI on a ground-referenced altitude grid through:
  3. RT2DProfile.from_cfg(..., fetch_iri=True)
  4. Density below config floor is zeroed:
  5. RT2DProfile.force_zero_density_below(cfg.start_height_km)
  6. RT2D(profile=...) initializes interpolation and refractive-index support.
  7. _trace_fan_spherical(...) runs:
  8. oblique_trace(..., coordinate_system="spherical", r_earth_km=...)
  9. _plot_density_and_rays(...) overlays rays over the electron density field.

Key Code

1) Spherical Tracer Call

out = model.oblique_trace(
    freq_hz=float(f_mhz) * 1e6,
    elevation_deg=float(elev_deg),
    coordinate_system="spherical",
    x0_km=0.0,
    z0_km=float(heights_km[0]),
    mode=mode,
    formulation=formulation,
    r_earth_km=float(r_earth_km),
)

2) Plot Overlay

p = PlotRays(oth=True, xlim=[0.0, 1500.0], ylim=[-100.0, y_max * 1.02], figsize=(7, 4))
p.set_density(X, Z, profile.ne_cm3, pf=None)
p.lay_rays(outputs=rays, kind="edens", lcolor="k", lw=0.6, param_alpha=0.85)

Run

cd /home/chakras4/Research/CodeBase/trace
python examples/run_rt2d_iri_spherical.py

Custom options:

python examples/run_rt2d_iri_spherical.py \
  --config hfpytrace/cfg/config2D.json \
  --event 2017-05-27T16:00:00Z \
  --mode O \
  --formulation appleton-hartree \
  --r-earth-km 6371

Output Figure

RT2D IRI Spherical

  • examples/run_rt2d_iri_spherical.py
  • hfpytrace/model/rt2d.py
  • hfpytrace/density/iri.py
  • hfpytrace/plottrace.py