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

Home » Public Forums » archive » Re: SOS with Idl
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: SOS with Idl [message #55475 is a reply to message #55471] Tue, 21 August 2007 09:01 Go to previous messageGo to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
anaisgcristal@gmail.com wrote:
> Hi, I just learnig programming with Idl, and I've been trying to
> modifided a file to print a array 4X27 (matriz), but I can't print
> this array in a file! I suposse the problems it's some definition or
> something similar, but I didn't found it. It's posible that someone
> can check the code and help me to found the bug?
> Thanks a lot


What do you get exactly?

Jean



> Quote:
> pro p
> fname = "/home/iquique/anais/Codigos/Gadget/resultados/w_066/
> powerspec_004.txt"
> openr, 1, fname
>
>
> Time = 0.0
> Bins = 0L
> readf, 1, Time
> readf, 1, Bins
> da1= fltarr(10, bins)
> readf, 1, da1
> readf, 1, Time
> readf, 1, Bins
> da2= fltarr(10, bins)
> matriz = fltarr(2, 27)
> readf, 1, da2
> close,1
>
>
> K_A = da1(0,*)
> Delta2_A = da1(1,*)
> Shot_A = da1(2,*)
> ModePow_A = da1(3,*)
> ModeCount_A = da1(4,*)
> Delta2Uncorrected_A = da1(5,*)
> ModePowUncorrected_A = da1(6,*)
> Specshape_A = da1(7,*)
> SumPower_A = da1(8,*)
> ConvFac_A = da1(9,*)
>
> K_B = da2(0,*)
> Delta2_B = da2(1,*)
> Shot_B = da2(2,*)
> ModePow_B = da2(3,*)
> ModeCount_B = da2(4,*)
> Delta2Uncorrected_B = da2(5,*)
> ModePowUncorrected_B = da2(6,*)
> Specshape_B = da2(7,*)
> SumPower_B = da2(8,*)
> ConvFac_B = da2(9,*)
>
>
> ; we will do a band averaging of the finely binned points,
> ; subject to two conditions:
> ; We want enough modes per bin in order to reduce the variance in a
> bin,
> ; and simultaneously, for large k, we don't want the bins become too
> narrow.
> ;
> ; The first condition is set by "MinModeCount",
> ; the second by "TargetBinNummer", which is used to compute a minimum
> ; logarithmic bin-size.
>
>
> MinModeCount = 20
> TargetBinNummer = 60
>
> MinDlogK = (alog10(max(K_A)) - alog10(min(K_A)))/TargetbinNummer
>
>
> istart=0
> ind=[istart]
> k_list_A = [0]
> Delta2_list_A = [0]
> count_list_A = [0]
> for j = 0, 27-1 do begin
> repeat begin
> count = total(modecount_a(ind))
> deltak = (alog10(max(K_A(ind))) - alog10(min(K_A(ind))))
>
> if (deltak ge mindlogk) and (count ge MinModeCount) then begin
> d2 = total(SumPower_A(ind))/total(ModeCount_A(ind))
> b = fix(total(double(ind)*ModeCount_A(ind))/total(ModeCount_A(in d)))
> kk = K_A(b)
> d2 = ConvFac_A(b)*d2*Specshape_A(b)
> k_list_A = [k_list_A, kk]
> Delta2_list_A = [Delta2_list_A, d2]
> count_list_A = [count_list_A, total(ModeCount_A(ind))]
> istart = istart + 1
> ind = [istart]
> endif else begin
> istart = istart + 1
> ind = [ind, istart]
> endelse
> endrep until istart ge Bins
> K_list_A = k_list_A(1:*)
> Delta2_list_A = delta2_list_A(1:*)
> Count_list_A = count_list_A(1:*)
> [b]matriz(0, j) = Delta2_list_A
> matriz(1,j) = Delta2_list_B
> end
> openw, 5, 'mypk.dat'
> for j= 0, 27 -1 do begin
> printf, 5, matriz(*, j)
> print, matriz(*, j)
> end
> close, 5
> end
>
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Reading Landsat FAST data in ENVI
Next Topic: Re: Fill intersection of two contours

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

Current Time: Sun Oct 12 08:15:02 PDT 2025

Total time taken to generate the page: 1.03847 seconds