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
!4
add satpy to our buildbucket
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
add satpy to our buildbucket
nickb-add-satpy-PR
into
master
Overview
0
Commits
12
Pipelines
0
Changes
4
Merged
Nick Bearson
requested to merge
nickb-add-satpy-PR
into
master
4 years ago
Overview
0
Commits
12
Pipelines
0
Changes
4
Expand
0
0
Merge request reports
Viewing commit
131830a9
Prev
Next
Show latest version
4 files
+
374
−
0
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
131830a9
add our minute gridder & glm trio picker scripts
· 131830a9
Nick Bearson
authored
4 years ago
gridded_glm/bin/_glm_trio_picker.py
0 → 100644
+
52
−
0
Options
#!/usr/bin/env python3
import
sys
import
os
from
glob
import
glob
from
datetime
import
datetime
import
subprocess
from
glmtools.io.glm
import
parse_glm_filename
if
__name__
==
'
__main__
'
:
# FIXME: handle args better if this goes beyond my testing
_
,
glmfile
=
sys
.
argv
# bad (start of period)
# glmfile = '/scratch/nickb/cspp-geo-grb-1.0/output/product/OR_GLM-L2-LCFA_G16_s20210131854000_e20210131854204_c20210131854225.nc'
# good (end of period)
# glmfile = '/scratch/nickb/cspp-geo-grb-1.0/output/product/OR_GLM-L2-LCFA_G16_s20210131854400_e20210131855004_c20210131855027.nc'
# glmfile = '/data/users/nickb/cspp-geo-gridded-glm/testing/2020-11-05/CLASS/OR_GLM-L2-LCFA_G16_s20203101529400_e20203101530004_c20203101530021.nc'
# check that glmfile is actually a GLM file
glminfo
=
parse_glm_filename
(
os
.
path
.
basename
(
glmfile
))
filename_starts
=
glminfo
[
3
]
filename_ends
=
glminfo
[
4
]
# if this isn't the last file of the minute, exit
if
filename_starts
.
second
!=
40
:
print
(
"
This is not the last GLM file from this minute. Exiting.
"
)
exit
(
0
)
# if this is the last file of the minute, grab all files of the minute (three)
# example trio:
# OR_GLM-L2-LCFA_G16_s20203101529000_e20203101529205_c20203101529215.nc
# OR_GLM-L2-LCFA_G16_s20203101529200_e20203101529405_c20203101529430.nc
# OR_GLM-L2-LCFA_G16_s20203101529400_e20203101530004_c20203101530021.nc
globstring
=
"
{}_{}_{}_s{}*
"
.
format
(
glminfo
[
0
],
glminfo
[
1
],
glminfo
[
2
],
glminfo
[
3
].
strftime
(
"
%Y%j%H%M
"
))
fileglob
=
glob
(
os
.
path
.
join
(
os
.
path
.
dirname
(
glmfile
),
globstring
))
print
(
"
Gridding {} files
"
.
format
(
len
(
fileglob
)))
# and run gridded glm a'la:
# minute_gridder.sh \
# --goes-position auto --goes-sector full \
# --create-tiles \
# ./2020-11-05/CLASS/OR_GLM-L2-LCFA_G16_s20203101529000_e20203101529205_c20203101529215.nc \
# ./2020-11-05/CLASS/OR_GLM-L2-LCFA_G16_s20203101529200_e20203101529405_c20203101529430.nc \
# ./2020-11-05/CLASS/OR_GLM-L2-LCFA_G16_s20203101529400_e20203101530004_c20203101530021.nc
subprocess
.
run
([
"
minute_gridder.sh
"
,
"
--goes-position
"
,
"
auto
"
,
"
--goes-sector
"
,
"
full
"
,
"
--create-tiles
"
,
fileglob
[
0
],
fileglob
[
1
],
fileglob
[
2
]]
)
Loading