Skip to content

Commit

Permalink
Fixed a minor bug because of which the list of AWS Himawari files had…
Browse files Browse the repository at this point in the history
… unneeded duplicates.
  • Loading branch information
tkach940 committed Jul 12, 2021
1 parent 041964b commit 2f1eb38
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion satpy_overlay_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def get_AHI_files(datetime_utc, data_home = None):
for hima_file in hima_files:
for band in bands_list:
if '_B0' + str(band) + '_' in hima_file.key:
if not os.path.isfile('Hima/' + hima_file.key[:-4]):
if not (os.path.isfile('Hima/' + hima_file.key[:-4]) and os.path.isfile('Hima/' + hima_file.key)):
if not os.path.isdir(os.path.dirname('Hima/' + hima_file.key)):
os.makedirs(os.path.dirname('Hima/' + hima_file.key))
hima_bucket.download_file(hima_file.key, 'Hima/' + hima_file.key)
Expand All @@ -265,6 +265,8 @@ def get_AHI_files(datetime_utc, data_home = None):
open(newfilename, 'wb').write(data) # write a uncompressed file
os.remove(filename)
files.extend(glob.glob(newfilename))
files = list(set(files))
print(len(files))
return files

def get_scene_obj(file_list, latlon_extent, sensor, width=750, height=750,
Expand Down

0 comments on commit 2f1eb38

Please sign in to comment.