-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmatch.py
41 lines (33 loc) · 1.31 KB
/
match.py
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
import os, sys
sys.path.append('/home/ubuntu/scarplet-python/scarplet')
import dem, scarplet
import numpy as np
import logging
from timeit import default_timer as timer
from Worker import Matcher, Reducer
if __name__ == "__main__":
logging.config.fileConfig('logging.conf')
logger = logging.getLogger('scarp_reduce')
d = np.float(sys.argv[1])
age = np.float(sys.argv[2])
pad_dx = int(sys.argv[3])
pad_dy = int(sys.argv[4])
ang_max = np.float(sys.argv[5])
ang_min = np.float(sys.argv[6])
ages = [age]
local_data_directory = '/efs/data/'
tiles = os.listdir(local_data_directory)
local_results_directory = '/efs/results/'
logger.info("Starting Matcher for {} {:.2f}".format(d, ages[0]))
files = os.listdir(local_data_directory)
files.sort()
finished_processing = False
while not finished_processing:
for tile in files:
logger.debug("Starting Matcher for {}, {} {:.2f}".format(tile, d, ages[0]))
worker = Matcher(local_data_directory + tile, pad_dx, pad_dy, ang_max, ang_min)
worker.process(d, ages, ang_max, ang_min)
logger.debug("Finished processing {}, {} {:.2f}".format(tile, d, ages[0]))
files = os.listdir(local_data_directory)
files.sort()
finished_processing = len(files) == 0