Skip to content
Snippets Groups Projects
Commit e446e857 authored by Anne Philipp's avatar Anne Philipp
Browse files

added functionality to eliminate unnecessary data/times

parent e811e1a8
Branches
Tags
No related merge requests found
...@@ -1376,6 +1376,12 @@ class EcFlexpart(object): ...@@ -1376,6 +1376,12 @@ class EcFlexpart(object):
''' '''
# generate start and end timestamp of the retrieval period
start_period = datetime.strptime(c.start_date + c.time[0], '%Y%m%d%H')
start_period = start_period + timedelta(hours=int(c.step[0]))
end_period = datetime.strptime(c.end_date + c.time[-1], '%Y%m%d%H')
end_period = end_period + timedelta(hours=int(c.step[-1]))
if c.wrf: if c.wrf:
table128 = init128(_config.PATH_GRIBTABLE) table128 = init128(_config.PATH_GRIBTABLE)
wrfpars = to_param_id('sp/mslp/skt/2t/10u/10v/2d/z/lsm/sst/ci/sd/\ wrfpars = to_param_id('sp/mslp/skt/2t/10u/10v/2d/z/lsm/sst/ci/sd/\
...@@ -1442,6 +1448,12 @@ class EcFlexpart(object): ...@@ -1442,6 +1448,12 @@ class EcFlexpart(object):
timestamp += timedelta(hours=int(cstep)) timestamp += timedelta(hours=int(cstep))
cdate_hour = datetime.strftime(timestamp, '%Y%m%d%H') cdate_hour = datetime.strftime(timestamp, '%Y%m%d%H')
# eliminate all temporary times
# which are outside the retrieval period
if timestamp < start_period or \
timestamp > end_period:
continue
# if the timestamp is out of basetime start/end date period, # if the timestamp is out of basetime start/end date period,
# skip this specific product # skip this specific product
if c.basetime is not None: if c.basetime is not None:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment