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

Home » Public Forums » archive » Re: costum stretch an image
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: costum stretch an image [message #68814 is a reply to message #68813] Tue, 01 December 2009 08:45 Go to previous messageGo to previous message
ivitseva is currently offline  ivitseva
Messages: 15
Registered: December 2009
Junior Member
Thanks for both answers, I worked on it the whole day choosing the
second option for that seems to be faster and less typing. In fact it
is fast and does process the image but the output is a "disaster", the
values are there but only part of the image is processed it seems or
in any case the geometry of the resulting image is a mess. The
dimension of the output array is ok so are the projection and datum
information but opening the image it seems that the area is folded or
turned or something...I've never seen that before thus I have no idea
what that problem could be. I could put the input and output onto an
FTP server if needed. In any case here is what I did, can you please
tell me why the output has a messed up geometry?

-----------
pro stretch_idl

indir='X:\run\'
outdir='H:\eva\noaa\phentimesat\'
infile=dialog_pickfile(path=indir,filter='*.bil')
strpos=strpos(infile,'\',/reverse_search)

outfile=strmid(infile,strpos+1,15)
outname=outdir+outfile+'str'+'.bil'

ns=5407
nl=4650

openr,lun,infile,/get_lun
image=fltarr(ns,nl)
readu,lun,image
free_lun,lun

v = [-12, 0, 35, 48] ;--- output values
x = [0., 37., 72., 82.] ;--- input values

output=interpol(v,x,image)
output=round(output)

close, /all

openw,lun, outname, /get_lun
writeu,lun, output
free_lun, lun
close, lun

header=outdir+outfile+'str'+'.hdr'
openw, 3, header
printf,3,'ENVI'
printf,3,'samples ='+STRCOMPRESS(ns)
printf,3,'lines ='+STRCOMPRESS(nl)
printf,3,'bands = 1'
printf,3,'header offset = 0'
printf,3,'file type = ENVI Standard'
printf,3,'data type = 2'
printf,3,'interleave = bsq'
printf,3,'sensor type = AVHRR'
printf,3,'byte order = 0'
printf,3,'map info = {INSPIRE-LAEA, 1.0000, 1.0000, 0.0000, 0.0000,
1.0000000000e+003, 1.0000000000e+003, ETRS89, units=Meters}'
printf,3,'projection info = {11, 6378137.0, 6356752.5, 52.000000,
10.000000, 4321000.0, 3210000.0, ETRS89, INSPIRE-LAEA, units=Meters}'
printf,3,'band names = {sos83}'
CLOSE, 3

print,'Done!'

end
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: SHAPEFILE changes in IDL7.1?
Next Topic: svg output

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

Current Time: Wed Oct 08 17:52:16 PDT 2025

Total time taken to generate the page: 0.00472 seconds