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
ed776a1a
Commit
ed776a1a
authored
2 years ago
by
Nick Bearson
Browse files
Options
Downloads
Patches
Plain Diff
replace exits with raises in grid_setup, and remove the realtime check
parent
007fa2f0
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!28
replace exits with raises in grid_setup, and remove the realtime check
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gridded_glm/libexec/_minute_gridder.py
+6
-20
6 additions, 20 deletions
gridded_glm/libexec/_minute_gridder.py
with
6 additions
and
20 deletions
gridded_glm/libexec/_minute_gridder.py
+
6
−
20
View file @
ed776a1a
...
...
@@ -206,34 +206,20 @@ def grid_setup(glm_files, args, work_dir=os.getcwd()):
min_events
=
None
min_groups
=
None
if
args
.
realtime
:
if
len
(
args
.
filenames
)
!=
1
:
log
.
error
(
"
realtime mode only accepts one input file
"
)
exit
(
1
)
glminfo
=
parse_glm_filename
(
os
.
path
.
basename
(
args
.
filenames
[
0
]))
if
len
(
glm_files
)
!=
3
:
raise
RuntimeError
(
"
expected three files for this minute, only received {}
"
.
format
(
len
(
glm_files
)))
globstring
=
"
{}_{}_{}_s{}*
"
.
format
(
glminfo
[
0
],
glminfo
[
1
],
glminfo
[
2
],
glminfo
[
3
].
strftime
(
"
%Y%j%H%M
"
))
fileglob
=
glob
(
os
.
path
.
join
(
os
.
path
.
dirname
(
args
.
filenames
[
0
]),
globstring
))
if
len
(
fileglob
)
!=
3
:
log
.
error
(
"
There are not (yet) three GLM files from this minute. This may be expected. Exiting.
"
)
exit
(
0
)
args
.
filenames
=
fileglob
for
f
in
args
.
filenames
:
for
f
in
glm_files
:
if
not
os
.
path
.
exists
(
f
):
log
.
error
(
"
Tried to grid file that does not exist: {}
"
.
format
(
f
))
exit
(
1
)
raise
RuntimeError
(
"
Tried to grid file that does not exist: {}
"
.
format
(
f
))
if
"
meso
"
in
args
.
goes_sector
and
(
args
.
ctr_lat
==
None
or
args
.
ctr_lon
==
None
):
log
.
error
(
"
sector
'
meso
'
requires --ctr-lat & --ctr-lon
"
)
exit
(
1
)
raise
RuntimeError
(
"
sector
'
meso
'
requires --ctr-lat & --ctr-lon
"
)
try
:
start_time
,
end_time
=
get_start_end
(
glm_files
)
except
:
log
.
error
(
"
Could not parse start & end times from one or more of the files provided:
"
)
log
.
error
(
"
,
"
.
join
(
glm_files
))
exit
(
1
)
raise
RuntimeError
(
"
Could not parse start & end times from one or more of the files provided: {}
"
.
format
(
"
,
"
.
join
(
glm_files
)))
base_date
=
datetime
(
start_time
.
year
,
start_time
.
month
,
start_time
.
day
)
proj_name
=
'
geos
'
...
...
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