From 365c82a890a4421172ac6711ad7e96cfeec080e9 Mon Sep 17 00:00:00 2001 From: Anne Tipka <anne.tipka@ctbto.org> Date: Wed, 26 Oct 2022 11:18:52 +0000 Subject: [PATCH] corrected date setting for operational retrieval for basetime 00 --- Source/Python/Classes/EcFlexpart.py | 8 ++++++-- Source/Python/Mods/get_mars_data.py | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Source/Python/Classes/EcFlexpart.py b/Source/Python/Classes/EcFlexpart.py index 4584af6..a7dda98 100644 --- a/Source/Python/Classes/EcFlexpart.py +++ b/Source/Python/Classes/EcFlexpart.py @@ -785,8 +785,6 @@ class EcFlexpart(object): self._start_retrievement(request, retr_param_dict) elif self.basetime == 0: -# retr_param_dict['date'] = \ -# datetime.strftime(elimit - t24h, '%Y%m%d') timesave = ''.join(retr_param_dict['time']) @@ -815,6 +813,12 @@ class EcFlexpart(object): self._mk_targetname(ftype, pk, retr_param_dict['date']) + if ftype.upper() == 'FC' and \ + 'acc' not in retr_param_dict['target']: + + retr_param_dict['date'] = \ + datetime.strftime(elimit - t24h, '%Y%m%d') + # ******* start retrievement self._start_retrievement(request, retr_param_dict) else: diff --git a/Source/Python/Mods/get_mars_data.py b/Source/Python/Mods/get_mars_data.py index cdad4b6..722eeb4 100755 --- a/Source/Python/Mods/get_mars_data.py +++ b/Source/Python/Mods/get_mars_data.py @@ -292,7 +292,7 @@ def mk_dates(c, fluxes): end = datetime.strptime(c.end_date, '%Y%m%d') chunk = timedelta(days=int(c.date_chunk)) - if c.basetime == 0: # non-fluxes + if c.basetime == 0 and not fluxes: # non-fluxes start = start - timedelta(days=1) if c.purefc and fluxes and c.maxstep < 24: -- GitLab