Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use P676 Eqn 11/12 and integrate.quad to simplify code and resolve w… #50

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alastairUK
Copy link
Contributor

…hat to do when h1 > 0

Basically use the code in -12 Eqn 11/12 rather than the approximation.

As the footnote says:

"Equation (11) can be evaluated using various methods depending on the implementation: e.g. a) the integral
function in Matlab, b) the quad function in Octave, c) the quad function in Python, d) several Numerical
Recipes functions, and other equivalent methods"

This has multiple advantages

  1. It's no longer an approximation
  2. It resolves what to do when h1 > 0 (which is not clear to my eyes in the other method although I can guess what it should do)
  3. It fixes a bug in the current version where the value being used is NOT what the Rec says:

image

If you use this new method and compare to the (fixed as above) old method for a test input at h1 = 0 then I think the delta is circa 1e-6 which is acceptable I think.

Question is what to do for -11/-10. I think you could backport this fix or at least use the midpoint and come up with a way to handle the h1>0 case.

@codecov-commenter
Copy link

codecov-commenter commented Apr 28, 2021

Codecov Report

Merging #50 (4f46929) into master (f751918) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #50   +/-   ##
=======================================
  Coverage   96.61%   96.61%           
=======================================
  Files          25       25           
  Lines        6672     6672           
=======================================
  Hits         6446     6446           
  Misses        226      226           
Impacted Files Coverage Δ
itur/models/itu676.py 98.44% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f751918...4f46929. Read the comment docs.

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.

2 participants