Make nice canning graph
This commit is contained in:
parent
313ef7d1de
commit
7d6b3403f5
@ -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')
|
||||
|
9
main.py
9
main.py
@ -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")
|
||||
|
Loading…
x
Reference in New Issue
Block a user