diff --git a/gridded_glm/libexec/_minute_gridder.py b/gridded_glm/libexec/_minute_gridder.py index 1b33248803b22a45511d69063e0849b809ee54fa..8b1fe742787f06cb4b82c237c4ad7af4c0ec2212 100644 --- a/gridded_glm/libexec/_minute_gridder.py +++ b/gridded_glm/libexec/_minute_gridder.py @@ -360,7 +360,6 @@ if __name__ == '__main__': if m not in minutes: minutes.append(m) - gridded_files = [] for m in minutes: # grab all input files for this minute minute_files = [] @@ -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_return = gridder(glm_filenames, start_time, end_time, **grid_kwargs) + gridded_files = [] for subgrid in gridder_return: for gridded_file in subgrid[1]: gridded_files.append(gridded_file) @@ -386,10 +386,10 @@ if __name__ == '__main__': # holding the input gridded file open until the process exits for f in gridded_files: add_gglm_attrs(f, glm_filenames) - + # (optionally) do tiling if args.create_tiles: - + sector = get_goes_position(glm_filenames) if sector == "east": sector_id = "GOES_EAST" @@ -397,7 +397,7 @@ if __name__ == '__main__': sector_id = "GOES_WEST" else: raise RuntimeError("could not determine sector_id") - + from satpy import Scene for gridded_file in gridded_files: log.info("TILING: {}".format(gridded_files)) @@ -408,7 +408,7 @@ if __name__ == '__main__': 'minimum_flash_area', 'total_energy', ]) - + scn.save_datasets(writer='awips_tiled', 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. @@ -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 environment_prefix=args.system_environment_prefix_tiles, compress=True) - + # 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))