Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
junzis
GitHub Repository: junzis/openap
Path: blob/master/scripts/gen_engine_cruise_perf.py
592 views
1
import pandas as pd
2
3
df = pd.read_csv('input/civtfspec.csv')
4
5
df1 = df.iloc[:, [1,11,12,13,14]]
6
7
df1.columns = ['engine', 'cruise_thrust', 'cruise_sfc', 'cruise_mach', 'cruise_alt']
8
9
df1 = df1.dropna(subset=(['engine', 'cruise_thrust']))
10
11
# sfc: lb / hr / lbf -> kg / s / kN
12
# 1 -> 0.0283267
13
df1.cruise_sfc = (df1.cruise_sfc.astype(float) * 0.0283267).round(4)
14
15
# lbs -> N, 4.44822
16
df1.cruise_thrust = (df1.cruise_thrust.astype(float) * 4.44822).astype(int)
17
18
df1.loc[df1.engine=='CFM56-5A4', 'cruise_sfc'] = df1.loc[df1.engine=='CFM56-5A3', 'cruise_sfc']
19
df1.loc[df1.engine=='CFM56-5A5', 'cruise_sfc'] = df1.loc[df1.engine=='CFM56-5A3', 'cruise_sfc']
20
df1.loc[df1.engine=='CFM56-5B3', 'cruise_sfc'] = df1.loc[df1.engine=='CFM56-5B2', 'cruise_sfc']
21
df1.loc[df1.engine=='CFM56-7B18', 'cruise_sfc'] = df1.loc[df1.engine=='CFM56-7B20', 'cruise_sfc']
22
df1.loc[df1.engine=='CFM56-7B22', 'cruise_sfc'] = df1.loc[df1.engine=='CFM56-7B20', 'cruise_sfc']
23
df1.loc[df1.engine=='CFM56-7B26', 'cruise_sfc'] = df1.loc[df1.engine=='CFM56-7B20', 'cruise_sfc']
24
25
df1.to_csv('input/engine_cruise_performance.csv', index=False)
26
27