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

Home » Public Forums » archive » Re: Reading USGS DEMs
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: Reading USGS DEMs [message #3942 is a reply to message #3938] Tue, 21 March 1995 22:43 Go to previous messageGo to previous message
moersch is currently offline  moersch
Messages: 2
Registered: August 1994
Junior Member
In article <3klgmi$noh@newsbf02.news.aol.com> arthurb733@aol.com (ArthurB733) writes:

> I'm new to IDL and to this group. Please forgive me if this subject has
> come up before. I was wondering if anyone knows of existing IDL
> procedures for reading USGS DEMs, or does someone have pointers to offer
> on the topic?

I wrote the attached short bit of code a while ago to do this. It's
not very fancy, but it should do the job for you.

Jeff Moersch
Astronomy and Space Sciences
Cornell University
moersch@astrosun.tn.cornell.edu

----cut here----
pro demread, filename, demarr

; Reads in a standard 1201x1201 USGS Digital Elevation Map.

hdr=''
linehdr=''
alt1=intarr(146)
alt2=intarr(170)
alt3=intarr(170)
alt4=intarr(170)
alt5=intarr(170)
alt6=intarr(170)
alt7=intarr(170)
alt8=intarr(35)
openr, 1, filename
readf,1,hdr
for i=0,1200 do begin
readf,1,linehdr,alt1,format='(a147,146i6)'
readf,1,alt2,format='(170i6)'
readf,1,alt3,format='(170i6)'
readf,1,alt4,format='(170i6)'
readf,1,alt5,format='(170i6)'
readf,1,alt6,format='(170i6)'
readf,1,alt7,format='(170i6)'
readf,1,alt8,format='(35i6)'
demarr(i,0:145)=alt1
demarr(i,146:315)=alt2
demarr(i,316:485)=alt3
demarr(i,486:655)=alt4
demarr(i,656:825)=alt5
demarr(i,826:995)=alt6
demarr(i,996:1165)=alt7
demarr(i,1166:1200)=alt8
endfor
close,1
end
----cut here----
--
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Q: synchronizing widget events
Next Topic: Passing Data Through CALL_EXTERNAL

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

Current Time: Wed Oct 08 19:35:22 PDT 2025

Total time taken to generate the page: 0.00387 seconds