-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerized_Ortho_Save.py
70 lines (52 loc) · 2.21 KB
/
Dockerized_Ortho_Save.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import argparse
import numpy as np
import cv2
import random
import math
import multiprocessing
import datetime
import sys
import gc
import pickle
import os
import threading
import socket
import statistics
import datetime
from Customized_myltiprocessing import MyPool
from heapq import heappush, heappop, heapify
from collections import OrderedDict,Counter
from Block_wise_GPS_correction import *
import settings
def main(scan_date):
sys.setrecursionlimit(10**6)
settings.lettuce_coords = read_lettuce_heads_coordinates()
field_new = Field(is_single_group=settings.is_single_group,use_corrected=True)
field_new.draw_and_save_field(is_old=False)
def get_args():
parser = argparse.ArgumentParser(description='Geo-correction on HPC.')
parser.add_argument('-d','--destination', type=str, help='address of the destination folder on HPC (usually on xdisk where everything is stored).')
parser.add_argument('-b','--bin_2tif', type=str, help='the address of the bin_2tif folder.')
parser.add_argument('-g','--gps_coord', type=str, help='the address of the GPS coordinates csv file.')
parser.add_argument('-s','--scan_date', type=str, help='the name of the specific scan to work on.')
parser.add_argument('-c','--config_file', type=str, help='the name of the config file to use.')
parser.add_argument('-l','--lid_address', type=str, help='the address of the lid file.')
parser.add_argument('-u','--uav_lettuce_address', type=str, help='the address of the uav lettuce coordinates file.')
parser.add_argument('-r','--repository_address', type=str, help='the address of the geocorrection repository.')
args = parser.parse_args()
return args
start_time = datetime.datetime.now()
args = get_args()
scan_date = args.scan_date
config_file = args.config_file
destination = args.destination
lid_file_address = args.lid_address
uav_lettuce_address = args.uav_lettuce_address
bin2tiff_address = args.bin_2tif
gps_coord_file = args.gps_coord
repository_address = args.repository_address
settings.initialize_settings_HPC(scan_date,config_file,destination,lid_file_address,uav_lettuce_address,bin2tiff_address,gps_coord_file,repository_address)
main(scan_date)
end_time = datetime.datetime.now()
report_time(start_time,end_time)
sys.stdout = original