Compare commits

...

3 Commits

Author SHA1 Message Date
Cal Wing
7d6b3403f5 Make nice canning graph 2024-10-23 14:20:57 +10:00
Cal Wing
313ef7d1de Use mean uncert not sqrt(sum) 2024-10-23 14:07:12 +10:00
Cal Wing
9570111f61 Correct the shot numbers 2024-10-23 14:03:01 +10:00
5 changed files with 16 additions and 8 deletions

View File

@ -360,6 +360,9 @@ def canny_shock_finder(time_list, pressure_list, sigma = 4, derivative_threshold
data_ax.plot(time_list*plot_time_scale, pressure_list, '-o', label = 'original data')
data_ax.grid(True)
convolution_ax.grid(True)
convolution_ax.plot(time_list*plot_time_scale, first_order_data, '-o', label='first order gaussian (sigma = {0})'.format(sigma))
convolution_ax.plot(time_list*plot_time_scale, second_order_data, '-o', label='second order gaussian (sigma = {0})'.format(sigma))
convolution_ax.plot(time_list*plot_time_scale, suppressed_data, '-o', label='first order with non-max suppression')

View File

@ -1,7 +1,7 @@
# Data Info File
# Cal Wing - Oct 24
long_name: "Shot 5 (x2s5829) - Thin Probe Pair (ST2 & ST3) - 2024-10-17\nProtruding ST2 & ST3 - Mars Entry Conditions"
long_name: "Shot 5 (x2s5830) - Thin Probe Pair (ST2 & ST3) - 2024-10-17\nProtruding ST2 & ST3 - Mars Entry Conditions"
name: "Shot 5"
date: "2024-10-18"
time: "08:51"

View File

@ -1,7 +1,7 @@
# Data Info File
# Cal Wing - Oct 24
long_name: "Shot 6 (x2s5829) - Thin Probe Set (ST1, ST2 & ST3) - 2024-10-18\nProtruding ST1 & ST3, Flush ST2 (Only Gauge 1) - Mars Entry Conditions"
long_name: "Shot 6 (x2s5831) - Thin Probe Set (ST1, ST2 & ST3) - 2024-10-18\nProtruding ST1 & ST3, Flush ST2 (Only Gauge 1) - Mars Entry Conditions"
comments: "G2 Pointless, Wasn't attached"
name: "Shot 6"
date: "2024-10-18"

View File

@ -1,7 +1,7 @@
# Data Info File
# Cal Wing - Oct 24
long_name: "Shot 7 (x2s5829) - Thin Probe Set (ST1, ST2 & ST3) - 2024-10-18\nProtruding ST1 & ST1, Flush ST3 (Only Gauge 1) - Low Pressure, 'Pure' Air Conditions"
long_name: "Shot 7 (x2s5832) - Thin Probe Set (ST1, ST2 & ST3) - 2024-10-18\nProtruding ST1 & ST1, Flush ST3 (Only Gauge 1) - Low Pressure, 'Pure' Air Conditions"
name: "Shot 7"
date: "2024-10-18"
time: "15:58"

15
main.py
View File

@ -319,7 +319,12 @@ def load_data(data_path: str, data={}) -> dict:
for i, probe in enumerate(dataInfo["probe-info"]["locations"]):
# Get the canny-args
cArgs = dataInfo["canny-args"]
doCannyPlot = False
doCannyPlot = x2_shot == "x2s5829" and probe == "st2" and False
plotValues = {
"plot_title": f"Canny Shock Finding Result for {x2_shot} - ST1 Gauge 1",
"plot_time_unit": "$\\mu$s",
"y_label": "Voltage Reading (V)",
}
if i in range(len(cArgs)):
sigma = cArgs[i]["sigma"]
post_sup_thresh = cArgs[i]["post_pres"]
@ -336,7 +341,7 @@ def load_data(data_path: str, data={}) -> dict:
# Find G1 Shock Time
if 1 in dataInfo["probe-info"]["gauges"]:
first_value, first_value_uncertainty, _, _ = canny_shock_finder(scope_time, probeCh1, sigma=sigma, post_suppression_threshold=post_sup_thresh, plot=doCannyPlot, start_time=time_offset, print_func=None)
first_value, first_value_uncertainty, _, _ = canny_shock_finder(scope_time, probeCh1, sigma=sigma, post_suppression_threshold=post_sup_thresh, plot=doCannyPlot, start_time=time_offset, print_func=None, **plotValues)
if first_value is None:
print(f"[ERROR] {x2_shot} - {probe}-g1 could not be detected using: Sigma = {sigma}, post_suppression_threshold = {post_sup_thresh}")
raise ValueError(f"{probe}-g1 not detected")
@ -664,7 +669,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 +737,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 +860,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({