On Apr 25, 8:29 am, Vince Hradil <hrad...@[EMAIL PROTECTED]
> wrote:
> On Apr 24, 2:17 pm, sarah <sarahwiddeco...@[EMAIL PROTECTED]
> wrote:
>
> > Hi, i am IDL beginner and i do not have much sup****t. I am trying to
> > convolve 2 spectral datasets using the convol function and I cannot
> > get it to work. I have tried everything! Does anyone know the best way
> > to do this? maybe convol is the wrong thing to use I am very lost.
>
> > Thanks
>
> What _exactly_ have you tried? What was the result? i.e. explain "I
> cannot get it to work.". Code snippets always help.
Sorry it has taken me so long to reply. (I have been sick). I have
tried writing my own convolution function and using CONVOL. It is a
very short code, here it is:
pro conv1
Openr, lun, 'model.dat', /Get_Lun
Point_Lun, lun, 0
ReadF, lun, adim, bdim, num_columns
array = fltarr(2, 1024)
readf,lun,array
a = array(0,*)
b = array(1,*)
Free_Lun, lun
Openr, lun, 'data.dat', /Get_Lun
Point_Lun, lun, 1
ReadF, lun, cdim, ddim, num_columns
array2 = fltarr(2, 1024)
readf,lun,array
c = array(0,*)
d = array(1,*)
x=make_array(1024)
sigma=15
mu =15
const=1/(sigma*sqrt(2*!pi))
for i = 0,1024 do x[i]= array[0,*]
f= const*( EXP(-1.0*(x - mu)^2/(2*sigma^2)))
z = convol(array,array2,/center)
z = z*2
print,f
end
here is the message I get:% Out of range subscript encountered: X.
% Execution halted at: CONV1 29
/Users/Dave/Desktop/conv1.pro
% $MAIN$
I don't see why this doesn't work? I am very frustrated
Sarah


|