Matching data in different time resolution [message #71032] |
Tue, 25 May 2010 13:48 |
Balt
Messages: 16 Registered: May 2010
|
Junior Member |
|
|
Hi all,
I'm looking for an elegant solution (i.e. one that does not involve
nested FOR loops) for the following problem:
I have two independent data acquisition systems that sample data at
different intervals and different start times. Let's say one samples
in 10 second intervals, the other one in 5 second intervals. I now
would like to apply a correction determined by one of the systems to
the other. This means I need to match up the data points in the
corresponding vectors. Let's assume s1 is system one, s2 is system 2
delivering the correction values. I have two vectors for each system,
one containing the timestamps, the other containing the measured data.
For example:
s1_time = [ 0, 10, 20, 30, 40, 50 ]
s1_data = [ 4, 5, 6, 7, 8, 9 ]
s2_time = [ 35, 40, 45, 50, 55, 60 ]
s2_data = [ 1, 2, 3, 2, 1, 2 ]
This presumably is a rebinning exercise of sorts to first make s2 data
match:
s2_time_rebinned = [ 30, 40, 50 ]
s2_data_rebinned = [ 1, 2.5, 1.5 ]
Then adding the result to the s1 vectors:
res_time = [ 30, 40, 50 ]
res_data = [ 8, 10.5, 10.5 ]
Does anyone have pointers/ideas how to best go about this in IDL?
Cheers
- Balt
|
|
|