Skip to content

Use integrate.quad for exact gaseous attenuation slant path#100

Open
inigodelportillo wants to merge 1 commit intomasterfrom
claude/amazing-gagarin
Open

Use integrate.quad for exact gaseous attenuation slant path#100
inigodelportillo wants to merge 1 commit intomasterfrom
claude/amazing-gagarin

Conversation

@inigodelportillo
Copy link
Copy Markdown
Owner

Refactor gaseous attenuation calculation for slant paths to use scipy.integrate.quad for numerical integration of ITU-R P.676 Equation 11.

Changes

  • Replace step-based approximation (iterating over 922 height steps) with exact numerical integration
  • Use scipy.integrate.quad to integrate from ground level (or station height) to 100 km
  • Correctly handle cases where earth station height h > 0 (not at sea level)
  • Simplify code logic and improve numerical accuracy
  • Remove obsolete step calculation variables (delta_h, h_n, n_ratio, etc.)

Benefits

  • More accurate slant path attenuation calculation
  • Cleaner, more maintainable code
  • Proper handling of non-sea-level earth stations

…. 11)

Replace the step-based loop approximation in _ITU676_12_ exact mode with
scipy.integrate.quad applied directly to Eq. 11 of ITU-R P.676-12. This
implements the method the Recommendation itself prescribes (footnote: "the
quad function in Python"), eliminates the discrete-step error, and correctly
handles earth stations not at sea level (h > 0).

Addresses: #50

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant