optimizations

This commit is contained in:
2025-05-22 15:24:59 +00:00
parent 9b5fcd0100
commit 918e380f56
2 changed files with 27 additions and 9 deletions

View File

@@ -29,8 +29,16 @@ class CopernicusDownloader:
self.download(self.output_file)
self.apply_setreftime(self.output_file,self.prepared_file)
self.convert_to_grib2(self.prepared_file,self.output_grib)
self.file_remove(self.output_file)
return self.output_grib
def file_remove(self,file):
if os.path.exists(file):
os.remove(file)
print(f"✅ File removed : {file}")
else:
print(f"❌ File {file} does not exist.")
def download(self,outfile):
today = datetime.utcnow()
start_date = today.strftime("%Y-%m-%dT00:00:00")