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
!31
add support for stats files
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
add support for stats files
stats-files
into
master
Overview
0
Commits
3
Pipelines
0
Changes
6
Merged
Nick Bearson
requested to merge
stats-files
into
master
2 years ago
Overview
0
Commits
3
Pipelines
0
Changes
6
Expand
re: #42
0
0
Merge request reports
Compare
master
version 1
0824e951
2 years ago
master (base)
and
latest version
latest version
985ba37e
3 commits,
2 years ago
version 1
0824e951
2 commits,
2 years ago
6 files
+
289
−
0
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
6
Search (e.g. *.vue) (Ctrl+P)
gridded_glm/libexec/gridded_glm/_minute_gridder.py
+
12
−
0
Options
@@ -54,6 +54,7 @@ from lmatools.grid.make_grids import dlonlat_at_grid_center, grid_h5flashfiles
from
glmtools.grid.make_grids
import
grid_GLM_flashes
from
glmtools.io.glm
import
parse_glm_filename
from
lmatools.grid.fixed
import
get_GOESR_grid
,
get_GOESR_coordsys
from
statistics
import
create_statistics_file
import
logging
log
=
logging
.
getLogger
(
__name__
)
@@ -387,18 +388,29 @@ def grid_minute(minute, args):
check_categories
=
False
,
# check_categories is there because of that issue I mentioned where DQF is all valid all the time so there is no way to detect empty tiles unless we ignore the "category" products
environment_prefix
=
args
.
system_environment_prefix_tiles
,
compress
=
True
)
create_statistics_file
(
tile_files
=
glob
(
f
"
{
tempdir_path
}
/*_GLM-L2-GLM*-M?_G??_T??_*.nc
"
),
minute
=
minute
+
timedelta
(
minutes
=
1
))
# pick up output files from the tempdir
# output looks like: CG_GLM-L2-GLMC-M3_G17_T03_20200925160040.nc
log
.
debug
(
"
files in {}
"
.
format
(
tempdir_path
))
log
.
debug
(
os
.
listdir
(
tempdir_path
))
log
.
debug
(
"
moving output to {}
"
.
format
(
args
.
output_dir
))
tiled_path
=
os
.
path
.
join
(
tempdir_path
,
'
{}_GLM-L2-GLM*-M?_G??_T??_*.nc
'
.
format
(
args
.
system_environment_prefix_tiles
))
tiled_files
=
glob
(
tiled_path
)
for
f
in
tiled_files
:
add_gglm_attrs
(
f
,
glm_filenames
)
shutil
.
move
(
f
,
os
.
path
.
join
(
args
.
output_dir
,
os
.
path
.
basename
(
f
)))
stats_path
=
os
.
path
.
join
(
tempdir_path
,
'
{}_GLM-L2-GLM*-M?_G??_statistics_*.nc
'
.
format
(
args
.
system_environment_prefix_tiles
))
stats_files
=
glob
(
stats_path
)
for
f
in
stats_files
:
add_gglm_attrs
(
f
,
glm_filenames
)
shutil
.
move
(
f
,
os
.
path
.
join
(
args
.
output_dir
,
os
.
path
.
basename
(
f
)))
for
f
in
gridded_files
:
# we add gglm attributes above
shutil
.
move
(
f
,
os
.
path
.
join
(
args
.
output_dir
,
os
.
path
.
basename
(
f
)))
# tempdir cleans itself up via atexit, above
Loading