sot/eng_archive — Issue #20: MSIDset.interpolate behaves unintuitively
Author: taldcroft
Created: 2012-01-13 23:30:51+00:00
State: open

From @aarvai

I noticed that the interpolate function acted differently when "bad" data was involved than I expected. I thought that when using .interpolate, the timestamps for the all MSIDs within the MSID would be set to identical values. However, please see the attached code below. In this case, "good" data for one of the two MSIDs ('dp_pitch_fss') is not available for the first 14 hours (because we're out of the FSS FOV). The interpolate function still set the data sets to the same shape (288 entries), but, as shown by figure 3, their timestamps are far from identical. I didn't want to submit an official bug report in Github until I ran it by you first - is this the intended behavior? Or is this just something to be careful of? (Should we always plot the delta times?) Ideally, I would think that the "interpolated" timestamps should only be in time ranges were all of the data is "good" (here, the las!
t 10 hours).

from Ska.Matplotlib import plot_cxctime
from Ska.engarchive import fetch_eng as fetch

x=fetch.Msidset(['aosares1','dp_pitch_fss'],'2000:002:00:00:00.000','2000:003:00:00:00.000')

figure(1)
plot_cxctime(x['aosares1'].times,x['aosares1'].vals,'b')
plot_cxctime(x['dp_pitch_fss'].times,x['dp_pitch_fss'].vals,'r')
title('Plotted w/ Original Timestamps')

figure(2)
x.interpolate(dt=300)
plot_cxctime(x['aosares1'].times,x['aosares1'].vals,'b')
plot_cxctime(x['dp_pitch_fss'].times,x['dp_pitch_fss'].vals,'r')
title('Plotted w/ Interpolated Timestamps')

figure(3)
delta_pitch_fss = x['aosares1'].times - x['dp_pitch_fss'].times
plot(range(len(delta_pitch_fss)),delta_pitch_fss)
title('AOSARES1 times - DP_PITCH_FSS times')