You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello...first time issue reporter here, hopefully I'm doing this right but if not please let me know. It appears that metpy.calc.moist_lapse doesn't work for degrees F, which in turn also causes metpy.calc.wet_bulb_temperature to return wrong values. Here is a test with a temp of 70 F, a dew point of 30 F, and a pressure of 1013 hPa. The wet bulb temperature should be 50.27 degrees F. Thanks!
importmetpy.calcasmpcalcfrommetpy.unitsimportunitstemp_f=70*units('degF')
dewpt_f=30*units('degF')
pressure=1013*units('hPa')
temp_c=temp_f.to('degC')
dewpt_c=dewpt_f.to('degC')
# wet bulb C vs F comparisonwet_bulb_c=mpcalc.wet_bulb_temperature(pressure, temp_c, dewpt_c)
wet_bulb_f=mpcalc.wet_bulb_temperature(pressure, temp_f, dewpt_f)
print('Wet bulb test')
print(wet_bulb_c.to('degF'))
print(wet_bulb_f)
# LCL C vs F comparisonlcl_press_c, lcl_temp_c=mpcalc.lcl(pressure, temp_c, dewpt_c)
lcl_press_f, lcl_temp_f=mpcalc.lcl(pressure, temp_f, dewpt_f)
print('LCL test')
print(lcl_temp_c.to('degF'))
print(lcl_temp_f)
# moist lapse C vs F comparisont_sfc_f=mpcalc.moist_lapse(pressure, lcl_temp_f, lcl_press_f)
t_sfc_c=mpcalc.moist_lapse(pressure, lcl_temp_c, lcl_press_c)
print('Moist lapse test')
print(t_sfc_c.to('degF'))
print(t_sfc_f)
And the output...
Wet bulb test
50.27419018728051 degree_Fahrenheit
38.64463846517734 degree_Fahrenheit
LCL test
21.973671886917185 degree_Fahrenheit
21.973671886917185 degree_Fahrenheit
Moist lapse test
50.27419018728051 degree_Fahrenheit
38.64463846517734 degree_Fahrenheit
Python 3.6.13, Metpy 1.0.1
The text was updated successfully, but these errors were encountered:
Thanks for the report, and all of the detailed information above. You definitely found a corner case in our unit-handling. Testing and fixing this also revealed a direct problem in the unit-handling in wet_bulb_temperature itself too. The fix will be included in the forthcoming 1.1 release.
moist_lapse and wet_bulb_temperature were handling units manually for
various reasons--and weren't getting it quite right. Expand testing to
parameterize across the various temperature units to catch this going
forward.
Also update a test image that barely changed due to minute changes in
the moist_lapse calculation.
moist_lapse and wet_bulb_temperature were handling units manually for
various reasons--and weren't getting it quite right. Expand testing to
parameterize across the various temperature units to catch this going
forward.
Also update a test image and a threshold due to visually imperceptible changes
due to the moist_lapse calculation.
Hello...first time issue reporter here, hopefully I'm doing this right but if not please let me know. It appears that metpy.calc.moist_lapse doesn't work for degrees F, which in turn also causes metpy.calc.wet_bulb_temperature to return wrong values. Here is a test with a temp of 70 F, a dew point of 30 F, and a pressure of 1013 hPa. The wet bulb temperature should be 50.27 degrees F. Thanks!
And the output...
Wet bulb test
50.27419018728051 degree_Fahrenheit
38.64463846517734 degree_Fahrenheit
LCL test
21.973671886917185 degree_Fahrenheit
21.973671886917185 degree_Fahrenheit
Moist lapse test
50.27419018728051 degree_Fahrenheit
38.64463846517734 degree_Fahrenheit
Python 3.6.13, Metpy 1.0.1
The text was updated successfully, but these errors were encountered: