-
Notifications
You must be signed in to change notification settings - Fork 2
/
topo_advanced_vis_gradient.pro
60 lines (52 loc) · 1.4 KB
/
topo_advanced_vis_gradient.pro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
;+
; NAME:
;
; Topo_advanced_vis_shade
;
; PURPOSE:
;
; Compute terain gradient - slope in degrees
;
; INPUTS:
;
; This procedure needs
; in_file - path+filename of input DEM to save the outputs
; geotiff - geotiff structure of the input/output
; dem - elvation data
; resolution - spatial resolution of DEM
; in_ve_ex - vertical exageration
; sc_slp_ex - extreme values for 8-bit conversion
;
;
; OUTPUTS:
;
; Written 8-bit GEOTIFF files for SVF, anisotropic SVF or openess
;
; AUTHOR:
;
; Klemen Zaksek
;
; DEPENDENCIES:
;
; topo_advanced_vis_slope
;
; MODIFICATION HISTORY:
;
; Written by Klemen Zaksek, 2013.
;
;-
PRO topo_advanced_vis_gradient, in_file, geotiff, $
dem, resolution, $ ;relief
sc_slp_ev, $
overwrite=overwrite
;Slope & Aspect
topo_advanced_vis_slope, dem, resolution, DEM_SLOPE=slope_dem, DEM_ASPECT=aspect_dem, /degree
;Write results
out_file = in_file + '.tif'
write_image_to_geotiff_float, overwrite, out_file, slope_dem, geotiff=geotiff
; Write_tiff, in_file + '_aspect.tif', aspect_dem, compression=1, geotiff=geotiff, /float
slope_dem = 255 - Bytscl(slope_dem, max=sc_slp_ev[1], min=sc_slp_ev[0])
out_file = in_file + '_8bit.tif'
write_image_to_geotiff, overwrite, out_file, slope_dem, geotiff=geotiff
slope_dem = !null & aspect_dem = !null
END