RT2D Cartesian Oblique Rays from IRI¶
2D Cartesian Gradient Tracing Workflow
Build a route-based 2D IRI electron-density grid, run Cartesian oblique rays with
RT2D.oblique_trace(..., coordinate_system="cartesian"), and overlay
rays on the density field.
This page explains:
examples/run_rt2d_iri_cartesian.py
Call Flow¶
main()parses CLI (--config,--event,--mode,--formulation)._run(...)builds a ground-referenced altitude grid and fetches IRI through:RT2DProfile.from_cfg(..., fetch_iri=True)- Density below config floor is zeroed by:
RT2DProfile.force_zero_density_below(cfg.start_height_km)RT2D(profile=...)initializes the 2D tracer._trace_fan_cartesian(...)runs a fan of rays using:oblique_trace(..., coordinate_system="cartesian")_plot_density_and_rays(...)draws electron density + rays usingPlotRays.
Key Code¶
1) Build Profile and Apply Lower-Altitude Mask¶
profile = RT2DProfile.from_cfg(
cfg=cfg,
time=event_time,
alt_km=alt_km,
fetch_iri=True,
fetch_msise=False,
fetch_geomag=False,
workers=workers,
)
n_rows = profile.force_zero_density_below(float(cfg.start_height_km))
model = RT2D(profile=profile)
2) Cartesian Oblique Fan Tracing¶
out = model.oblique_trace(
freq_hz=float(f_mhz) * 1e6,
elevation_deg=float(elev_deg),
coordinate_system="cartesian",
x0_km=0.0,
z0_km=float(heights_km[0]),
mode=mode,
formulation=formulation,
)
3) Density + Rays Plot¶
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¶
Custom options:
python examples/run_rt2d_iri_cartesian.py \
--config hfpytrace/cfg/config2D.json \
--event 2017-05-27T16:00:00Z \
--mode O \
--formulation appleton-hartree
Output Figure¶
Related Files¶
examples/run_rt2d_iri_cartesian.pyhfpytrace/model/rt2d.pyhfpytrace/density/iri.pyhfpytrace/plottrace.py
