swap f string notation for python 3.10 compat
This commit is contained in:
parent
97669563d7
commit
cf2c826226
18
main.py
18
main.py
@ -95,16 +95,26 @@ def process_data(gData):
|
|||||||
scope_time =- np.timedelta64(trigger_info["alignment-offset"], 'ns')
|
scope_time =- np.timedelta64(trigger_info["alignment-offset"], 'ns')
|
||||||
scope_time =+ np.timedelta64(trigger_info["delay"], 'us')
|
scope_time =+ np.timedelta64(trigger_info["delay"], 'us')
|
||||||
|
|
||||||
|
#start_time = np.datetime64(f"{gData["info"]["date"]}T{gData["info"]["time"]}")
|
||||||
|
|
||||||
|
start_time = 0
|
||||||
|
x2_timesteps = np.array([0 for _ in x2_time])
|
||||||
|
|
||||||
|
for i, dt in enumerate(x2_time):
|
||||||
|
dt = dt.astype("int")
|
||||||
|
if i == 0:
|
||||||
|
x2_timesteps[i] = start_time + dt # should be 0
|
||||||
|
else:
|
||||||
|
x2_timesteps[i] = x2_timesteps[i-1] + dt
|
||||||
|
|
||||||
return x2_time, scope_time
|
return x2_time, scope_time, x2_timesteps
|
||||||
|
|
||||||
|
|
||||||
def genGraph(gData):
|
def genGraph(gData):
|
||||||
x2_time, scope_time = process_data(gData)
|
x2_time, scope_time = process_data(gData)
|
||||||
|
|
||||||
graphData = {
|
graphData = {
|
||||||
"title": f"Shock response Time\nFor {gData["info"]["long_name"]}",
|
"title": f"Shock response Time\nFor {gData['info']['long_name']}",
|
||||||
"xLabel": "Time (ns)",
|
"xLabel": "Time (ns)",
|
||||||
"yLabel": "Voltage Reading (V)",
|
"yLabel": "Voltage Reading (V)",
|
||||||
"grid": True,
|
"grid": True,
|
||||||
@ -148,9 +158,9 @@ def genGraph(gData):
|
|||||||
|
|
||||||
|
|
||||||
gData = data[loaded_data[0]]
|
gData = data[loaded_data[0]]
|
||||||
x2_time, scope_time = process_data(gData)
|
x2_time, scope_time, x2_timestamps = process_data(gData)
|
||||||
|
|
||||||
x2_out = canny_shock_finder(x2_time, (gData["x2"][4][:] - gData["x2"][4][0]) * 0.0148, plot=False)
|
x2_out = canny_shock_finder(x2_timestamps, (gData["x2"][4][:] - gData["x2"][4][0]) * 0.0148)
|
||||||
|
|
||||||
print(x2_out)
|
print(x2_out)
|
||||||
input("foo")
|
input("foo")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user