NeXtYZ Inversion (pynasonde.vipir.analysis.nextyz)¶
NeXtYZ 3-D Electron Density Inversion for Dynasonde Ionograms
Physics-based Wedge-Stratified Ionosphere (WSI) model with Hamiltonian ray tracing. Recovers 3-D tilted N(h) profiles from direction-finding echo DataFrames. Implements Zabotin et al. (2006).
Theory¶
The Wedge-Stratified Ionosphere (WSI) model represents the local electron density as a stack of plasma-frequency wedges. Each wedge boundary is a frame plane (h, nₓ, nᵧ) encoding ionospheric tilt.
A Hamiltonian ray-tracer (eikonal ODE with full Appleton-Lassen refractive index) propagates sounding signals through the model. Wedge parameters are solved bottom-up in a least-squares loop minimising:
- Group-range residual
ΔR′ᵢ₊₁ - Ground-return distance of the mean-direction ray (tilt constraint)
Two variants¶
| Variant | Solved per wedge | Notes |
|---|---|---|
| NeXtYZ Lite (default) | h only; tilts from mean angles of arrival | ~6× faster |
| NeXtYZ Full | h, nₓ, nᵧ (alternating optimisation) | Full 3-D tilt |
Coordinate system¶
ODE independent variable τ (km): dr/dτ = group-slowness direction.
Required DataFrame columns¶
| Column | Type | Description |
|---|---|---|
xl_km |
float | Dynasonde echolocation East coordinate (km) |
yl_km |
float | Dynasonde echolocation North coordinate (km) |
height_km |
float | Observed group range R′ (km) |
frequency_khz |
float | Sounding frequency (kHz) |
mode |
str | "O" or "X" (optional, O-mode preferred) |
amplitude_db |
float | Echo amplitude (optional, for weighting) |
Classes¶
pynasonde.vipir.analysis.nextyz
¶
nextyz.py — NeXtYZ 3-D electron density inversion for Dynasonde ionograms.
Physics-based implementation of
Zabotin, N. A., Wright, J. W., & Zhbankov, G. A. (2006). NeXtYZ: Three-dimensional electron density inversion for dynasonde ionograms. Radio Science, 41, RS6S32, doi:10.1029/2005RS003352.
The Wedge-Stratified Ionosphere (WSI) model represents the local electron density as a stack of plasma-frequency wedges. Each wedge is bounded above by a frame plane whose orientation (nₓ, nᵧ) encodes the ionospheric tilt at that height. A Hamiltonian ray-tracer (eikonal / method of characteristics with the full Appleton-Lassen refractive index) propagates sounding signals through the WSI model. Wedge parameters are determined bottom-up in a least-squares loop that alternately minimises:
- Group-range residual ΔR'ᵢ₊₁ = √Σⱼ(ρ'ᵢ₊₁,ⱼ − R'ᵢ₊₁,ⱼ)²
- Ground-return distance of the mean-direction ray (tilt constraint)
NeXtYZ Lite (default) — constant tilts per broad layer (E, F) derived from mean angles of arrival; only hᵢ₊₁ is optimised per wedge. ~6× faster.
NeXtYZ Full — (hᵢ₊₁, nₓᵢ₊₁, nᵧᵢ₊₁) solved per wedge with alternating optimisation.
This module provides:
:class:WedgePlane
Dataclass holding the solved parameters of one WSI wedge boundary.
:class:NeXtYZResult
Output dataclass — fp(h) profile, tilt angles, height error bars.
:class:NeXtYZInverter
Processor — runs the full inversion pipeline from an echo DataFrame.
Coordinate system¶
Local Cartesian centred at the sounder::
x = geographic East (km)
y = geographic North (km)
z = vertical Up (km)
The ODE independent variable τ (km) parameterises ray trajectories so that dr/dτ = group-slowness direction (dimensionless). Group range R' = c·t (km) accumulated during integration.
Required DataFrame columns¶
xl_km, yl_km — Dynasonde echolocation coordinates (km) height_km — Observed group range R' (km) frequency_khz — Sounding frequency (kHz) mode — Magnetoionic polarization "O" or "X" (optional) amplitude_db — Echo amplitude in dB (optional)
Notes¶
- Collisions are neglected (valid for E and F regions, paper §4).
- For the first wedge the Titheridge underlying-ionisation model is approximated by a linear ramp from 0 to fp_start below the lowest observed echo. Full Titheridge model integration is future work.
- NeXtYZ replaces POLAN as the standard profile inversion algorithm for Dynasonde data. It has been deployed operationally since March 2005.
NeXtYZInverter
¶
NeXtYZ 3-D electron density inversion for Dynasonde ionograms.
Implements the WSI model and Hamiltonian ray-tracing inversion of Zabotin, Wright & Zhbankov (2006) Radio Sci. 41, RS6S32.
Parameters¶
dip_angle_deg
Geomagnetic dip angle at the station (degrees, positive downward in the northern hemisphere).
declination_deg
Geomagnetic declination (degrees, east positive).
B_gauss
Geomagnetic field magnitude (gauss). Electron gyrofrequency fH = 2.80 × B_gauss (MHz).
fp_step_mhz
Plasma-frequency step per wedge (MHz). Default 0.05 (paper §5).
min_echoes
Minimum echoes required to solve a wedge. Default 10 (paper §5).
max_echoes
Maximum echoes used per wedge (top-amplitude selected). Default 50 (paper §5).
mode
"Lite" — constant tilts per layer, hᵢ₊₁ only (fast).
"Full" — (hᵢ₊₁, nₓᵢ₊₁, nᵧᵢ₊₁) per wedge.
fp_start_mhz
Lowest plasma frequency to begin inversion (MHz). Default 0.5.
xl_col, yl_col, height_col, freq_col, mode_col, amp_col: Column names in the input echo DataFrame.
Examples¶
inv = NeXtYZInverter( ... dip_angle_deg=70.0, ... declination_deg=-5.0, ... B_gauss=0.55, ... mode="Lite", ... ) result = inv.fit(echo_df) print(result.summary()) ScaledParameters: foE=… MHz …
Notes¶
Input DataFrame must contain echolocation columns xl_km, yl_km
(km) in addition to the standard height_km (group range R') and
frequency_khz. These come from the Dynasonde seven-parameter set:
XL, YL are the echolocation coordinates of the group path vector endpoint
(Paul et al. 1974).
Source code in pynasonde/vipir/analysis/nextyz.py
396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 | |
fit(df)
¶
Run the NeXtYZ inversion.
Parameters¶
df
Echo DataFrame — must contain xl_km, yl_km,
height_km (group range R'), frequency_khz.
Optionally: mode (O/X) and amplitude_db.
Returns¶
NeXtYZResult
Source code in pynasonde/vipir/analysis/nextyz.py
1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 | |
NeXtYZResult
dataclass
¶
Output of the NeXtYZ inversion.
Parameters¶
wedges
List of solved :class:WedgePlane objects (bottom to top).
method
"Lite" or "Full".
fp_profile_mhz
Plasma frequency at each solved frame plane (MHz).
h_true_km
True height at each frame plane (km).
h_errors_km
Real-height error estimates Δhᵢ₊₁ from paper §7.
tilt_meridional_deg
Frame-plane tilt from vertical in the meridional (x–z) plane (degrees). Computed as arctan2(nₓ, nz) where nz = √(1 − nₓ² − nᵧ²).
tilt_zonal_deg
Frame-plane tilt from vertical in the zonal (y–z) plane (degrees). Computed as arctan2(nᵧ, nz).
converged
Boolean per wedge (True when ΔR' < 10 km).
Source code in pynasonde/vipir/analysis/nextyz.py
240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 | |
to_dataframe()
¶
Return the profile as a DataFrame (one row per wedge boundary).
Source code in pynasonde/vipir/analysis/nextyz.py
summary()
¶
One-line text summary.
Source code in pynasonde/vipir/analysis/nextyz.py
plot(ax=None)
¶
Plot the fp(h) profile with error bars and tilt angles.
When ax is None a new two-panel figure is created
(profile left, tilt angles right, sharing the height axis).
Parameters¶
ax
Optional existing axes for the profile panel only.
Returns¶
matplotlib.axes.Axes — profile axes.
Source code in pynasonde/vipir/analysis/nextyz.py
WedgePlane
dataclass
¶
Solved parameters for one WSI wedge boundary.
Parameters¶
fp_lo_mhz, fp_hi_mhz: Plasma-frequency bounds of the wedge (MHz).
h_upper_km
Vertical height of the upper frame plane (km).
nx, ny:
Horizontal components of the upper frame plane's unit normal
vector. nz = sqrt(1 − nx² − ny²).
residual_km
RMS group-range residual ΔR'ᵢ₊₁ converted to height (km).
n_echoes
Number of echoes used in this wedge's optimisation.
Source code in pynasonde/vipir/analysis/nextyz.py
NeXtYZInverter¶
Quick start¶
from pynasonde.vipir.analysis import NeXtYZInverter, PolarizationClassifier
# 1. Label modes
clf = PolarizationClassifier(o_mode_sign=-1)
pol = clf.fit(echo_df)
# 2. Run NeXtYZ Lite inversion
inv = NeXtYZInverter(
mode="lite", # "lite" (fast) or "full" (3-D tilts)
fp_step_mhz=0.05, # plasma frequency step between wedge boundaries
B_gauss=0.5, # geomagnetic field strength (Gauss) for Appleton-Lassen
dip_deg=60.0, # magnetic dip angle (degrees)
)
result = inv.fit(pol.annotated_df)
print(result.summary())
result.plot()
WedgePlane dataclass¶
Parameters of one WSI wedge boundary after inversion.
| Field | Type | Description |
|---|---|---|
height_km |
float |
Frame plane height (km) |
fp_mhz |
float |
Plasma frequency at this boundary (MHz) |
nx |
float |
East tilt component of frame normal |
ny |
float |
North tilt component of frame normal |
nz |
float |
Vertical component (derived: √(1−nₓ²−nᵧ²)) |
group_range_residual |
float |
R′ residual after optimisation (km) |
NeXtYZResult dataclass¶
| Field | Type | Description |
|---|---|---|
wedge_planes |
list[WedgePlane] |
Solved WSI wedge boundaries |
profile_df |
DataFrame |
Columns: height_km, fp_mhz, electron_density_cm3, tilt_east_deg, tilt_north_deg |
foF2_mhz |
float |
F2 critical frequency (MHz) |
hmF2_km |
float |
F2 peak height (km) |
n_wedges |
int |
Number of WSI wedge boundaries solved |
mean_residual_km |
float |
Mean group-range residual across all wedges (km) |
Methods¶
result.summary() # one-line summary string
result.to_dataframe() # returns profile_df
result.plot() # N(h) profile + tilt angle vs height
Physical assumptions¶
Collisions neglected
Collisions are neglected (valid for E and F regions above ~90 km, per Zabotin et al. 2006 §4).
First-wedge underlying ionisation
The underlying ionisation below the lowest echo is approximated by a linear ramp from 0 to fp_start. Full Titheridge underlying-ionisation integration is future work.
References¶
Zabotin, N. A., Wright, J. W., & Zhbankov, G. A. (2006). NeXtYZ: Three-dimensional electron density inversion for Dynasonde and ARTIST ionosondes. Radio Science, 41, RS6S32. https://doi.org/10.1029/2005RS003352
See Also¶
- Analysis Overview
- True Height Inversion — 1-D lamination alternative (faster, no tilt)
- Polarization Classifier — provides mode-labelled input