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
7b5cb32e
Commit
7b5cb32e
authored
8 years ago
by
kgao
Browse files
Options
Downloads
Patches
Plain Diff
variables except wind related one updated
averages now start at future minute - 1 to future minute
parent
3ddaab34
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aosstower/level_b1/nc.py
+4
-1
4 additions, 1 deletion
aosstower/level_b1/nc.py
with
4 additions
and
1 deletion
aosstower/level_b1/nc.py
+
4
−
1
View file @
7b5cb32e
...
@@ -8,6 +8,7 @@ from netCDF4 import Dataset
...
@@ -8,6 +8,7 @@ from netCDF4 import Dataset
import
numpy
as
np
import
numpy
as
np
import
platform
import
platform
from
aosstower
import
station
from
aosstower
import
station
from
datetime
import
timedelta
as
delta
LOG
=
logging
.
getLogger
(
__name__
)
LOG
=
logging
.
getLogger
(
__name__
)
...
@@ -118,7 +119,7 @@ def createVariables(ncFile, firstStamp, chunksizes, zlib):
...
@@ -118,7 +119,7 @@ def createVariables(ncFile, firstStamp, chunksizes, zlib):
return
ncFile
return
ncFile
def
minuteAverages
(
frame
):
def
minuteAverages
(
frame
):
frame
[
'
minute
'
]
=
[
ts
.
replace
(
second
=
0
)
for
ts
in
frame
.
index
]
frame
[
'
minute
'
]
=
[
(
ts
+
delta
(
minutes
=
1
))
.
replace
(
second
=
0
)
for
ts
in
frame
.
index
]
newFrame
=
frame
.
groupby
(
'
minute
'
).
mean
()
newFrame
=
frame
.
groupby
(
'
minute
'
).
mean
()
newFrame
.
index
.
names
=
[
''
]
newFrame
.
index
.
names
=
[
''
]
...
@@ -129,6 +130,8 @@ def minuteAverages(frame):
...
@@ -129,6 +130,8 @@ def minuteAverages(frame):
if
'
wind_direction
'
in
columns
:
if
'
wind_direction
'
in
columns
:
del
newFrame
[
'
wind_direction
'
]
del
newFrame
[
'
wind_direction
'
]
print
(
frame
)
del
frame
[
'
minute
'
]
del
frame
[
'
minute
'
]
return
newFrame
.
fillna
(
-
99999
)
return
newFrame
.
fillna
(
-
99999
)
...
...
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