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)
|