forked from catawbasam/asias_fds_shared
-
Notifications
You must be signed in to change notification settings - Fork 0
/
simple_flight_sets.py
121 lines (100 loc) · 5.3 KB
/
simple_flight_sets.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# -*- coding: utf-8 -*-
"""
simple_flight_sets : small sets of flights for testing profiles
file repository 'local' assumes you have 7/13 files on your local drive.
file repository 'central' is on //serrano/foqa_evolution
Created on Sat Aug 10 16:19:48 2013
@author: KEITHC
"""
import glob
import os
import pandas as pd
import analyser_custom_settings as settings
import fds_oracle # db connection
def _flight_list(files_to_process, aircraft_info, repo):
flight_list=[]
for f in files_to_process:
flt={'filepath':f, 'aircraft_info':aircraft_info, 'repo':repo}
flight_list.append(flt)
return flight_list
def _flight_set_dataframe(files_to_process, aircraft_info, repo):
flight_set = pd.DataFrame({'filepath': files_to_process })
flight_set['repo']=repo
flight_set['aircraft_info']=[{'Frame': 'B737-300_specimen', 'Manufacturer': 'Boeing', 'Precise Positioning': True, 'Series': 'B737-300', 'Family': 'B737', 'Frame Doubled': False} for f in files_to_process]
return flight_set
def ffd897():
'''quick test set'''
input_dir = settings.FFD_PATH + 'ffd40/'
print input_dir
files_to_process = glob.glob(os.path.join(input_dir, '*.ffd'))
repo='keith'
aircraft_info = {'Frame':'FFD', 'Manufacturer':'Bombardier', 'Precise Positioning':True, 'Series': 'CRJ 700', 'Frame Doubled':False}
return _flight_list(files_to_process, aircraft_info, repo)
def specimen_flight():
'''FDS Specimen Flight, a partial 737-300 64wps frame'''
input_dir = settings.BASE_DATA_PATH + 'specimen_flight/'
print input_dir
files_to_process = glob.glob(os.path.join(input_dir, '*.hdf5'))
print files_to_process
repo='local'
aircraft_info = {'Frame': 'B737-300_specimen', 'Manufacturer': 'Boeing', 'Precise Positioning': True, 'Series': 'B737-300', 'Family': 'B737', 'Frame Doubled': False}
return _flight_list(files_to_process, aircraft_info, repo)
def tiny_test():
'''quick test set'''
input_dir = settings.BASE_DATA_PATH + 'tiny_test/'
print input_dir
files_to_process = glob.glob(os.path.join(input_dir, '*.hdf5'))
repo='local'
aircraft_info={'Frame': 'A320_SFIM_ED45_CFM', 'Manufacturer': 'Airbus', 'Precise Positioning': True, 'Series': 'A320-200', 'Family': 'A320', 'Frame Doubled': False}
return _flight_list(files_to_process, aircraft_info, repo)
def test10_shared():
'''quick test set on serrano shared storage'''
input_dir = 'Y:/asias_fds/base_data/test10/'
print input_dir
files_to_process = glob.glob(os.path.join(input_dir, '*.hdf5'))
repo='serrano'
aircraft_info={'Frame': 'A320_SFIM_ED45_CFM', 'Manufacturer': 'Airbus', 'Precise Positioning': True, 'Series': 'A320-200', 'Family': 'A320', 'Frame Doubled': False}
return _flight_list(files_to_process, aircraft_info, repo)
def test10():
'''quick test set'''
input_dir = settings.BASE_DATA_PATH + 'test10/'
print input_dir
files_to_process = glob.glob(os.path.join(input_dir, '*.hdf5'))
repo='local'
aircraft_info={'Frame': 'A320_SFIM_ED45_CFM', 'Manufacturer': 'Airbus', 'Precise Positioning': True, 'Series': 'A320-200', 'Family': 'A320', 'Frame Doubled': False}
return _flight_list(files_to_process, aircraft_info, repo)
def test_sql_jfk():
'''sample test set based on query from Oracle fds_flight_record'''
query = """select distinct file_path from fds_flight_record
where
file_repository='central'
and orig_icao='KJFK' and dest_icao in ('KFLL','KMCO' )
--and rownum<15
"""
files_to_process = fds_oracle.flight_record_filepaths(query)[:40]
repo='central'
aircraft_info={'Frame': 'A320_SFIM_ED45_CFM', 'Manufacturer': 'Airbus', 'Precise Positioning': True, 'Series': 'A320-200', 'Family': 'A320', 'Frame Doubled': False}
return _flight_list(files_to_process, aircraft_info, repo)
def test_sql_jfk_local():
'''sample test set based on query from Oracle fds_flight_record'''
repo='local'
query = """select distinct file_path from fds_flight_record
where
file_repository='REPO'
and orig_icao='KJFK' and dest_icao in ('KFLL','KMCO' )
--and rownum<15
""".replace('REPO',repo)
files_to_process = fds_oracle.flight_record_filepaths(query)[:40]
aircraft_info={'Frame': 'A320_SFIM_ED45_CFM', 'Manufacturer': 'Airbus', 'Precise Positioning': True, 'Series': 'A320-200', 'Family': 'A320', 'Frame Doubled': False}
return _flight_list(files_to_process, aircraft_info, repo)
def fll_local():
'''sample test set based on query from Oracle fds_flight_record'''
repo='local'
query = """select distinct file_path from fds_flight_record
where
file_repository='REPO'
and dest_icao in ('KFLL')
""".replace('REPO',repo)
files_to_process = fds_oracle.flight_record_filepaths(query) #[:40]
aircraft_info={'Frame': 'A320_SFIM_ED45_CFM', 'Manufacturer': 'Airbus', 'Precise Positioning': True, 'Series': 'A320-200', 'Family': 'A320', 'Frame Doubled': False}
return _flight_list(files_to_process, aircraft_info, repo)