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

Home » Public Forums » archive » Re: divise image envi-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: divise image envi-idl [message #70947 is a reply to message #70946] Thu, 20 May 2010 13:22 Go to previous messageGo to previous message
tonino is currently offline  tonino
Messages: 4
Registered: May 2010
Junior Member
Thank you all for your advices...

Now, my program is running. I can even write into my header (so nice).
The last problem is that my images ar not recognized when when I try
to open them with ENVI :

pro tuilage

;ENVI, /RESTORE_BASE_SAVE_FILES
ENVI_BATCH_INIT

image = 'C:\Documents and Settings\Administrateur\Mes documents
\cooccurrence+1+2'
envi_open_file, image, r_fid=fidimage, /NO_REALIZE

if (fidimage eq -1) then begin
print, 'error nestor'
endif

envi_file_query, fidimage, dims = dimimage, NB=NBimage, NL=NLimage,
NS=NSimage, Bnames=Bnamesimage, data_type = data_type
pos = lindgen(NBimage)

openr, lun, image, /get_lun
espace = fltarr(NSimage, NLimage, NBimage)

READU,lun, espace

result = fltarr(NSimage/5, NLimage/2, NBimage)

for i = 0, (NSimage-NSimage/5), NSimage/5 do begin
for j = 0, (NLimage-NLimage/2), NLimage/2 do begin

result = espace[i:i+((NSimage/5)-1),j:j+((NLimage/2)-1),
0:NBimage-1]

mc = [0, 0, 724295*i*(NSimage/5)*2.5, 1635835.0*j*(NLimage/
2)*2.5]
ps=[2.5,2.5]

map_info=envi_map_info_create(/UTM, datum=datum, zone=20, ps=ps,
mc=mc)


outname='C:\Documents and Settings\Administrateur\Mes documents
\'+strtrim(i/(NSimage/5))+strtrim(j/(NLimage/2))+'.img'
envi_write_envi_file, result, data_type=4, nb=NBimage,
nl=NLimage/2, $
ns=NSimage/5, BNAMES=BNamesimages, out_name=outname,
byte_order=0, map_info=map_info

; envi_setup_head, Bnames=Bnamesimage, data_type=4,
fname=strcompress(out_name+'.hdr', /REMOVE_ALL), $
; NS=NSimage/5, NL=NLimage/2, NB=NBimage, $

openw, unit, outname, /Get_lun
writeu, unit, result
free_lun, lun

endfor
endfor

end
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: x-y offsets
Next Topic: Why do I get the string in ytitle in vertical direction

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

Current Time: Fri Oct 10 20:29:12 PDT 2025

Total time taken to generate the page: 1.11719 seconds