Use mean uncert not sqrt(sum)

This commit is contained in:
Cal Wing 2024-10-23 14:07:12 +10:00
parent 9570111f61
commit 313ef7d1de

View File

@ -664,7 +664,7 @@ def genGraph(gData: dict, showPlot: bool = True, doLimits: bool = True, forcePlo
if not flag and not gData["shock-speed"][shock_speed_loc][2]:
flag = True
avg_speed = np.array(avg_speed_lst).mean()
avg_uncert = np.sqrt(np.sum(np.pow(np.array(avg_uncert_lst), 2)))
avg_uncert = np.array(avg_uncert_lst).mean() # np.sqrt(np.sum(np.pow(np.array(avg_uncert_lst), 2)))
probeText += f"\nAverage Speed - {avg_speed/1000:.2f} $\\pm${avg_uncert/1000:.2f} [{avg_uncert/avg_speed * 100:.2f}%] km/s"
probeText += "\n" + "-"*50
@ -732,7 +732,7 @@ def genRefGraph(gData: dict, showPlot: bool = True, addShockInfo: bool = True, f
if not flag and not gData["shock-speed"][shock_speed_loc][2]:
flag = True
avg_speed = np.array(avg_speed_lst).mean()
avg_uncert = np.sqrt(np.sum(np.pow(np.array(avg_uncert_lst), 2)))
avg_uncert = np.array(avg_uncert_lst).mean() # np.sqrt(np.sum(np.pow(np.array(avg_uncert_lst), 2)))
probeText += f"\nAverage Speed - {avg_speed/1000:.2f} $\\pm${avg_uncert/1000:.2f} [{avg_uncert/avg_speed * 100:.2f}%] km/s"
probeText += "\n" + "-"*50
@ -855,7 +855,7 @@ def genComboRefGraph(data: dict, plotCh: list[str] = ["st1", "st2", "st3"], show
probeText += f"\n{shock_speed_loc} - {speed/1000:.2f} $\\pm${uncert/1000:.2f} [{uncert/speed*100:.2f}%] km/s"
avg_sp = np.array(avg_speeds).mean()
avg_unc = np.sqrt(np.pow(np.array(avg_uncerts), 2).sum())
avg_unc = np.array(avg_uncerts).mean() #np.sqrt(np.pow(np.array(avg_uncerts), 2).sum())
probeText += f"\nAverage Speed - {avg_sp/1000:.2f} $\\pm${avg_unc/1000:.2f} [{avg_unc/avg_sp * 100:.2f}%] km/s"
graphData["plots"].append({