Re: newbie question.. again :) [message #35747 is a reply to message #35745] |
Wed, 09 July 2003 14:12   |
alex_panton
Messages: 5 Registered: June 2003
|
Junior Member |
|
|
hey thanks for replying:) i didn't post my code 'cos its a bit on the
messy side bare in mind i have only been using this for about 2 weeks
! I re read my post hmm, I have like 91 files, I want to extract the
same 5 by 5 area on each image. Put this all into one row (this is
cool can do this) what i can't do is get say, image2 to go into row 2
.. if that makes sense? .csv or anything really just want to be able
to export it to something evil like a spreadsheet :)
here goes ....
store=('g:\goes9_processed\btcloudfree\subtraction')
outstore=('g:\test')
cd, store
y=3
x=1
files02=findfile('*2.tiff', count=num02files)
print, num02files
while(num02files gt y) do begin
cd, store
InfileName02=files02(y)
print, Infilename02
ok=query_tiff(Infilename02) ;checks to see if the tiff file exists
if (ok eq 1) then begin
tiffread=read_tiff(Infilename02) ; reads tiff
storage_array=make_array(25,y ,/byte) ;my array that i want to
write to
radiancevalues=extrac(tiffread,145,180,5,5) ;extracts a 5 by 5
array from the coordinates given
radiancevalues=rebin(radiancevalues,25,1) ;puts it all on one line
len02=strlen(InfileName02)
striptext02=strmid(Infilename02,0,len02-7)
stats=moment(radiancevalues)
outname=striptext02+'test'+'.csv' ;configures the output filename
storage_array=radiancevalues[*] ;*trying* to get radiance values
into one array but can't get it to work *sighs*
cd, outstore
openw,1,outname, width=2000 ;opens outputfile
for i=0,num02files-1 do begin
printf,1,storage_array,stats, format='(25(f,","),f)'
endfor
close,1
free_lun,1
;endfor
endif else begin
print, 'no matching file name found in directory'
endelse
y=y+1
endwhile
end
..and google groups messed up my format something chronic, my
apologies
cheers for any help you can give
alex
Timm Weitkamp <timm.weitkamp@nowhere> wrote in message news:<Pine.LNX.4.44.0307091614210.15330-100000@localhost.localdomain>...
> Today at 09:31 -0400, Haje Korth wrote:
>
>> Alex,
>> I am not quite sure what you are trying to do and I for sure do not know
>> what a .csv file is
>
> I think a .csv file is a "comma-separated values" Ascii file.
>
>> but here is an idea: The area you extravt is a 2-d
>> array with dimensions xdim and ydim if rectangular. If I understand you
>> correctly your number of collumns x is xdim*ydim. In order to map the 2d
>> array into a 1d array, which is one row in your file, you use
>> 'reform(2d-array,xdim*ydim)'. In order to process all your files you just
>> loop through them.
>
> Or, even simpler (assuming that you want to map a 2D array "a" into a 1D
> array "b"): b = a[*].
>
> Alex: I understand you already wrote some code but it doesn't work as you
> would like it to. Would you mind posting it and pointing out to us the
> part where you're stuck?
>
> Timm
|
|
|