Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSIDset.interpolate behaves unintuitively #20

Closed
taldcroft opened this issue Jan 13, 2012 · 0 comments
Closed

MSIDset.interpolate behaves unintuitively #20

taldcroft opened this issue Jan 13, 2012 · 0 comments

Comments

@taldcroft
Copy link
Member

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')
taldcroft added a commit that referenced this issue Jan 14, 2012
Previously after interpolate(), the times attribute of MSIDs in the set
was the times at the near neighbor interpolation sample.  One had to use
the MSIDset.times value to get the linearly spaced times.  This caused
confusion and unexpected behavior.  MSIDset.interpolate() was changed
to sete the MSID times to the linearly space times.  Some bad values
subtleties were addressed with a new bad_values arg and much better
documentation.

This closes issue #20 raised by @aarvai.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant