ut.asp=asp ut.coss=np.cos(slp) ut.sins=np.sin(slp) if ut.dx != ut.dy or ut.imax != ut.jmax: print " For dx=dy and imax=jmax only !!" exit() ut.dd=ut.dx sky=np.zeros((ut.jmax,ut.imax),dtype=np.float32) for angle in sangle: print '* '+ 'angle='+str(angle)+' *' sky=sky+ut.sky(dem,angle,2)/num #print np.max(sky),np.min(sky) sky[np.where(sky<0.0)]=0.0 #skyx=cv2.resize(sky,(500,500)) #cv2.imshow('sky',skyx) #cv2.destroyWindow('sky') ut.write_tif('skyview.tif',sky.astype(np.float32)) exit()
slp = ut.slope(dem) asp = ut.orient(dem) if len(param) == 2: ut.write_tif('slope.tif', slp.astype(np.float32)) ut.write_tif('aspect.tif', asp.astype(np.float32)) exit() if len(param) == 4: sun_el = float(param[2]) sun_az = float(param[3]) inc = ut.incident(dem, sun_el, sun_az) ut.write_tif('incident.tif', inc.astype(np.float32)) exit() ut.asp = asp ut.coss = np.cos(slp) ut.sins = np.sin(slp) if ut.dx != ut.dy or ut.imax != ut.jmax: print " For dx=dy and imax=jmax only !!" exit() ut.dd = ut.dx d_angle = float(param[2]) dview = ut.sky(dem, d_angle, 1) ut.write_tif('angle' + param[2] + '.tif', dview.astype(np.float32)) exit()
slp = ut.slope(dem) asp = ut.orient(dem) ut.asp = asp ut.coss = np.cos(slp) ut.sins = np.sin(slp) if ut.dx != ut.dy or ut.imax != ut.jmax: print " For dx=dy and imax=jmax only !!" exit() ut.dd = ut.dx sky = np.zeros((ut.jmax, ut.imax), dtype=np.float32) for angle in sangle: print '* ' + 'angle=' + str(angle) + ' *' sky = sky + ut.sky(dem, angle, 2) / num #print np.max(sky),np.min(sky) sky[np.where(sky < 0.0)] = 0.0 #skyx=cv2.resize(sky,(500,500)) #cv2.imshow('sky',skyx) #cv2.destroyWindow('sky') ut.write_tif('skyview.tif', sky.astype(np.float32)) exit()
if len(param) == 2: ut.write_tif('slope.tif',slp.astype(np.float32)) ut.write_tif('aspect.tif',asp.astype(np.float32)) exit() if len(param) == 4: sun_el=float(param[2]) sun_az=float(param[3]) inc=ut.incident(dem,sun_el,sun_az) ut.write_tif('incident.tif',inc.astype(np.float32)) exit() ut.asp=asp ut.coss=np.cos(slp) ut.sins=np.sin(slp) if ut.dx != ut.dy or ut.imax != ut.jmax: print " For dx=dy and imax=jmax only !!" exit() ut.dd=ut.dx d_angle=float(param[2]) dview=ut.sky(dem,d_angle,1) ut.write_tif('angle'+param[2]+'.tif',dview.astype(np.float32)) exit()