Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MetObsCommon
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MetObs
MetObsCommon
Commits
7e26307e
Verified
Commit
7e26307e
authored
6 years ago
by
David Hoese
Browse files
Options
Downloads
Patches
Plain Diff
Fix calc module for dewpoint calculations
parent
5f8df287
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
metobscommon/util/calc.py
+3
-3
3 additions, 3 deletions
metobscommon/util/calc.py
with
3 additions
and
3 deletions
metobscommon/util/calc.py
+
3
−
3
View file @
7e26307e
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment