Having trouble with code for data to image. [message #63985] |
Tue, 25 November 2008 21:49  |
mbweller
Messages: 24 Registered: July 2008
|
Junior Member |
|
|
Hello,
I am running the code:
image = fltarr(nx,ny)
deltax = (xrange[1]-xrange[0])/float(nx)
deltay = (yrange[1]-yrange[0])/float(ny)
for i=0l,ndata-1 do $
image[(left[i]-xrange[0])/deltax:(right[i]-xrange[0])/deltax , $
(bottom[i]-yrange[0])/deltay:(top[i]-yrange[0])/deltay] =
magnitude
[i]
where: nx=ny=180
xrange= [-180,0]
yrange = [-90,90]
ndata = 32400 ( or180^2 or nx*ny)
eg left -180
right -179
top 90
bottom 89
magnitude 0.1648
and i get the error when I run the code:
% Subscript range values of the form low:high must be >= 0, < size,
with low <= high: IMAGE
I assume the problem is in the way that my data is ordered, and I have
tried switching lows and highs around, but to no avail. I would
imagine this is pretty simple to solve, but it is not clear to me
right now.
Any insight?
Thanks,
~Matt
|
|
|