optimizations
This commit is contained in:
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user