sharppy / SHARPpy

Sounding/Hodograph Analysis and Research Program in Python
https://sharppy.github.io/SHARPpy/index.html
Other
220 stars 110 forks source link

lhp calculation error #220

Open kelliecook opened 3 years ago

kelliecook commented 3 years ago

Hello,

I think there may be an error in the lhp parameter calculation in params. In Johnson and Sugden 2014, when Term A and Term B are both negative, the LHP should be set to 0. However in the current code:

    if term_a < 0:
        term_a = 0

and further,

    if term_b < 0:
        term_b = 0

I think it should be:

  if term_a and term_b < 0:
     LHP = 0

Otherwise, setting either Term A or B to 0 separately will consistently result in a value of 5, since we are multiplying by a negative number and then adding 5.

Hope that makes sense! And thanks for creating such a great program!

Best wishes, Kellie.