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

Home » Public Forums » archive » multi-dimensions in IDL
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
multi-dimensions in IDL [message #47528] Mon, 13 February 2006 05:22
kathryn.barker is currently offline  kathryn.barker
Messages: 1
Registered: February 2006
Junior Member
I am trying to program using a 4-dimensional array. I have data for an
array of [201,16,16,6]. I need to write out text files for combinations
of 16 and 16. Each output file shoud be an array [201, 6]. I am
supposed to obtain 1536 output files (without any redundant data) from
these dimensions, does anyone have any idea how to do this? Unusually
for me the programming is not the problem, just the combinations!
Thanks.

I have got this far with the code:

pro LUT_Interpolate

COMMON sh_geo, eo_geo ;Common block, with sh_geo the common name shared
with
;read_eo and eo_geo being the LUT we want to use
in this program.

dep=201

wl=fltarr(6) ;to define names of the
columns (wavelengths) as an array
wl=[412, 440, 490, 510, 555, 670] ;naming the columns as they are

wl_i=fltarr(6) ;to define the names of
the column of the enw wavelengths
wl_i=[410, 462, 514, 566, 618, 670] ;naming the new wavebands


outp=fltarr(201,16,16,6,1) ;defining output array

for i=0,200 do begin ;for depth first
for j=0,15 do begin ;for absorbance
for k=0,15 do begin ;for scattering

tempE0=eo_geo(i,j,k,0:5,5) ;rewriting eo-geo to a temp file
so as not to spoil original eo-geo
tmpE0=reform(tempE0)
tmpE0_i=interpol(tmpE0,wl,wl_i) ;interpolating the
irregular grid of reformed data to
generate new lambda
tmpE0_i(0)=tmpE0(0) ;Ist cell of the interpolated
values to be replaced by the 1st
;cell of the original
data.
outp(i,j,k,*)=tmpE0_i ;output array of interpolated
values defined

endfor
endfor
endfor


for i=0,15 do begin ;i = abs
for j=0,15 do begin ;j = scat
tempoutput=fltarr(201,6) ;the output size (1 column of
201)
; adding in that we need to write
out for
;all lamda, and not just 1 lamda
at a time.
tempoutput=outp(*,i,j,*) ;filling the files with all
dpeths and Eo for each combinations of a,b,lamda
; now we are writing out for each
combination
;of a, b at all depths and all
lamda.

tempoutput=reform(tempoutput) ;as above



tmpfn=strcompress(dirstem+'Eo_a'+string(i)+'_b'+string(j)+'. txt',/remove_all)
;thus delineating
combination.

openw,20,tmpfn
printf,20,tempoutput,FORMAT='(6(f))' ;printed formatted data
to the file.
close,20

endfor
endfor

end
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: moving multiple ROIs with XROI
Next Topic: Re: getting ytitle to span many plots

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

Current Time: Thu Oct 09 21:25:32 PDT 2025

Total time taken to generate the page: 1.06128 seconds