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

Home » Public Forums » archive » Re: colour coded shaded relief DEM: go get 'm
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: colour coded shaded relief DEM: go get 'm [message #4754] Tue, 01 August 1995 00:00
geomagic is currently offline  geomagic
Messages: 22
Registered: November 1993
Junior Member
In article <3vl4qg$3jb@news.csus.edu> chris@sfsu.edu (Christopher McCarthy) writes:

> Thank you for creating that routine. I have been hoping for a
> way to shade_surf DEMs, but never explored it much. Ok
> here in an obvious question for you.
>
> I downloaded a DEM called from USGS called:
>
> mount_mckinley-w.gz
>
> Then unpacked it using: gunzip mount_mckinley-w.gz
>
> Resulting in the binary file: mt_mc_kinley-w
>
> Can you tell me how to associate the contents of this file
> with the variable 'dem' to be used in your program??
>
> Or have I done something wrong?
>
> Thanks,
> Chris

First I run:
dd if=inputfilename of=outputfilename ibs=4096 cbs=1024 conv=unblock

to unblock the ASCII (not binary) uncompress file.

Then the following IDL script works

cimage=intarr(1201,1201)
filein='los_angeles-w.dem'

get_lun,unit1
openr,unit1,filein
mapname=' '
DEM_level_code=0
elevation_code=0
reference_code=0
zone_code=0
map_project=dblarr(15)
xy_unit_code=0
z_unit_code=0
poly_sides=0
DEM_corners=dblarr(2,4)
elevation_range=dblarr(2)
reference_angle=0.d0
accuracy_code=0
spatial_resolution=fltarr(3)
num_rows=0
num_cols=0

aformat='(A144,4I6,15D24.15,3I6,4(2D24.15),3D24.15,I6,3E12.6 ,2I6)'
readf,unit1,format=aformat,mapname,DEM_level_code,elevation_ code,$
reference_code,zone_code,map_project,xy_unit_code,z_unit_cod e,$
poly_sides,DEM_corners,elevation_range,reference_angle,accur acy_code,$
spatial_resolution,num_rows,num_cols

;convert corners to degrees
DEM_corners=DEM_corners/3600.
line = {elevations, crow:0,ccol:0,nnodes:0,cnodes:0,clon:0.d0,clat:0.d0,$
cdatum:0.d0,celvmin:0.d0,celvmax:0.d0,$
celevations:intarr(1201)}
print,mapname
print,DEM_corners
i=0
.run
while (not eof(unit1)) do begin
readf,unit1,line
for j=0,1200 do cimage(j,i) = line.celevations(j)
i=i+1
endwhile
end
close,unit1
free_lun,unit1
cimage = transpose(cimage)

Dan (I speak for no organization) O'Connell
geomagic@seismo.usbr.gov
Seismotectonics Group, U.S. Bureau of Reclamation
Denver Federal Center, P.O. Box 25007 D-8330, Denver, CO 80225
"We do custom earthquakes (for food)"
or
"Just more roadkill on the information superhighway"

/\
/ \
/ \ /\ /\
/\ / \ / \ / \ /\ /\/\ /\/\
___/ \ /\/\/\/ \ / \ /\ / \ / \/ \/ \ /\_______
\/ \ / \ / \/ \/ \/
\/ \/

FIAT: Oozing rust from every pore, it disintegrated across the floor...
(Proud owner of auto-recyling FIAT)
Re: colour coded shaded relief DEM: go get 'm [message #4756 is a reply to message #4754] Tue, 01 August 1995 00:00 Go to previous message
chris is currently offline  chris
Messages: 22
Registered: October 1994
Junior Member
Thank you for creating that routine. I have been hoping for a
way to shade_surf DEMs, but never explored it much. Ok
here in an obvious question for you.

I downloaded a DEM called from USGS called:

mount_mckinley-w.gz

Then unpacked it using: gunzip mount_mckinley-w.gz

Resulting in the binary file: mt_mc_kinley-w

Can you tell me how to associate the contents of this file
with the variable 'dem' to be used in your program??

Or have I done something wrong?

Thanks,
Chris
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: writing gif image
Next Topic: Re: Compound widget problem

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

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

Total time taken to generate the page: 0.00798 seconds