import metview as mv
import numpy as np
from datetime import datetime, timedelta
# creating
d = datetime(2000, 1, 4, 9, 50, 24)
today = datetime.today()
yesterday = datetime.today() - timedelta(1)
# arithmetic
d = d + timedelta(hours=9, minutes=50, seconds=24)
# using an increment of 2 days
d0 = datetime(2018,11,1)
d1 = datetime(2018,11,10)
dt = timedelta(days = 2)
for d in np.arange(d0, d1, dt):
(...)
# using an increment of 6 hours
d0 = datetime(2018, 11, 1)
d1 = datetime(2018, 11, 10)
dt = timedelta(hours = 6)
for d = np.arange(d0, d1, dt):
x = mv.retrieve(date =d,
time = dmv.hour(d), ...)
(...) |