| 
									 I am writing a program for my supervisor to take 8 spectra which are
each a matrix of 16384 by 2. The part of the program we have already
splits the matrices into single matrices. Which is the code below:
fitfilename1 = '/Users/quasargroup/NGC3783/NGC3783 new data/X1dsum
files/lbgu19010_x1dsum.fits'
 data1 = mrdfits(fitfilename1,1,hdr)
 w1 = data1.wavelength
 w1a=w1(*, 0)
 w1b=w1(*, 1)
 f1= data1.flux
 f1a=f1(*, 0)
 f1b=f1(*, 1)
.... etc. through 8
Then I must get a new graph with a span of wavelengths and interpolated
flux values.
Here is the wavelength grid for the eventual interpolation:
wgrid=findgen(58400)*.01+1227  ; from 1227.00 to 1811.00
 help, /str, wgrid
Here is where I am trying to interpolate:
 linterp, w1a, f1a, wgrid, fint1a
 linterp, w1b, f2b, wgrid, fint1b
 linterp, w2a, f2a, wgrid, fint2a
..... etc through 8
But I got this error.
% Compiled module: INTERPOLATEDSIXTEEN.
MRDFITS: Binary table.  12 columns by  2 rows.
MRDFITS: Binary table.  12 columns by  2 rows.
MRDFITS: Binary table.  12 columns by  2 rows.
MRDFITS: Binary table.  12 columns by  2 rows.
MRDFITS: Binary table.  12 columns by  2 rows.
MRDFITS: Binary table.  12 columns by  2 rows.
MRDFITS: Binary table.  12 columns by  2 rows.
MRDFITS: Binary table.  12 columns by  2 rows.
 Parameter 3 (New X Vector or Scalar)  of routine LINTERP  is undefined.
Valid dimensions are: scalar  1
Valid types are:  byte int*2 int*4 real*4 real*8 Unsigned(i*2)
Unsigned(i*4) int*8 Unsigned(i*8)
Do I need to do something to our wgrid or to the interpolate command to
get it to work?
Also, in each of our 8 data sets, there is an increment of wavelength
values where the value of the flux is 0, which will make the average of
all 8 messed up. Do you have any ideas how to write a loop that goes
through all of the wgrid values and averages the values of the
interpolated flux values, but skips the flux values that are 0 and
continues to the next? Is there a skip command? Would a where command
work the best?
Here is what I started with :
for i=1227.00, (1227.00+58400*.01), 0.01 do ??? 
									
								 |