Skip to content

Commit

Permalink
build: add read camera file and test
Browse files Browse the repository at this point in the history
  • Loading branch information
ACornuIGN committed Dec 22, 2023
1 parent 4f3bb7d commit 56121a3
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions pink_lady.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,39 @@
parser = argparse.ArgumentParser(description='photogrammetric site conversion'
+ ' and manipulation software')
parser.add_argument('-f', '--filepath',
type=str, default="", nargs=1,
type=str, default='', nargs=1,
help='File path of the workfile')
parser.add_argument('-skip', '--skip',
type=int, default=None, nargs=1,
help='Number of lines to be skipped before reading the file')
parser.add_argument('-w', '--writer',
type=str, choices=['opk'],
type=str, default='',
help='Worksite output file format')
parser.add_argument('-pr', '--pathreturn',
type=str, default="", nargs=1,
type=str, default='test/tmp/', nargs=1,
help='Conversion path ex:"test/tmp/"')
parser.add_argument('-c', '--camera',
type=list, default=[], nargs='*',
type=str, default='', nargs='*',
help='Files paths of cameras')

args = parser.parse_args()

# Readind data
if args.filepath[0] != "":
if args.filepath[0] != '':
work = reader_orientation(args.filepath[0], args.skip)
print("File reading done")
print("Orientation file reading done")
else:
print("The access road to the photogrammetric site is missing")

# Reading camera file
if args.camera != []:
if args.camera != '':
read_camera(args.camera, work)
print("Camera file reading done")

# Writing data
if args.pathreturn != "":
if args.writer != '':
try:
my_module = importlib.import_module("src.reader.reader_" + args.writer.lower())
my_module = importlib.import_module("src.writer.writer_" + args.writer.lower())
work = my_module.write(args.pathreturn, work)
except ModuleNotFoundError as e:
raise ValueError(f"{args.writer} file is not taken into account !!!") from e

0 comments on commit 56121a3

Please sign in to comment.