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

Home » Public Forums » archive » Interpolation to conserve integrated flux
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
Interpolation to conserve integrated flux [message #71166] Sat, 29 May 2010 18:13
jdshaw is currently offline  jdshaw
Messages: 7
Registered: October 2007
Junior Member
Hi all,

I am hoping someone out there can help me with this.

I am looking to combine spectra such that the integrated flux between
any arbitrary set of points is conserved.

Consider a set of two equal length float arrays, one containing
wavelength values (call this x1, x2, x3, ...) and one containing flux
values (call these y1, y2, y3,...). So that y1 goes with x1 and y2
goes with x2, and so on.

Unfortunately, the wavelength arrays (x1, x2, x3, ...) have similar
values but not the same, e.g.:

x1 = [3212.7, 3215.1, 3217.5, 3219.9, ...]
x2 = [3213.1, 3215.4, 3217.7, 3220.0, ...]

What I want to do is combine x1 and x2 to x_comb and y1 and y2 to
y_comb such that if one were to sum between two wavelengths the in the
new arrays (x_comb and y_comb) you would get the same as doing them in
the original (x1,y1 and x2,y2) and adding the results. That is, if I
need to sum up values in y when x is between 3214.0 and 3219.0. For
x1, I would linearly interpolate the values in y1 for the two
wavelengths and sum under the curve. I then do the same for x2 and
y2. I can already do this - that part is simple. What I want to do
is have new arrays x_comb and y_comb such that I can do the same sum
across such that the same (summed region in y1) + (summed region in
y2) = (summed region in y_comb).

Is there an algorithm that anyone knows that will do this?

Or, as an intermediate step, is there a way interpolate the values in
x2 to x1, and y2 to an new set of values (y2_new) that keeps the sums
of y2 and y2_new the same between any two arbitray points (as
described above)?

Thanks - John.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Finding coefficients in multiple nonlinear equations using MPFIT
Next Topic: Finding coefficients in multiple nonlinear equations using MPFIT

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

Current Time: Wed Oct 08 17:47:09 PDT 2025

Total time taken to generate the page: 0.00500 seconds