do things in the right loop

This commit is contained in:
Cal Wing 2024-08-29 00:51:59 +10:00
parent 29c11bab72
commit 0c6d48283a

52
main.py
View File

@ -218,7 +218,7 @@ def make_rpm_graph():
if __name__ == '__main__':
print("Generating RPM Graph")
#make_rpm_graph()
make_rpm_graph()
print("Generated")
print("Loading Data & Generating Pressure Graphs")
@ -318,34 +318,34 @@ if __name__ == '__main__':
makeGraph(graph, False, figSavePath="./images/pressure/__{0}.png")
if True:
aoa = [a[-2] for a in cp_pain_data][1::2]
forces = [a[-1] for a in cp_pain_data][1::2]
# Force Graphs
graph = {
"title": f"All Total, Lift & Drag Forces\nfor a Clark Y 14% Aerofoil at:\n{raw_data["rpm"]:d}rpm - {raw_data["airSpeed"]:.1f}m/s)",
"windowTitle": f"All Total, Lift and Drag Forces for a Clark Y 14 Percent Airfoil - {raw_data["rpm"]:d}rpm - {raw_data["airSpeed"]:.1f}m_s",
"xLabel": "Attack Angle [$\\alpha$]",
"yLabel": "Force [N]",
"grid": True,
"ledgLoc": 1,
"plots": [
{"x":aoa, "y":[f[0] for f in forces], "label":"Total Force"},
{"x":aoa, "y":[f[1] for f in forces], "label":"Lift"},
{"x":aoa, "y":[f[2] for f in forces], "label":"Drag"},
]
}
if True:
aoa = [a[-2] for a in cp_pain_data][1::2]
forces = [a[-1] for a in cp_pain_data][1::2]
# Force Graphs
graph = {
"title": f"All Total, Lift & Drag Forces\nfor a Clark Y 14% Aerofoil at:\n{raw_data["rpm"]:d}rpm - {raw_data["airSpeed"]:.1f}m/s)",
"windowTitle": f"All Total, Lift and Drag Forces for a Clark Y 14 Percent Airfoil - {raw_data["rpm"]:d}rpm - {raw_data["airSpeed"]:.1f}m_s",
"xLabel": "Attack Angle [$\\alpha$]",
"yLabel": "Force [N]",
"grid": True,
"ledgLoc": 1,
"plots": [
{"x":aoa, "y":[f[0] for f in forces], "label":"Total Force"},
{"x":aoa, "y":[f[1] for f in forces], "label":"Lift"},
{"x":aoa, "y":[f[2] for f in forces], "label":"Drag"},
]
}
makeGraph(graph, False, figSavePath="./images/{0}.png", closeFig=True)
makeGraph(graph, False, figSavePath="./images/{0}.png", closeFig=True)
print("\n\n")
print(raw_data["rpm"])
print("AoA Total Lift Drag ---- Upper Force Lower Force ")
for aoa, force in [(a[-2], a[-1]) for a in cp_pain_data]:
print(f"{aoa:d}\\textdegree & {force[0]:.3f} & {force[1]:.3f} & {force[2]:.3f} -- {force[4]:.3f} {force[5]:.3f} \\\\")
print("-"*50)
print("\n\n")
print("\n\n")
print(raw_data["rpm"])
print("AoA Total Lift Drag ---- Upper Force Lower Force ")
for aoa, force in [(a[-2], a[-1]) for a in cp_pain_data]:
print(f"{aoa:d}\\textdegree & {force[0]:.3f} & {force[1]:.3f} & {force[2]:.3f} -- {force[4]:.3f} {force[5]:.3f} \\\\")
print("-"*50)
print("\n\n")
print("Generating Cp Graphs")