Exemplo n.º 1
0
import util
import numpy as np
import trap_analysis
import cPickle
saved_files = '/home/shomea/a/anderovo/Dropbox/watershedLargeFiles/'
import load_geotiff
import time
import cProfile
import plot

pr = cProfile.Profile()


heights_file = saved_files + 'anders_hoh.tiff'

landscape = load_geotiff.get_landscape_tyrifjorden(heights_file)

#watersheds = cPickle.load(open(saved_files + 'nodesInWatershedsStandard.pkl', 'rb'))
new_watersheds = cPickle.load(open(saved_files + 'watershedsAfterMergingSubTraps.pkl', 'rb'))

#start = time.time()
#new_watersheds, nr_of_iterations = trap_analysis.merge_sub_traps(
#    watersheds, landscape.coordinates[:, 2], landscape.num_of_nodes_x, landscape.num_of_nodes_y)
#print 'There are ', len(new_watersheds), ' watersheds after doing ', nr_of_iterations, ' iterations.'
#end = time.time()-
#print end-start

"""
lakes_file = saved_files + 'anders_innsjo.tiff'
rivers_file = saved_files + 'anders_elvbekk.tiff'
small_rivers_file = saved_files + 'anders_elvmidtlinje.tiff'
Exemplo n.º 2
0
import sys
sys.path.insert(0, '/home/shomea/a/anderovo/Dropbox/watershed/trapAnalysis/lib')
import load_geotiff
import plot

"""
Plot the landscape using the landscape object holding (x, y, z)-data in 3 dimensions
"""

file_name = '/home/shomea/a/anderovo/Dropbox/watershedLargeFiles/anders_hoh.tiff'

landscape = load_geotiff.get_landscape_tyrifjorden(file_name)
downsampling_factor = 1

plot.plot_landscape_3d(landscape, downsampling_factor)