Skip to content

Commit 8f745ab

Browse files
committed
Merge branch 'master' of https://github.com/BSC-ES/providentia
2 parents 87391fc + 21be50d commit 8f745ab

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

providentia/cams.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -484,6 +484,9 @@ def download_cams_experiment(self, experiment):
484484
# print the request
485485
self.print_request(cams_dict['dataset'], request)
486486

487+
# get last downloaded file in case there was a keyboard interrupt
488+
self.download_instance.latest_nc_file_path = final_path
489+
487490
# make the request
488491
try:
489492
self.download_instance.logger.info(f"Downloading {final_path}") # TODO change message

providentia/download.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1521,6 +1521,10 @@ def copy_non_interpolated_experiment(self, experiment, initial_check, files_to_d
15211521

15221522
# copy file
15231523
esarchive_path = join(esarchive_dir, nc_file)
1524+
1525+
# get last downloaded file in case there was a keyboard interrupt
1526+
self.latest_nc_file_path = gpfs_path
1527+
15241528
try:
15251529
with open(os.devnull, 'wb') as devnull:
15261530
subprocess.check_call([rsync_command, esarchive_path, gpfs_path], stdout=devnull, stderr=subprocess.STDOUT)
@@ -1641,8 +1645,8 @@ def sighandler(self, *unused):
16411645

16421646
# delete the las downloaded nc file to avoid corrupted files
16431647
if hasattr(self, 'latest_nc_file_path'):
1644-
self.logger.info(f"\nDeleting last file to avoid corruption: {self.latest_nc_file_path}...")
16451648
if os.path.isfile(self.latest_nc_file_path):
1649+
self.logger.info(f"\nDeleting last file to avoid corruption: {self.latest_nc_file_path}...")
16461650
os.remove(self.latest_nc_file_path)
16471651

16481652
# remove the output files from dtrsync in case it was a download from storage5

settings/internal/cams/cams_dataset.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,9 @@ cams_analysis:
3939
forecast: false
4040
level: '0'
4141
month_names: false
42-
time: 00:00
42+
time: [
43+
"00:00", "01:00", "02:00", "03:00", "04:00", "05:00", "06:00", "07:00", "08:00", "09:00", "10:00", "11:00",
44+
"12:00", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00", "20:00", "21:00", "22:00", "23:00" ]
4345
data_format: netcdf_zip
4446
calendar: standard
4547
stream: false

0 commit comments

Comments
 (0)