Skip to content
Snippets Groups Projects
Commit 11c9763a authored by Nick Bearson's avatar Nick Bearson
Browse files

gridded_files needs to be reset for each minute now

parent 7e1ad999
No related branches found
No related tags found
1 merge request!26group inputs by minute and process accordingly
...@@ -360,7 +360,6 @@ if __name__ == '__main__': ...@@ -360,7 +360,6 @@ if __name__ == '__main__':
if m not in minutes: if m not in minutes:
minutes.append(m) minutes.append(m)
gridded_files = []
for m in minutes: for m in minutes:
# grab all input files for this minute # grab all input files for this minute
minute_files = [] minute_files = []
...@@ -378,6 +377,7 @@ if __name__ == '__main__': ...@@ -378,6 +377,7 @@ if __name__ == '__main__':
gridder, glm_filenames, start_time, end_time, grid_kwargs = grid_setup(minute_files, args, work_dir=tempdir_path) gridder, glm_filenames, start_time, end_time, grid_kwargs = grid_setup(minute_files, args, work_dir=tempdir_path)
gridder_return = gridder(glm_filenames, start_time, end_time, **grid_kwargs) gridder_return = gridder(glm_filenames, start_time, end_time, **grid_kwargs)
gridded_files = []
for subgrid in gridder_return: for subgrid in gridder_return:
for gridded_file in subgrid[1]: for gridded_file in subgrid[1]:
gridded_files.append(gridded_file) gridded_files.append(gridded_file)
...@@ -386,10 +386,10 @@ if __name__ == '__main__': ...@@ -386,10 +386,10 @@ if __name__ == '__main__':
# holding the input gridded file open until the process exits # holding the input gridded file open until the process exits
for f in gridded_files: for f in gridded_files:
add_gglm_attrs(f, glm_filenames) add_gglm_attrs(f, glm_filenames)
# (optionally) do tiling # (optionally) do tiling
if args.create_tiles: if args.create_tiles:
sector = get_goes_position(glm_filenames) sector = get_goes_position(glm_filenames)
if sector == "east": if sector == "east":
sector_id = "GOES_EAST" sector_id = "GOES_EAST"
...@@ -397,7 +397,7 @@ if __name__ == '__main__': ...@@ -397,7 +397,7 @@ if __name__ == '__main__':
sector_id = "GOES_WEST" sector_id = "GOES_WEST"
else: else:
raise RuntimeError("could not determine sector_id") raise RuntimeError("could not determine sector_id")
from satpy import Scene from satpy import Scene
for gridded_file in gridded_files: for gridded_file in gridded_files:
log.info("TILING: {}".format(gridded_files)) log.info("TILING: {}".format(gridded_files))
...@@ -408,7 +408,7 @@ if __name__ == '__main__': ...@@ -408,7 +408,7 @@ if __name__ == '__main__':
'minimum_flash_area', 'minimum_flash_area',
'total_energy', 'total_energy',
]) ])
scn.save_datasets(writer='awips_tiled', scn.save_datasets(writer='awips_tiled',
template='glm_l2_radf', template='glm_l2_radf',
sector_id=sector_id, # sector_id becomes an attribute in the output files and may be another legacy kind of thing. I'm not sure how much is is actually used here. sector_id=sector_id, # sector_id becomes an attribute in the output files and may be another legacy kind of thing. I'm not sure how much is is actually used here.
...@@ -418,7 +418,7 @@ if __name__ == '__main__': ...@@ -418,7 +418,7 @@ if __name__ == '__main__':
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 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, environment_prefix=args.system_environment_prefix_tiles,
compress=True) compress=True)
# pick up output files from the tempdir # pick up output files from the tempdir
# output looks like: CG_GLM-L2-GLMC-M3_G17_T03_20200925160040.nc # output looks like: CG_GLM-L2-GLMC-M3_G17_T03_20200925160040.nc
log.debug("files in {}".format(tempdir_path)) log.debug("files in {}".format(tempdir_path))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment