These times are from Queensland, Australia where Daylight savings is not observed.
I have a program that interpolates time using this strategy, but it interpolates with respect to daylight savings time.
For example, this script interpolates between two time points with 100 intervals total.
import numpy as np
from datetime import datetime
import datetime as dt
import time
x_dec = np.linspace(0, np.pi, num=100)
time1 = dt.datetime(2017, 11, 4, 20, 47, 0)
time2 = dt.datetime(2017, 11, 5, 3, 1, 0)
this_time = time.mktime(time1.timetuple())
next_time = time.mktime(time2.timetuple())
this_x_temp = np.interp(x_dec, (x_dec.min(), x_dec.max()), (this_time, next_time))
this_x = np.vectorize(datetime.fromtimestamp)(this_x_temp)
print(this_x)
Instead of cleanly producing interpolated times, it cycles through times around 1AM twice in concordance with American Daylight Savings time. See the example output.
...
datetime.datetime(2017, 11, 5, 1, 49, 29, 90909)
datetime.datetime(2017, 11, 5, 1, 53, 52, 121212)
datetime.datetime(2017, 11, 5, 1, 58, 15, 151515)
datetime.datetime(2017, 11, 5, 1, 2, 38, 181818)
datetime.datetime(2017, 11, 5, 1, 7, 1, 212121)
datetime.datetime(2017, 11, 5, 1, 11, 24, 242424)
datetime.datetime(2017, 11, 5, 1, 15, 47, 272727)
...
I don't think that I can use a time series for this application given that all of my observations are at random times throughout the day and I need around 100 datapoints of interpolated times between the observations. How can I make np.interp
ignore American daylight savings time and just interpolate the time as if it there is no daylight savings switch?