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
Merge requests
!27
ensure --ctr-lat and --ctr-lon are valid latitudes & longitudes
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
ensure --ctr-lat and --ctr-lon are valid latitudes & longitudes
23-better-handling-of-ctr-lat-ctr-lon-error-conditions
into
master
Overview
0
Commits
1
Pipelines
0
Changes
1
Merged
Nick Bearson
requested to merge
23-better-handling-of-ctr-lat-ctr-lon-error-conditions
into
master
3 years ago
Overview
0
Commits
1
Pipelines
0
Changes
1
Expand
Currently fixes the first (out-of-range) issue in #23
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
d4554cd9
1 commit,
3 years ago
1 file
+
12
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
gridded_glm/libexec/_minute_gridder.py
+
12
−
4
Options
@@ -64,7 +64,15 @@ import dask
dask
.
config
.
set
(
num_workers
=
1
)
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
from
functools
import
partial
prog
=
os
.
getenv
(
'
PROG_NAME
'
,
sys
.
argv
[
0
])
parser
=
argparse
.
ArgumentParser
(
prog
=
prog
,
description
=
parse_desc
,
@@ -83,10 +91,10 @@ def create_parser():
"
(default: full)
"
)
parser
.
add_argument
(
"
-t
"
,
"
--create-tiles
"
,
default
=
False
,
action
=
'
store_true
'
,
help
=
"
create AWIPS-compatible tiles (default: off)
"
)
parser
.
add_argument
(
'
--ctr-lat
'
,
metavar
=
'
latitude
'
,
type
=
float
,
help
=
'
center latitude (required for meso)
'
)
parser
.
add_argument
(
'
--ctr-lon
'
,
metavar
=
'
longitude
'
,
type
=
float
,
help
=
'
center longitude (required for meso)
'
)
parser
.
add_argument
(
'
--ctr-lat
'
,
metavar
=
'
LATITUDE
'
,
type
=
partial
(
bounded_float
,
inclusive_min
=-
90
,
inclusive_max
=
90
)
,
help
=
'
center latitude (required for meso)
'
)
parser
.
add_argument
(
'
--ctr-lon
'
,
metavar
=
'
LONGITUDE
'
,
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
'
,
help
=
"
enable
'
realtime
'
mode, where we expect only one input file,
\n
"
"
find the surrounding trio, and automatically determine if a full minute
\n
"
Loading