Re: Binary images with these formates: *.cor, *.unw, *.hgt [message #78068] |
Tue, 25 October 2011 04:32 |
Wout De Nolf
Messages: 194 Registered: October 2008
|
Senior Member |
|
|
On Sun, 23 Oct 2011 03:47:59 -0700 (PDT), Dave Poreh
<d.poreh@gmail.com> wrote:
> Folks
> hi,
> i am doing some analysis with a software and for visualization i need
> to open some binary images with these formates: *.cor, *.unw, *.hgt.
> does any body have any idea to how to read these images?
> thanks for any help.
> Cheers,
> Dave
According to this description
http://pages.uoregon.edu/das/WikiRoiPac/doku.php?id=output
these are raw images with BIL format (Band Interleaved by Line)
The BIL structure is not to difficult:
http://vterrain.org/Imagery/formats.html
However these files also have "ROI_PAC File Structure = rmg". Does
this mean there are two bands (amplitude and phase)? Not sure. Anyway,
this is a start:
; Parameters
bigendian=0b ; assumed little endian
path='...'
ncol=... ; you should know
nband=2 ; assume two bands (amplitude and phase)
; Read data block
openr,lun,path,/get_lun, SWAP_IF_BIG_ENDIAN=~bigendian,$
SWAP_IF_LITTLE_ENDIAN=bigendian
n=(fstat(lun)).size/32 ; number of floating point numbers
m=n/ncol ; number of rows * number of bands
data=fltarr(ncol,m)
readu,lun,data
free_lun,lun
; Extract amplitude and phase
data=reform(data,ncol,nband,m/nband,/overwrite)
amplitude=reform(data[*,0,*])
phase=reform(data[*,1,*])
|
|
|