Skip to content
Snippets Groups Projects
Verified Commit 7e26307e authored by David Hoese's avatar David Hoese
Browse files

Fix calc module for dewpoint calculations

parent 5f8df287
Branches
No related tags found
No related merge requests found
...@@ -40,7 +40,7 @@ def dewpoint(tempC, relhum): ...@@ -40,7 +40,7 @@ def dewpoint(tempC, relhum):
if pd is not None and isinstance(dp, pd.Series): if pd is not None and isinstance(dp, pd.Series):
return pd.concat([dp - 273.15, tempC], axis=1).min(axis=1) return pd.concat([dp - 273.15, tempC], axis=1).min(axis=1)
return np.min(dp - 273.15, tempC) return np.min([dp - 273.15, tempC])
def relhum(airTempK, dewpointTempK): def relhum(airTempK, dewpointTempK):
...@@ -51,7 +51,7 @@ def relhum(airTempK, dewpointTempK): ...@@ -51,7 +51,7 @@ def relhum(airTempK, dewpointTempK):
:param airTempK: air temperature in Kelvin :param airTempK: air temperature in Kelvin
:param dewpointTempK: dewpoint temp in Kelvin :param dewpointTempK: dewpoint temp in Kelvin
""" """
if airTempK == None or dewpointTempK == None: if airTempK is None or dewpointTempK is None:
return np.nan return np.nan
gas_constant = 461.5 gas_constant = 461.5
...@@ -71,7 +71,7 @@ def potentialtemp(airTempK, pressureMB): ...@@ -71,7 +71,7 @@ def potentialtemp(airTempK, pressureMB):
:param airTempK: air temperature in Kelvin :param airTempK: air temperature in Kelvin
:param pressureMB: air pressure in millibars :param pressureMB: air pressure in millibars
""" """
if airTempK == None or pressureMB == None: if airTempK is None or pressureMB is None:
return np.nan return np.nan
pT = airTempK * (pressureMB.max() / pressureMB) ** .286 pT = airTempK * (pressureMB.max() / pressureMB) ** .286
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment