Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
NOCSurfaceProcesses
AirSeaFluxCode
Commits
a97c4bfc
You need to sign in or sign up before continuing.
Commit
a97c4bfc
authored
3 years ago
by
Richard Cornes
Browse files
Options
Download
Email Patches
Plain Diff
Changed certain output columns names to match old code
parent
6b91d553
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
603 deletions
+13
-603
Code/AirSeaFluxCode.py
Code/AirSeaFluxCode.py
+7
-5
Code/AirSeaFluxCode_test.py
Code/AirSeaFluxCode_test.py
+6
-598
No files found.
Code/AirSeaFluxCode.py
View file @
a97c4bfc
...
...
@@ -423,8 +423,8 @@ class S88:
# Do not calculate lhf if a measure of humidity is not input
# This gets filled into a pd dataframe and so no need to specify y dimension of array
if
(
self
.
hum
[
0
]
==
'no'
):
self
.
latent
,
self
.
qsr
,
self
.
q10n
,
self
.
qref
,
self
.
qair
,
self
.
rh
=
np
.
empty
(
6
)
self
.
latent
,
self
.
qsr
,
self
.
q10n
,
self
.
qref
,
self
.
qair
,
self
.
rh
=
np
.
full
(
6
,
np
.
nan
)
# Set the final wind speed values
self
.
wind_spd
=
np
.
sqrt
(
np
.
power
(
self
.
wind
,
2
)
-
np
.
power
(
self
.
spd
,
2
))
...
...
@@ -445,13 +445,15 @@ class S88:
if
(
out
==
0
):
res
[:,
self
.
ind
]
=
np
.
nan
# set missing values where data have non acceptable values
if
(
self
.
hum
[
0
]
!=
'no'
):
res
=
np
.
asarray
([
np
.
where
(
self
.
q10n
<
0
,
np
.
nan
,
res
[
i
][:])
for
i
in
range
(
len
(
res_vars
))])
# FIXME: why 41?
if
(
self
.
hum
[
0
]
!=
'no'
):
res
=
np
.
asarray
([
np
.
where
(
self
.
q10n
<
0
,
np
.
nan
,
res
[
i
][:])
for
i
in
range
(
len
(
res_vars
))])
res
=
np
.
asarray
([
np
.
where
(
self
.
u10n
<
0
,
np
.
nan
,
res
[
i
][:])
for
i
in
range
(
len
(
res_vars
))])
else
:
warnings
.
warn
(
"Warning: the output will contain values for points that have not converged and negative values (if any) for u10n/q10n"
)
resAll
=
pd
.
DataFrame
(
data
=
res
.
T
,
index
=
range
(
self
.
nlen
),
columns
=
res_vars
)
# Output pd dataframe with certain column names changed
out_names_dic
=
{
"sensible"
:
"shf"
,
"latent"
:
"lhf"
,
"monob"
:
"L"
,
"itera"
:
"iteration"
,
"wind_spd"
:
"ug"
,
"Rb"
:
"Rib"
,
"tkt"
:
"delta"
}
out_names
=
[
out_names_dic
[
i
]
if
i
in
out_names_dic
.
keys
()
else
i
for
i
in
res_vars
]
resAll
=
pd
.
DataFrame
(
data
=
res
.
T
,
index
=
range
(
self
.
nlen
),
columns
=
out_names
)
resAll
[
"flag"
]
=
self
.
flag
return
resAll
...
...
This diff is collapsed.
Click to expand it.
Code/AirSeaFluxCode_test.py
View file @
a97c4bfc
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment