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
8e0f62fc
Unverified
Commit
8e0f62fc
authored
8 years ago
by
David Hoese
Browse files
Options
Downloads
Patches
Plain Diff
Add
parent
f2d49b54
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
aosstower/level_b1/nc.py
+4
-3
4 additions, 3 deletions
aosstower/level_b1/nc.py
aosstower/level_b1/quicklook.py
+7
-2
7 additions, 2 deletions
aosstower/level_b1/quicklook.py
scripts/run_tower_level_b1.sh
+4
-2
4 additions, 2 deletions
scripts/run_tower_level_b1.sh
with
15 additions
and
7 deletions
aosstower/level_b1/nc.py
+
4
−
3
View file @
8e0f62fc
...
@@ -464,13 +464,15 @@ def _dt_convert(datetime_str):
...
@@ -464,13 +464,15 @@ def _dt_convert(datetime_str):
def
main
():
def
main
():
import
argparse
import
argparse
from
metobscommon.archive
import
setup_logging
parser
=
argparse
.
ArgumentParser
(
description
=
"
Convert level_00 aoss tower data to level_b1
"
,
parser
=
argparse
.
ArgumentParser
(
description
=
"
Convert level_00 aoss tower data to level_b1
"
,
fromfile_prefix_chars
=
'
@
'
)
fromfile_prefix_chars
=
'
@
'
)
parser
.
add_argument
(
'
-v
'
,
'
--verbose
'
,
action
=
"
count
"
,
default
=
int
(
os
.
environ
.
get
(
"
VERBOSITY
"
,
2
)),
parser
.
add_argument
(
'
-v
'
,
'
--verbose
'
,
action
=
"
count
"
,
default
=
int
(
os
.
environ
.
get
(
"
VERBOSITY
"
,
2
)),
dest
=
'
verbosity
'
,
dest
=
'
verbosity
'
,
help
=
'
each occurrence increases verbosity 1 level through ERROR-WARNING-INFO-DEBUG (default INFO)
'
)
help
=
'
each occurrence increases verbosity 1 level through ERROR-WARNING-INFO-DEBUG (default INFO)
'
)
parser
.
add_argument
(
'
-l
'
,
'
--log-file
'
,
dest
=
"
log_filepath
"
,
help
=
"
Alternate name for log file, default is to not create a file
"
)
parser
.
add_argument
(
'
-s
'
,
'
--start-time
'
,
type
=
_dt_convert
,
parser
.
add_argument
(
'
-s
'
,
'
--start-time
'
,
type
=
_dt_convert
,
help
=
"
Start time of massive netcdf file, if only -s is given, a netcdf file for only that day is given
"
+
help
=
"
Start time of massive netcdf file, if only -s is given, a netcdf file for only that day is given
"
+
"
. Formats allowed:
\'
YYYY-MM-DDTHH:MM:SS
\'
,
\'
YYYY-MM-DD
\'
"
)
"
. Formats allowed:
\'
YYYY-MM-DDTHH:MM:SS
\'
,
\'
YYYY-MM-DD
\'
"
)
...
@@ -502,8 +504,7 @@ each input file is mapped to the corresponding output file.
...
@@ -502,8 +504,7 @@ each input file is mapped to the corresponding output file.
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
levels
=
[
logging
.
ERROR
,
logging
.
WARN
,
logging
.
INFO
,
logging
.
DEBUG
]
levels
=
[
logging
.
ERROR
,
logging
.
WARN
,
logging
.
INFO
,
logging
.
DEBUG
]
level
=
levels
[
min
(
3
,
args
.
verbosity
)]
setup_logging
(
args
.
log_filepath
,
level
=
levels
[
min
(
3
,
args
.
verbosity
)])
logging
.
basicConfig
(
level
=
level
)
if
args
.
start_time
and
not
args
.
end_time
:
if
args
.
start_time
and
not
args
.
end_time
:
args
.
end_time
=
args
.
start_time
.
replace
(
hour
=
23
,
minute
=
59
,
second
=
59
)
args
.
end_time
=
args
.
start_time
.
replace
(
hour
=
23
,
minute
=
59
,
second
=
59
)
...
...
This diff is collapsed.
Click to expand it.
aosstower/level_b1/quicklook.py
+
7
−
2
View file @
8e0f62fc
import
matplotlib
matplotlib
.
use
(
'
agg
'
)
import
os
import
os
import
sys
import
sys
from
datetime
import
datetime
,
timedelta
from
datetime
import
datetime
,
timedelta
...
@@ -458,12 +461,15 @@ def _dt_convert(datetime_str):
...
@@ -458,12 +461,15 @@ def _dt_convert(datetime_str):
def
main
():
def
main
():
import
argparse
import
argparse
from
metobscommon.archive
import
setup_logging
parser
=
argparse
.
ArgumentParser
(
description
=
"
Use data from level_b1 netCDF files to create netCDF files
"
)
parser
=
argparse
.
ArgumentParser
(
description
=
"
Use data from level_b1 netCDF files to create netCDF files
"
)
parser
.
add_argument
(
'
-v
'
,
'
--verbose
'
,
action
=
'
count
'
,
parser
.
add_argument
(
'
-v
'
,
'
--verbose
'
,
action
=
'
count
'
,
default
=
int
(
os
.
environ
.
get
(
"
VERBOSITY
"
,
2
)),
default
=
int
(
os
.
environ
.
get
(
"
VERBOSITY
"
,
2
)),
dest
=
'
verbosity
'
,
dest
=
'
verbosity
'
,
help
=
(
'
each occurence increases verbosity 1 level through
'
help
=
(
'
each occurence increases verbosity 1 level through
'
+
'
ERROR-WARNING-INFO-DEBUG (default INFO)
'
))
+
'
ERROR-WARNING-INFO-DEBUG (default INFO)
'
))
parser
.
add_argument
(
'
-l
'
,
'
--log-file
'
,
dest
=
"
log_filepath
"
,
help
=
"
Alternate name for log file, default is to not create a file
"
)
parser
.
add_argument
(
'
-s
'
,
'
--start-time
'
,
type
=
_dt_convert
,
parser
.
add_argument
(
'
-s
'
,
'
--start-time
'
,
type
=
_dt_convert
,
help
=
"
Start time of plot. If only -s is given, a plot of
"
+
help
=
"
Start time of plot. If only -s is given, a plot of
"
+
"
only that day is created. Formats allowed:
\'
YYYY-MM-DDTHH:MM:SS
\'
,
\'
YYYY-MM-DD
\'
"
)
"
only that day is created. Formats allowed:
\'
YYYY-MM-DDTHH:MM:SS
\'
,
\'
YYYY-MM-DD
\'
"
)
...
@@ -484,8 +490,7 @@ def main():
...
@@ -484,8 +490,7 @@ def main():
args
=
parser
.
parse_args
()
args
=
parser
.
parse_args
()
levels
=
[
logging
.
ERROR
,
logging
.
WARN
,
logging
.
INFO
,
logging
.
DEBUG
]
levels
=
[
logging
.
ERROR
,
logging
.
WARN
,
logging
.
INFO
,
logging
.
DEBUG
]
level
=
levels
[
min
(
3
,
args
.
verbosity
)]
setup_logging
(
args
.
log_filepath
,
level
=
levels
[
min
(
3
,
args
.
verbosity
)])
logging
.
basicConfig
(
level
=
level
)
if
not
os
.
path
.
splitext
(
args
.
output
)[
-
1
]:
if
not
os
.
path
.
splitext
(
args
.
output
)[
-
1
]:
LOG
.
warning
(
"
File pattern provided does not have a file extension
"
)
LOG
.
warning
(
"
File pattern provided does not have a file extension
"
)
...
...
This diff is collapsed.
Click to expand it.
scripts/run_tower_level_b1.sh
+
4
−
2
View file @
8e0f62fc
...
@@ -39,7 +39,8 @@ fi
...
@@ -39,7 +39,8 @@ fi
out_file
=
`
cache_level_b1_file
"
$DATE
"
`
out_file
=
`
cache_level_b1_file
"
$DATE
"
`
out_fn
=
`
basename
"
$out_file
"
`
out_fn
=
`
basename
"
$out_file
"
`
tmp_out
=
"
$tmp_dir
/
$out_fn
"
tmp_out
=
"
$tmp_dir
/
$out_fn
"
$ENV
/bin/python
-m
aosstower.level_b1.nc
-vv
-z
-i
"
$prev_file
"
"
$curr_file
"
-s
"
${
DATE
}
"
-o
"
$tmp_out
"
>>
$logfile
log_info
"Generating NetCDF files..."
$ENV
/bin/python
-m
aosstower.level_b1.nc
-l
"
$logfile
"
-vv
-z
-i
"
$prev_file
"
"
$curr_file
"
-s
"
${
DATE
}
"
-o
"
$tmp_out
"
>>
$logfile
nc_status
=
$?
nc_status
=
$?
if
[
$nc_status
-ne
0
]
;
then
if
[
$nc_status
-ne
0
]
;
then
oops
"NetCDF generation failed for
$DATE
"
oops
"NetCDF generation failed for
$DATE
"
...
@@ -50,7 +51,8 @@ fi
...
@@ -50,7 +51,8 @@ fi
### Quicklook Generation ###
### Quicklook Generation ###
# assumes that out_file is what the archive script wrote the file as
# assumes that out_file is what the archive script wrote the file as
$ENV
/bin/python
-m
aosstower.level_b1.quicklook
-vv
--thumbnail
-s
"
$DATE
"
"
$out_file
"
-o
"
$tmp_dir
/aoss_tower.{plot_name}.{start_time:%Y-%m-%d}.png"
-p
meteorogram td pressure wind_speed wind_dir accum_precip solar_flux
log_info
"Generating Quicklook images..."
$ENV
/bin/python
-m
aosstower.level_b1.quicklook
-l
"
$logfile
"
-vv
--thumbnail
-s
"
$DATE
"
"
$out_file
"
-o
"
$tmp_dir
/aoss_tower.{plot_name}.{start_time:%Y-%m-%d}.png"
-p
meteorogram td pressure wind_speed wind_dir accum_precip solar_flux
quicklook_status
=
$?
quicklook_status
=
$?
if
[
$quicklook_status
-ne
0
]
;
then
if
[
$quicklook_status
-ne
0
]
;
then
oops
"Quicklook generation failed for
$DATE
"
oops
"Quicklook generation failed for
$DATE
"
...
...
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