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

Home » Public Forums » archive » Re: re-binning with linear interpolation
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: re-binning with linear interpolation [message #76369 is a reply to message #76368] Wed, 01 June 2011 02:55 Go to previous message
Wout De Nolf is currently offline  Wout De Nolf
Messages: 194
Registered: October 2008
Senior Member
On Wed, 1 Jun 2011 01:17:10 -0700 (PDT), abc <deearvind12@gmail.com>
wrote:

> I want to re-bin the wavelength at a step of 1 A and also the flux at
> the same step but with linear interpolation.


a=[[5201.720215,0.0097],$
[5205.345215,0.0088],$
[5208.970703,0.0080],$
[5212.596191,0.0094],$
[5216.221680,0.0133],$
[5219.846680,0.0167],$
[5223.472168,0.0169],$
[5227.097656,0.0156],$
[5230.722656,0.0145],$
[5234.348145,0.0138],$
[5237.973633,0.0130],$
[5241.599121,0.0118],$
[5245.224121,0.0110],$
[5248.849609,0.0116],$
[5252.475098,0.0134],$
[5256.100586,0.0147],$
[5259.725586,0.0139],$
[5263.351074,0.0126]]

; New wavelengths
b=floor(a[0,0])
e=ceil(a[0,-1])
inc=1.
x=b+inc*lindgen(1,(e-b)/inc+1)

; Linear interpolate flux
y=interpol(a[1,*],a[0,*],x)

; Plot
pa=plot(a,'+r-')
pb=plot(x,y,'+-',/overplot)
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: International Help Needed
Next Topic: Re: colorbar inside the plot

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

Current Time: Sat Oct 11 15:44:52 PDT 2025

Total time taken to generate the page: 0.23522 seconds