<commit_before>#!/usr/bin/python

import sys
sys.path.insert(0, "/usr/local/opencv-2.4.11/lib/python2.7/site-packages/")

import argparse
import commands
import cv2
import fnmatch
import os.path

sys.path.append('../lib')
import Pose
import ProjectMgr

# for all the images in the project image_dir, detect features using the
# specified method and parameters

parser = argparse.ArgumentParser(description='Set the aircraft poses from flight data.')
parser.add_argument('--project', required=True, help='project directory')
parser.add_argument('--sentera', help='use the specified sentera image-metadata.txt file')

args = parser.parse_args()

proj = ProjectMgr.ProjectMgr(args.project)
proj.load_image_info()

if args.sentera != None:
    Pose.setAircraftPoses(proj, args.sentera)

# compute the project's NED reference location (based on average of
# aircraft poses)
proj.compute_cart_reference_coord()
print "Cartesian reference location:", proj.cart_reference_coord

proj.save()
    <commit_msg>Warn if problem with pose calculations or pose data not provided.<commit_after>#!/usr/bin/python

import sys
sys.path.insert(0, "/usr/local/opencv-2.4.11/lib/python2.7/site-packages/")

import argparse
import commands
import cv2
import fnmatch
import os.path

sys.path.append('../lib')
import Pose
import ProjectMgr

# for all the images in the project image_dir, detect features using the
# specified method and parameters

parser = argparse.ArgumentParser(description='Set the aircraft poses from flight data.')
parser.add_argument('--project', required=True, help='project directory')
parser.add_argument('--sentera', help='use the specified sentera image-metadata.txt file')

args = parser.parse_args()

proj = ProjectMgr.ProjectMgr(args.project)
proj.load_image_info()

pose_set = False
if args.sentera != None:
    Pose.setAircraftPoses(proj, args.sentera)
    pose_set = True

if not pose_set:
    print "Error: no flight data specified or problem with flight data"
    print "No poses computed"
    exit

# compute the project's NED reference location (based on average of
# aircraft poses)
proj.compute_cart_reference_coord()
print "Cartesian reference location:", proj.cart_reference_coord

proj.save()
    
{'fraction_non_alphanumeric': 0.10424187725631769, 'fraction_numerical': 0.007220216606498195, 'mean_word_length': 5.158333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '797394', 'n_tokens_mistral': 682, 'n_tokens_neox': 667, 'n_words': 201}