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

Home » Public Forums » archive » Having trouble with code for data to image.
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Having trouble with code for data to image. [message #63985] Tue, 25 November 2008 21:49 Go to previous message
mbweller is currently offline  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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Memory allocation problem
Next Topic: Re: inverse gradient

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

Current Time: Fri Oct 10 12:40:17 PDT 2025

Total time taken to generate the page: 0.71876 seconds