Comments
This commit is contained in:
parent
34555f18c6
commit
0d8fb8939e
28
Format description.md
Normal file
28
Format description.md
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
# Format for CRZ PERF tables
|
||||||
|
|
||||||
|
Columns delimited with ;
|
||||||
|
|
||||||
|
First column is altitude
|
||||||
|
|
||||||
|
Second column is FF per engine in kg/hr
|
||||||
|
- Column contains values for weights ranging from 140t to 290t in 10t increments
|
||||||
|
- Delimited with ,
|
||||||
|
|
||||||
|
Third column is IAS
|
||||||
|
- If single value, apply to all weights
|
||||||
|
- If multiple values, apply to respective weights (delimited with ,)
|
||||||
|
-
|
||||||
|
Fourth column is MACH
|
||||||
|
- If single value, apply to all weights
|
||||||
|
- If multiple values, apply to respective weights (delimited with ,)
|
||||||
|
|
||||||
|
# Format for ECON tables
|
||||||
|
2d matrix of mach values
|
||||||
|
|
||||||
|
One file per altitude
|
||||||
|
|
||||||
|
First index is FL
|
||||||
|
- Must be of 140, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270, 280, or 290
|
||||||
|
|
||||||
|
Second index is CI
|
||||||
|
- Must be in range [0, 999]
|
||||||
@ -1,49 +0,0 @@
|
|||||||
Columns delimited with ;
|
|
||||||
First column is altitude
|
|
||||||
Second column is FF per engine in kg/hr
|
|
||||||
Column contains values for weights ranging from 140t to 290t in 10t increments
|
|
||||||
Delimited with ,
|
|
||||||
Third column is IAS
|
|
||||||
If single value, apply to all weights
|
|
||||||
If multiple values, apply to respective weights (delimited with ,)
|
|
||||||
Fourth column is MACH
|
|
||||||
If single value, apply to all weights
|
|
||||||
If multiple values, apply to respective weights (delimited with ,)
|
|
||||||
|
|
||||||
|
|
||||||
Parser in Python
|
|
||||||
split() -> split string into array at given delimiter
|
|
||||||
strip() -> remove whitespaces at start and end of string
|
|
||||||
|
|
||||||
|
|
||||||
matrix = {}
|
|
||||||
|
|
||||||
def parseFile(file):
|
|
||||||
weights = [140, 150, 160, 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270, 280, 290]
|
|
||||||
matrix = {}
|
|
||||||
file = open(file, 'r')
|
|
||||||
lines = file.readlines()
|
|
||||||
|
|
||||||
count = 0
|
|
||||||
for line in lines:
|
|
||||||
count += 1
|
|
||||||
if count == 1:
|
|
||||||
continue
|
|
||||||
fields = line.split(";")
|
|
||||||
alt = int(fields[0]) / 100
|
|
||||||
ff = [int(item.strip()) for item in fields[1].split(",")]
|
|
||||||
ias = [int(item.strip()) for item in fields[2].split(",")]
|
|
||||||
mach = [float(item.strip()) for item in fields[3].split(",")]
|
|
||||||
|
|
||||||
inner = {}
|
|
||||||
for i in range(len(ff)):
|
|
||||||
_ias = ias[i] if len(ias) > 1 else ias[0]
|
|
||||||
_mach = mach[i] if len(mach) > 1 else mach[0]
|
|
||||||
inner[weights[i]] = (ff[i], _ias, _mach)
|
|
||||||
matrix[alt] = inner
|
|
||||||
return matrix
|
|
||||||
|
|
||||||
matrix["LRC"] = parseFile("LRC.data")
|
|
||||||
matrix[82] = parseFile(".82.data")
|
|
||||||
matrix[83] = parseFile(".83.data")
|
|
||||||
matrix[84] = parseFile(".84.data")
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user