Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cspp-geo-gridded-glm
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
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
cspp_geo
cspp-geo-gridded-glm
Commits
d4554cd9
Commit
d4554cd9
authored
3 years ago
by
Nick Bearson
Browse files
Options
Downloads
Patches
Plain Diff
ensure --ctr-lat and --ctr-lon are valid latitudes & longitudes
parent
e9863784
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!27
ensure --ctr-lat and --ctr-lon are valid latitudes & longitudes
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gridded_glm/libexec/_minute_gridder.py
+12
-4
12 additions, 4 deletions
gridded_glm/libexec/_minute_gridder.py
with
12 additions
and
4 deletions
gridded_glm/libexec/_minute_gridder.py
+
12
−
4
View file @
d4554cd9
...
@@ -64,7 +64,15 @@ import dask
...
@@ -64,7 +64,15 @@ import dask
dask
.
config
.
set
(
num_workers
=
1
)
dask
.
config
.
set
(
num_workers
=
1
)
def
create_parser
():
def
create_parser
():
def
bounded_float
(
afloat
,
inclusive_min
,
inclusive_max
):
value
=
float
(
afloat
)
if
inclusive_min
<=
value
<=
inclusive_max
:
return
value
else
:
raise
argparse
.
ArgumentTypeError
(
'
valid range %s to %s
'
%
(
inclusive_min
,
inclusive_max
))
import
argparse
import
argparse
from
functools
import
partial
prog
=
os
.
getenv
(
'
PROG_NAME
'
,
sys
.
argv
[
0
])
prog
=
os
.
getenv
(
'
PROG_NAME
'
,
sys
.
argv
[
0
])
parser
=
argparse
.
ArgumentParser
(
prog
=
prog
,
parser
=
argparse
.
ArgumentParser
(
prog
=
prog
,
description
=
parse_desc
,
description
=
parse_desc
,
...
@@ -83,10 +91,10 @@ def create_parser():
...
@@ -83,10 +91,10 @@ def create_parser():
"
(default: full)
"
)
"
(default: full)
"
)
parser
.
add_argument
(
"
-t
"
,
"
--create-tiles
"
,
default
=
False
,
action
=
'
store_true
'
,
parser
.
add_argument
(
"
-t
"
,
"
--create-tiles
"
,
default
=
False
,
action
=
'
store_true
'
,
help
=
"
create AWIPS-compatible tiles (default: off)
"
)
help
=
"
create AWIPS-compatible tiles (default: off)
"
)
parser
.
add_argument
(
'
--ctr-lat
'
,
metavar
=
'
latitude
'
,
parser
.
add_argument
(
'
--ctr-lat
'
,
metavar
=
'
LATITUDE
'
,
type
=
float
,
help
=
'
center latitude (required for meso)
'
)
type
=
partial
(
bounded_float
,
inclusive_min
=-
90
,
inclusive_max
=
90
)
,
help
=
'
center latitude (required for meso)
'
)
parser
.
add_argument
(
'
--ctr-lon
'
,
metavar
=
'
longitude
'
,
parser
.
add_argument
(
'
--ctr-lon
'
,
metavar
=
'
LONGITUDE
'
,
type
=
float
,
help
=
'
center longitude (required for meso)
'
)
type
=
partial
(
bounded_float
,
inclusive_min
=-
180
,
inclusive_max
=
180
)
,
help
=
'
center longitude (required for meso)
'
)
parser
.
add_argument
(
'
-r
'
,
"
--realtime
"
,
default
=
False
,
action
=
'
store_true
'
,
parser
.
add_argument
(
'
-r
'
,
"
--realtime
"
,
default
=
False
,
action
=
'
store_true
'
,
help
=
"
enable
'
realtime
'
mode, where we expect only one input file,
\n
"
help
=
"
enable
'
realtime
'
mode, where we expect only one input file,
\n
"
"
find the surrounding trio, and automatically determine if a full minute
\n
"
"
find the surrounding trio, and automatically determine if a full minute
\n
"
...
...
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