Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AossTower
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Model registry
Monitor
Incidents
Analyze
Value stream analytics
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
AossTower
Commits
7013704f
Verified
Commit
7013704f
authored
5 years ago
by
David Hoese
Browse files
Options
Downloads
Patches
Plain Diff
Fix accumulated precipitation using wrong units
Data comes from instrument in inches but was being used as millimeters
parent
f755c3ac
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aosstower/level_b1/nc.py
+5
-0
5 additions, 0 deletions
aosstower/level_b1/nc.py
aosstower/schema.py
+4
-1
4 additions, 1 deletion
aosstower/schema.py
with
9 additions
and
1 deletion
aosstower/level_b1/nc.py
+
5
−
0
View file @
7013704f
...
@@ -39,6 +39,11 @@ def get_data(input_files):
...
@@ -39,6 +39,11 @@ def get_data(input_files):
frame
=
pd
.
DataFrame
(
_get_data
(
input_files
))
frame
=
pd
.
DataFrame
(
_get_data
(
input_files
))
frame
=
frame
.
set_index
(
'
stamp
'
)
frame
=
frame
.
set_index
(
'
stamp
'
)
frame
=
frame
.
mask
(
frame
==
-
99999.
).
fillna
(
value
=
np
.
nan
)
frame
=
frame
.
mask
(
frame
==
-
99999.
).
fillna
(
value
=
np
.
nan
)
for
col_name
in
frame
.
columns
:
if
col_name
in
schema
.
unit_conversions
:
conv_func
=
schema
.
unit_conversions
[
col_name
]
frame
[
col_name
]
=
conv_func
(
frame
[
col_name
])
return
frame
return
frame
...
...
This diff is collapsed.
Click to expand it.
aosstower/schema.py
+
4
−
1
View file @
7013704f
...
@@ -241,7 +241,7 @@ database = dict(
...
@@ -241,7 +241,7 @@ database = dict(
'
accumulated_precipitation
'
,
'
accumulated_precipitation
'
,
'
accum_precip
'
,
'
accum_precip
'
,
'
Precipitation accumulated since 0Z
'
,
'
Precipitation accumulated since 0Z
'
,
'
mm
'
,
'
mm
'
,
# data comes from instrument as inches but we typically want millimeters
'
0
'
,
'
0
'
,
'
254
'
,
'
254
'
,
None
,
None
,
...
@@ -273,3 +273,6 @@ database_dict = {k: v._asdict() for k, v in database.items()}
...
@@ -273,3 +273,6 @@ database_dict = {k: v._asdict() for k, v in database.items()}
met_vars
=
{
'
air_temp
'
,
'
dewpoint
'
,
'
rh
'
,
'
solar_flux
'
,
'
pressure
'
,
'
precip
'
,
'
accum_precip
'
,
met_vars
=
{
'
air_temp
'
,
'
dewpoint
'
,
'
rh
'
,
'
solar_flux
'
,
'
pressure
'
,
'
precip
'
,
'
accum_precip
'
,
'
wind_speed
'
,
'
wind_dir
'
,
'
gust
'
}
'
wind_speed
'
,
'
wind_dir
'
,
'
gust
'
}
engr_vars
=
set
(
database
.
keys
())
-
met_vars
engr_vars
=
set
(
database
.
keys
())
-
met_vars
unit_conversions
=
{}
unit_conversions
[
'
accum_precip
'
]
=
lambda
x
:
x
*
25.4
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