comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Matching data in different time resolution
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Matching data in different time resolution [message #71023] Tue, 25 May 2010 17:38 Go to next message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
On May 25, 4:48 pm, Balt <bindermue...@gmail.com> wrote:
> 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?

This sounds like an interpolation problem. Your S2 vector is the
"tabulated" vector, which you want to interpolate onto the grid
specified by S1.

You can do spline interpolation with SPL_INIT() and co. I also use
the linear and quadratic interpolation routines of the IDL Astronomy
Library alot, LINTERP and QUADTERP.

Craig
Re: Matching data in different time resolution [message #71112 is a reply to message #71023] Wed, 26 May 2010 05:42 Go to previous message
Jeremy Bailin is currently offline  Jeremy Bailin
Messages: 618
Registered: April 2008
Senior Member
On May 25, 8:38 pm, Craig Markwardt <craig.markwa...@gmail.com> wrote:
> On May 25, 4:48 pm, Balt <bindermue...@gmail.com> wrote:
>
>
>
>
>
>> 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?
>
> This sounds like an interpolation problem.  Your S2 vector is the
> "tabulated" vector, which you want to interpolate onto the grid
> specified by S1.
>
> You can do spline interpolation with SPL_INIT() and co.  I also use
> the linear and quadratic interpolation routines of the IDL Astronomy
> Library alot, LINTERP and QUADTERP.
>
> Craig

Yeah, I would just throw it into INTERPOL. You'll need to think about
what you want to do at the boundaries, though - interpolation schemes
will often happily give you wild extrapolations if you ask them to.

-Jeremy.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: SAVE again
Next Topic: Cannot understand a part of the IDL routine!! pls help!!

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 13:34:11 PDT 2025

Total time taken to generate the page: 0.00466 seconds