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

Home » Public Forums » archive » Subtracting arrays of same dimension, different size - interpolating one to fit the other
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
Subtracting arrays of same dimension, different size - interpolating one to fit the other [message #73211] Mon, 01 November 2010 09:10 Go to next message
polystethylene is currently offline  polystethylene
Messages: 28
Registered: February 2009
Junior Member
Hi All,

I have some data and a model, both 2 column - one column phase, the
second column a ratio...

They both have different sizes, and the model's phase points don't
match up with those of the data...

I'd like to plot the residual i.e. data - model, but obviously that's
not immediately accessible without interpolating the model so that
every data phase point has a corresponding model value...

Anyone got any ideas how I can do this?

Please no-one say histogram :-/ *crosses fingers*

Cheers,

Stef
Re: Subtracting arrays of same dimension, different size - interpolating one to fit the other [message #73350 is a reply to message #73211] Mon, 01 November 2010 14:49 Go to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article
<7c44103e-c422-4011-a714-d765de6fd76a@v20g2000yqb.googlegroups.com>,
polystethylene <polystethylene@hotmail.com> wrote:

> I can't see how to do it using the Interpolate function; can it be
> done with the provided IDL functions?

You might want to look at this

http://csrp.tamu.edu/pdf/idl/sample_chapter.pdf

Ken Bowman
Re: Subtracting arrays of same dimension, different size - interpolating one to fit the other [message #73351 is a reply to message #73211] Mon, 01 November 2010 14:35 Go to previous message
polystethylene is currently offline  polystethylene
Messages: 28
Registered: February 2009
Junior Member
Nevermind! Figured it out: got the INTERPOL function to do the trick...
Re: Subtracting arrays of same dimension, different size - interpolating one to fit the other [message #73352 is a reply to message #73211] Mon, 01 November 2010 13:41 Go to previous message
polystethylene is currently offline  polystethylene
Messages: 28
Registered: February 2009
Junior Member
On Nov 1, 5:17 pm, Paul van Delst <paul.vande...@noaa.gov> wrote:
> recalculate the model data to match the measured data. Then direct compare.
>
> If you don't have access to the model software itself, then try to get your hands on it. Otherwise you're going to have
> to interpolate. I always interpolate model data (initially at least) since it is typically better behaved (e.g.
> smoother/less noisy) than measured data and thus less likely to suffer from egregious interpolation artifacts.
>
> Now, which interpolation method you employ (linear, polynomial, spline, fourier(!) etc) is a decision *you* need to make
> based on the data.
>
> cheers,
>
> paulv
>
> polystethylene wrote:
>> Hi All,
>
>> I have some data and a model, both 2 column - one column phase, the
>> second column a ratio...
>
>> They both have different sizes, and the model's phase points don't
>> match up with those of the data...
>
>> I'd like to plot the residual i.e. data - model, but obviously that's
>> not immediately accessible without interpolating the model so that
>> every data phase point has a corresponding model value...
>
>> Anyone got any ideas how I can do this?
>
>> Please no-one say histogram :-/    *crosses fingers*
>
>> Cheers,
>
>> Stef
>
>

I need to interpolate it unfortunately - I just don't understand how I
do it using the various interpolation functions...

Essentially, I one set of phases for the measured data that are
irregularly gridded, and the model points which are regularly
gridded...

How do I get IDL to evaluate the model value through interpolation at
the irregularly (measured) grid points?

I can't see how to do it using the Interpolate function; can it be
done with the provided IDL functions?
Re: Subtracting arrays of same dimension, different size - interpolating one to fit the other [message #73358 is a reply to message #73211] Mon, 01 November 2010 10:17 Go to previous message
Paul Van Delst[1] is currently offline  Paul Van Delst[1]
Messages: 1157
Registered: April 2002
Senior Member
recalculate the model data to match the measured data. Then direct compare.

If you don't have access to the model software itself, then try to get your hands on it. Otherwise you're going to have
to interpolate. I always interpolate model data (initially at least) since it is typically better behaved (e.g.
smoother/less noisy) than measured data and thus less likely to suffer from egregious interpolation artifacts.

Now, which interpolation method you employ (linear, polynomial, spline, fourier(!) etc) is a decision *you* need to make
based on the data.

cheers,

paulv

polystethylene wrote:
> Hi All,
>
> I have some data and a model, both 2 column - one column phase, the
> second column a ratio...
>
> They both have different sizes, and the model's phase points don't
> match up with those of the data...
>
> I'd like to plot the residual i.e. data - model, but obviously that's
> not immediately accessible without interpolating the model so that
> every data phase point has a corresponding model value...
>
> Anyone got any ideas how I can do this?
>
> Please no-one say histogram :-/ *crosses fingers*
>
> Cheers,
>
> Stef
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Understanding IDLanROI
Next Topic: Re: doubt in chisq value

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

Current Time: Thu Oct 09 07:00:43 PDT 2025

Total time taken to generate the page: 0.08253 seconds