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

Home » Public Forums » archive » Expand
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Expand [message #10624] Mon, 05 January 1998 00:00
Kelly Dean is currently offline  Kelly Dean
Messages: 92
Registered: March 1997
Member
I am reading some AVHRR LAC data in the Level 1B format. The image
provides 51 latitude/longitude pairs for each 2048 pixel scan line. They
are sampled every 40 points starting at point 25 (25, 65, 105,..., 1945,
1985, 2025).

I created a simple IDL routine to expand the 51 values to 2048 values
using FOR loops. I am looking for suggestions to make this more
efficient.


Kelly Dean


++++++++++++++++++INTER2048+++++++++++++++++++++++++++++++++
FUNCTION INTER2048, array51

start = 24
interval = 40
line_pix = 2048
array2048 = FLTarr(2048)
;
; Assign repeatedly used variables.
;
value = array51
;
; Take care of the beginning part (extrapolation).
;
dvalue = (value(1) - value(0)) / interval
array2048(start) = value(0)
FOR i = start - 1, 0, -1 DO BEGIN
array2048(i) = array2048(i+1) - dvalue
; PRINT, ' Ii >',i,array2048(i)
ENDFOR

FOR i = 0, 49 DO BEGIN
dvalue = ( value(i+1) - value(i) ) / interval
FOR j = ( start + i * interval + 1 ), (start + (i+1) * interval ) DO
BEGIN
array2048(j) = array2048(j-1) + dvalue
; PRINT, ' Ij >',j,array2048(j)
ENDFOR
ENDFOR
;
; Take care of the ending part (extrapolation).
;
FOR k = j, line_pix-1 DO BEGIN
array2048(k) = array2048(k-1) + dvalue
; PRINT, ' Ik >',k,array2048(k)
ENDFOR

RETURN, array2048
END
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Free source code diagramming software offerred
Next Topic: Re: Limit on Polar Stereographic Projection?

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

Current Time: Fri Oct 10 22:47:41 PDT 2025

Total time taken to generate the page: 0.48249 seconds