Compare commits
No commits in common. "c5f24cb0bf794b48cc637d9bcb90d4926e592aeb" and "1b6b598fa46d9c47546ad6f967057288e9496220" have entirely different histories.
c5f24cb0bf
...
1b6b598fa4
@ -25,9 +25,6 @@ canny-args:
|
||||
pcb-refs:
|
||||
- "st1"
|
||||
|
||||
no-graph:
|
||||
- "None"
|
||||
|
||||
probe-info:
|
||||
type: "Thin"
|
||||
locations: # In order of pulse
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Data Info File
|
||||
# Cal Wing - Oct 24
|
||||
|
||||
long_name: "Shot 6 (x2s5829) - Thin Probe (ST1, ST2 & ST3) - 2024-10-18 - Flush ST2"
|
||||
long_name: "Shot 6 (x2s5829) - Thin Probe Pair (ST1, ST2 & ST3) - 2024-10-18"
|
||||
name: "Shot 6"
|
||||
date: "2024-10-18"
|
||||
time: "14:00"
|
||||
@ -18,7 +18,7 @@ canny-args:
|
||||
post_pres: 0.03
|
||||
|
||||
- sigma: 1
|
||||
post_pres: 0.05
|
||||
post_pres: 0.2
|
||||
|
||||
no-graph:
|
||||
- "at1"
|
||||
@ -30,6 +30,8 @@ no-graph:
|
||||
- "at6"
|
||||
|
||||
pcb-refs:
|
||||
- "st1"
|
||||
|
||||
- "at1"
|
||||
- "at2"
|
||||
- "at3"
|
||||
@ -43,7 +45,6 @@ probe-info:
|
||||
gauges:
|
||||
- 1
|
||||
locations: # In order of pulse
|
||||
- "st1"
|
||||
- "st2"
|
||||
- "st3"
|
||||
overhang: 1 # mm
|
||||
|
@ -1,69 +0,0 @@
|
||||
# Data Info File
|
||||
# Cal Wing - Oct 24
|
||||
|
||||
long_name: "Shot 7 (x2s5829) - Thin Probe Set (ST1, ST2 & ST3) - 2024-10-18\nFlush ST3 - Low Pressure, 'Pure' Air"
|
||||
name: "Shot 6"
|
||||
date: "2024-10-18"
|
||||
time: "15:58"
|
||||
|
||||
shot-info:
|
||||
name: "x2s5832"
|
||||
tdms: "{0}.tdms"
|
||||
config: "{0}.config"
|
||||
info: "{0}.txt"
|
||||
|
||||
# Canny Args
|
||||
canny-args:
|
||||
- sigma: 2
|
||||
post_pres: 0.03
|
||||
|
||||
- sigma: 1
|
||||
post_pres: 0.2
|
||||
|
||||
- sigma: 1
|
||||
post_pres: 0.05
|
||||
|
||||
no-graph:
|
||||
- "None"
|
||||
# - "at1"
|
||||
# - "at2"
|
||||
# - "at3"
|
||||
|
||||
# - "at4"
|
||||
# - "at5"
|
||||
# - "at6"
|
||||
|
||||
pcb-refs:
|
||||
- "at1"
|
||||
- "at2"
|
||||
- "at3"
|
||||
|
||||
- "at4"
|
||||
- "at5"
|
||||
- "at6"
|
||||
|
||||
probe-info:
|
||||
type: "Thin"
|
||||
gauges:
|
||||
- 1
|
||||
locations: # In order of pulse
|
||||
- "st1"
|
||||
- "st2"
|
||||
- "st3"
|
||||
overhang: 1 # mm
|
||||
c2c: 5.6 # mm
|
||||
gauge-diam: 0.8 # mm
|
||||
gauge-c2c: 1.8 #mm
|
||||
|
||||
data-records:
|
||||
- type: "scope"
|
||||
config: "eProbe-Scope.txt"
|
||||
data: "eProbe-Scope.csv"
|
||||
|
||||
trigger: # Redundant?
|
||||
type: "channel"
|
||||
channel: 4
|
||||
alignment-offset: 0 # 601 # us [TODO] Make this auto-magic
|
||||
delay: 100 # us
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,18 +0,0 @@
|
||||
ANALOG
|
||||
Ch 1 Scale 500mV/, Pos 862.50mV, Coup DC, BW Limit Off, Inv Off, Imp 1M Ohm
|
||||
Probe 1.0000000 : 1, Skew 0.0s
|
||||
Ch 2 Scale 500mV/, Pos 1.00000V, Coup DC, BW Limit Off, Inv Off, Imp 1M Ohm
|
||||
Probe 10.000000 : 1, Skew 0.0s
|
||||
Ch 4 Scale 1.00V/, Pos 2.85000V, Coup DC, BW Limit Off, Inv Off, Imp 1M Ohm
|
||||
Probe 1.0000000 : 1, Skew 0.0s
|
||||
|
||||
TRIGGER
|
||||
Sweep Mode Auto, Coup DC, Noise Rej Off, HF Rej Off, Holdoff 40.0ns
|
||||
Mode Edge, Source Ch 4, Slope Rising, Level 1.00000V
|
||||
|
||||
HORIZONTAL
|
||||
Mode Normal, Ref Center, Main Scale 500.0us/, Main Delay -1.500000000ms
|
||||
|
||||
ACQUISITION
|
||||
Mode High Res, Realtime On, Vectors On, Persistence Off
|
||||
|
Binary file not shown.
@ -1,49 +0,0 @@
|
||||
# x2s5832 config file
|
||||
# This files contains a text version of the National Instruments PXI unit configuration data.
|
||||
# Channels are represented as one line per configured signal with tab-separated values.
|
||||
#
|
||||
# Line content and types of values (first item is item 0):
|
||||
# i item type comments
|
||||
# --------------------------------------------------------------------------------------------------------
|
||||
# 0 signal name string
|
||||
# 1 channel ID string legacy I/O channel designation
|
||||
# 2 external gain float 1 if there is no external amplifier connected
|
||||
# 3 sensitivity float volts per measured unit (of the transducer)
|
||||
# 4 units string name of units for physical quantity (e.g. kPa)
|
||||
# 5 position float position of transducer (in mm)
|
||||
# 6 serial number string transducer identity
|
||||
# 7 PXI channel ID string non-legacy channel ID and trigger source
|
||||
#---------------------------------------------------------------------------------------------------------
|
||||
|
||||
sd1 2 0 9 1 9.500000E-4 kPa 0.000 112A24-9609 PXI1Slot2/ai0
|
||||
sd2 2 1 9 1 9.500000E-4 kPa 0.000 113A22-9535 PXI1Slot2/ai1
|
||||
sd3 2 3 9 1 6.820000E-4 kPa 0.000 112A24-2676 PXI1Slot2/ai3
|
||||
st1 2 4 9 1 1.000000E+0 V 0.000 gauge-set-1 PXI1Slot2/ai4
|
||||
st2 5 4 9 1 1.168700E-2 kPa 0.000 112A22-35070 PXI1Slot5/ai4
|
||||
st3 2 6 9 1 1.000000E+1 V 0.000 gauge-set-2 PXI1Slot2/ai6
|
||||
at1 3 0 9 1 1.443000E-2 kPa 0.000 112A22-35098 PXI1Slot3/ai0
|
||||
at2 3 1 9 1 1.450000E-2 kPa 0.000 112A22-9050 PXI1Slot3/ai1
|
||||
at3 3 2 9 1 1.447980E-2 kPa 0.000 112A22-19124 PXI1Slot3/ai2
|
||||
at4 3 3 9 1 1.435000E-2 kPa 0.000 112A22-34424 PXI1Slot3/ai3
|
||||
at5 3 4 9 1 1.447000E-2 kPa 0.000 112A22-34425 PXI1Slot3/ai4
|
||||
at6 3 5 9 1 1.442000E-2 kPa 0.000 112A22-34426 PXI1Slot3/ai5
|
||||
at7 2 7 9 1 1.451000E-2 kPa 0.000 112A22-35096 PXI1Slot2/ai7
|
||||
at8 3 7 9 1 1.490000E-2 kPa 0.000 112A22-35079 PXI1Slot3/ai7
|
||||
pimax4 5 1 9 1 1.000000E-3 mV 0.000 pimax4 PXI1Slot5/ai1
|
||||
trigbox 5 7 9 1 1.000000E-3 mV 0.000 trigbox PXI1Slot5/ai7(Trigger)
|
||||
trigbox_delay 5 5 9 1 1.000000E-3 mV 0.000 trigbox_delay PXI1Slot5/ai5
|
||||
pt1 5 2 9 1 8.500000E-4 kPa 0.000 SN-22554 PXI1Slot5/ai2
|
||||
irc800 8 4 9 1 1.000000E-3 mV 0.000 irc800 PXI1Slot8/ai4
|
||||
shimadzu 8 6 9 1 1.000000E-3 mV 0.000 shimadzu PXI1Slot8/ai6
|
||||
pimax3 8 7 9 1 1.000000E-3 mV 0.000 pimax3 PXI1Slot8/ai7
|
||||
Phantom 8 2 9 1 1.000000E-3 mV 0.000 phantom PXI1Slot8/ai2
|
||||
pt2 6 1 9 1 1.440000E-3 kPa 0.000 SN 22556 PXI1Slot6/ai1
|
||||
pt3 6 2 9 1 1.810000E-3 kPa 0.000 SN 7446 PXI1Slot6/ai2
|
||||
pt4 6 3 9 1 7.300000E-4 kPa 0.000 SN LW30649 PXI1Slot6/ai3
|
||||
pt5 8 3 9 1 7.350000E-4 kPa 0.000 SN LW30651 PXI1Slot8/ai3
|
||||
pt6 6 5 9 1 7.290000E-4 kPa 0.000 SN LW30652 PXI1Slot6/ai5
|
||||
pt7 6 6 9 1 7.220000E-4 kPa 0.000 SN 22514 PXI1Slot6/ai6
|
||||
pt8 3 6 9 1 1.430000E-3 kPa 0.000 SN 16785 PXI1Slot3/ai6
|
||||
pt9 5 0 9 1 1.010000E-3 kPa 0.000 SN 7430 PXI1Slot5/ai0
|
||||
photodiode 8 0 9 1 1.000000E+0 mV 0.000 photodiode PXI1Slot8/ai0
|
||||
phantom_aperture 4 4 9 1 1.000000E-3 mV 0.000 phantom_aperture PXI1Slot4/ai4
|
20024
data/x2s5832/x2s5832.lvm
20024
data/x2s5832/x2s5832.lvm
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
@ -1,161 +0,0 @@
|
||||
--------------------------------------------------------------------------------
|
||||
Project.........................................steve apirana air condiion for Cal Wing
|
||||
Run number................................ x2s5832
|
||||
Date............................................18/10/2024
|
||||
Blame...........................................Mragank, Aaron
|
||||
Condition................................... Mars condition, high density, Mars mixture
|
||||
Reservoir..................................... 6.75 MPa
|
||||
Driver............................................74240 Pa 80% He, 92.8 kPa Argon
|
||||
Primary diaphragm.................... 2 mm scored, cold rolled steel 6U374
|
||||
Shock tube................................... Pa aero air
|
||||
Secondary diaphragm................ 2 micron mylar
|
||||
Acceleration tube....................... 2 Pa lab air (set on new gauge on the bottom of the dump tank)
|
||||
Trig.............................................. Pt5 (changed as wedge is ahead of pitot probes) slot8ai3 on tee piece 8ai4 - cable pt5
|
||||
Lab environment...................... N/A
|
||||
Driver Condition........................x2-lwp-2.0-90-0
|
||||
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
EXPERIMENT SETUP
|
||||
|
||||
pitot rake
|
||||
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
EQUIPMENT
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
1x photodiode (350 - 1100nm)
|
||||
1xShimadzu -- in use
|
||||
1xmini-spec (200-1000nm)
|
||||
Phantom
|
||||
|
||||
|
||||
|
||||
-------------------------- SUSS Spectral Overview ----------------------------
|
||||
--------------------------------------------------------------------------------
|
||||
Dichroic 1 (UV/VIS): DMLP650L
|
||||
Dichroic 2 (VIS/IR): DMLP900L
|
||||
UV FOV: 8mm
|
||||
VIS FOV: 8mm
|
||||
IR FOV: 8mm
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
---UV---
|
||||
--------------------------------------------------------------------------------
|
||||
N/A
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
---Visible---
|
||||
--------------------------------------------------------------------------------
|
||||
Spectrometer: Acton Spectrapro 2300i
|
||||
Centre Wavelength: 775
|
||||
Grating: 150
|
||||
Camera: PIMAX4
|
||||
Gain: 50
|
||||
Delay: 80 us
|
||||
Exposure: 50 us
|
||||
Trigger level: 1V
|
||||
Slit: 100 um
|
||||
Filter:
|
||||
Trigger: A3 cable from trigger box port 0
|
||||
Monitor: T1 Cable
|
||||
Aperture: 12.5 mm
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
---IR---
|
||||
--------------------------------------------------------------------------------
|
||||
Spectrometer: Acton Spectrapro 2500
|
||||
Centre Wavelength: 1300
|
||||
Grating: 75
|
||||
Camera: IRC800
|
||||
Delay: 100us setted in DAQ with 800 counts
|
||||
Exposure: 20 us
|
||||
Slit: 1000 um
|
||||
Filter:
|
||||
Trigger: T2 cable from trigger box port1
|
||||
Monitor: PDTP1G Cable
|
||||
Aperture: 12.5 mm
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
Shimadzu
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Window : BK7 Diam 209mm top
|
||||
Lens: Nikon AF Micro NIKKOR 200MM with 780-unknown? filter
|
||||
Aperture-Number 16
|
||||
Frame Rates 500.000 kFPS
|
||||
Exposure: 1/2
|
||||
Gain: x2(/x50)
|
||||
Mode: External
|
||||
Trigger @: 0/0 (0-99=100frames)
|
||||
point: 10
|
||||
Delay: 0 microseconds
|
||||
Polarity: Pos
|
||||
Monitor Expose: off
|
||||
Filter:
|
||||
Cables: Trigger: H6 cable from trigger box port 1
|
||||
Monitor: H4 Cable
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
PHOTODIODE
|
||||
--------------------------------------------------------------------------------
|
||||
Location: Circle around stagnation point, pt5.
|
||||
Filter: 777nm hydrogen filter actually. not sure which one...
|
||||
Model number: (350-1100)
|
||||
Lens: Unknown
|
||||
Gain: 70
|
||||
Fibre optic cable: Red
|
||||
Aperture: None
|
||||
BNC: A4
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
MINI-SPEC (200 - 1000nm)
|
||||
--------------------------------------------------------------------------------
|
||||
Location: Pt5 looking out into the flow
|
||||
Filter: none
|
||||
Window: 3mm fused silica from OGP optics.
|
||||
Cable: New red cable
|
||||
Lens: N/A
|
||||
Delay: 80 us + 8 us internal
|
||||
Integration time: 20 us
|
||||
Aperture: N/A
|
||||
Trigger level: 1 V
|
||||
Filter: N/A
|
||||
Trigger: A5 cable from trigger box port 0, with vis
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
Phantom
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Window : side
|
||||
Lens: Nikon AF Micro NIKKOR 105 mm focus
|
||||
Aperture-Number 11
|
||||
Frame Rates 110000.000 FPS
|
||||
Exposure: 1 us
|
||||
Gain: N/A
|
||||
Mode: External
|
||||
Delay: 0 microseconds
|
||||
Polarity: Pos
|
||||
Monitor Expose: off
|
||||
Filter:
|
||||
Cables: Trigger: B3 cable from trigger box port 2
|
||||
Monitor: H4 Cable
|
||||
|
||||
|
||||
UV phantom as well
|
||||
|
||||
LOG
|
||||
X2s5815
|
||||
Bad shot - very messy - oring ruptured in the secondary may have over pressurised with additional LAB Air.
|
||||
X2s5816
|
||||
Fired at 1.32Pa instead of 13.2pa.....
|
||||
x2s5826
|
||||
Phantom aperture was 18 in description for prev shot but was set to 22 for the prev shot
|
||||
Phantom trig signal changed from falling to rising
|
||||
|
74
main.py
74
main.py
@ -33,10 +33,8 @@ data_to_load = [
|
||||
#"x2s5823",
|
||||
#"x2s5824",
|
||||
#"x2s5827",
|
||||
"x2s5829",
|
||||
#"x2s5830",
|
||||
"x2s5831",
|
||||
"x2s5832"
|
||||
#"x2s5829",
|
||||
"x2s5830",
|
||||
]
|
||||
|
||||
# ==== Data Loading & Processing ====
|
||||
@ -46,11 +44,11 @@ def load_data(data_path: str, data={}) -> dict:
|
||||
print(f"[ERR] Could not find data info file: '{data_info_path}'")
|
||||
print(f"[WARN] Not Loading Data '{data_path}'")
|
||||
return None
|
||||
|
||||
|
||||
# Load Shot Data Info YAML File (Cal)
|
||||
with open(data_info_path, 'r') as file:
|
||||
dataInfo = yaml.safe_load(file)
|
||||
|
||||
|
||||
# Grab the shot name
|
||||
x2_shot = dataInfo["shot-info"]["name"]
|
||||
|
||||
@ -58,13 +56,13 @@ def load_data(data_path: str, data={}) -> dict:
|
||||
dataInfo["shot-info"]["tdms"] = dataInfo["shot-info"]["tdms"].format(x2_shot)
|
||||
dataInfo["shot-info"]["config"] = dataInfo["shot-info"]["config"].format(x2_shot)
|
||||
dataInfo["shot-info"]["info"] = dataInfo["shot-info"]["info"].format(x2_shot)
|
||||
|
||||
|
||||
# Load Raw Data
|
||||
# TDMS File (X2 DAQ Data)
|
||||
x2_tdms_data = TdmsFile.read(data_path + dataInfo["shot-info"]['tdms'], raw_timestamps=True)
|
||||
x2_channels = x2_tdms_data.groups()[0].channels()
|
||||
x2_channel_names = tuple(c.name for c in x2_channels)
|
||||
|
||||
|
||||
data_locs = [dr["type"] for dr in dataInfo["probe-info"]["data-records"]]
|
||||
|
||||
# Scope info _if it exists_
|
||||
@ -82,16 +80,16 @@ def load_data(data_path: str, data={}) -> dict:
|
||||
for i, line in enumerate(dfile):
|
||||
if i > 1: break
|
||||
header_lines.append(line.strip().split(","))
|
||||
|
||||
|
||||
for i, name in enumerate(header_lines[0]):
|
||||
if name == "x-axis":
|
||||
name = "Time"
|
||||
|
||||
|
||||
if header_lines[1][i] in ["second", "Volt"]:
|
||||
outStr = f"{name} [{header_lines[1][i][0]}]"
|
||||
else:
|
||||
outStr = f"{name} [{header_lines[1][i]}]"
|
||||
|
||||
|
||||
scope_header.append(outStr)
|
||||
|
||||
# Load the Scope CSV Data
|
||||
@ -119,14 +117,14 @@ def load_data(data_path: str, data={}) -> dict:
|
||||
"x2": {}, # Only pop channels with a voltage scale in ./tunnel-info.yaml
|
||||
"probes": [[None], [None]] # Save probe data in volts - [G1, G2]
|
||||
},
|
||||
"shock-speed": {} # Note all in us
|
||||
"shock-speed": {} # Note all in us
|
||||
}
|
||||
|
||||
# === Process the data ===
|
||||
# Generate X2 time arrays
|
||||
time_data = x2_channels[0]
|
||||
|
||||
ns_time = time_data[:].as_datetime64('ns')
|
||||
|
||||
ns_time = time_data[:].as_datetime64('ns')
|
||||
x2_time_seconds = (ns_time - ns_time[0]) # timedelta64[ns]
|
||||
x2_time_us = x2_time_seconds.astype("float64") / 1000 # Scale to us
|
||||
|
||||
@ -205,20 +203,20 @@ def load_data(data_path: str, data={}) -> dict:
|
||||
refData = data[x2_shot]["data"]["x2"][ref]
|
||||
first_value, first_value_uncertainty, _, _ = canny_shock_finder(x2_time_us, refData, plot=False, print_func=None)
|
||||
shock_point = np.where(x2_time_us >= first_value)[0][0] # [BUG] Seems to give n+1
|
||||
|
||||
|
||||
data[x2_shot]["shock-point"][ref] = shock_point, first_value
|
||||
|
||||
|
||||
for i, probe in enumerate(dataInfo["probe-info"]["locations"]):
|
||||
probeCh1 = data[x2_shot]["data"]["probes"][0]
|
||||
probeCh2 = data[x2_shot]["data"]["probes"][1]
|
||||
|
||||
|
||||
# Get the canny-args
|
||||
cArgs = dataInfo["canny-args"]
|
||||
doCannyPlot = False
|
||||
if i in range(len(cArgs)):
|
||||
sigma = cArgs[i]["sigma"]
|
||||
post_sup_thresh = cArgs[i]["post_pres"]
|
||||
else:
|
||||
else:
|
||||
sigma = cArgs[-1]["sigma"]
|
||||
post_sup_thresh = cArgs[-1]["post_pres"]
|
||||
|
||||
@ -236,22 +234,22 @@ def load_data(data_path: str, data={}) -> dict:
|
||||
raise ValueError(f"{probe}-g1 not detected")
|
||||
|
||||
shock_point = np.where(scope_time >= first_value)[0][0] # [BUG] Seems to give n+1
|
||||
|
||||
|
||||
data[x2_shot]["shock-point"][f"{probe}-g1"] = shock_point, first_value
|
||||
|
||||
# Do the same for G2
|
||||
if i > 0:
|
||||
time_offset = data[x2_shot]["shock-point"][f"{privPoint}-g2"][1] + CANNY_TIME_OFFSET
|
||||
|
||||
|
||||
# Find G2 Shock Time
|
||||
first_value, first_value_uncertainty, _, _ = canny_shock_finder(scope_time, probeCh2, sigma=sigma, post_suppression_threshold=post_sup_thresh, plot=doCannyPlot, start_time=time_offset, print_func=None)
|
||||
if first_value is None:
|
||||
print(f"[ERROR] {x2_shot} - {probe}-g2 could not be detected using: Sigma = {sigma}, post_suppression_threshold = {post_sup_thresh}")
|
||||
raise ValueError(f"{probe}-g2 not detected")
|
||||
|
||||
|
||||
shock_point = np.where(scope_time >= first_value)[0][0] # [BUG] Seems to give n+1
|
||||
data[x2_shot]["shock-point"][f"{probe}-g2"] = shock_point, first_value
|
||||
|
||||
|
||||
# Calculate Shock Speeds
|
||||
print("="*30, x2_shot, "="*30)
|
||||
print("--", dataInfo["long_name"], "--")
|
||||
@ -260,8 +258,8 @@ def load_data(data_path: str, data={}) -> dict:
|
||||
if i == 0: continue
|
||||
p1_time = data[x2_shot]["shock-point"][refProbe][1] / 1e6 # Convert to seconds
|
||||
p2_time = data[x2_shot]["shock-point"][dataInfo["pcb-refs"][i-1]][1] / 1e6 # Convert to seconds
|
||||
p2p_dist = (TUNNEL_INFO["distance"][refProbe] - TUNNEL_INFO["distance"][dataInfo["pcb-refs"][i-1]]) / 1000 # convert to m
|
||||
|
||||
p2p_dist = (TUNNEL_INFO["distance"][refProbe] - TUNNEL_INFO["distance"][dataInfo["pcb-refs"][i-1]]) / 1000 # convert to m
|
||||
|
||||
probe_velocity = p2p_dist / abs(p2_time - p1_time) # m/s
|
||||
print(f"{refProbe}-{dataInfo["pcb-refs"][i-1]} Measured a shock speed of {probe_velocity:.2f} m/s ({probe_velocity/1000:.2f} km/s)")
|
||||
|
||||
@ -270,8 +268,8 @@ def load_data(data_path: str, data={}) -> dict:
|
||||
for probe in dataInfo["probe-info"]["locations"]:
|
||||
g1_time = data[x2_shot]["shock-point"][f"{probe}-g1"][1] / 1e6 # Convert to seconds
|
||||
g2_time = data[x2_shot]["shock-point"][f"{probe}-g2"][1] / 1e6 # Convert to seconds
|
||||
c2c_dist = dataInfo["probe-info"]["c2c"] / 1000 # convert to m
|
||||
|
||||
c2c_dist = dataInfo["probe-info"]["c2c"] / 1000 # convert to m
|
||||
|
||||
probe_velocity = c2c_dist / abs(g2_time - g1_time) # m/s
|
||||
|
||||
print(f"{probe} Measured a shock speed of {probe_velocity:.2f} m/s ({probe_velocity/1000:.2f} km/s)")
|
||||
@ -282,12 +280,12 @@ def load_data(data_path: str, data={}) -> dict:
|
||||
probe_locs = dataInfo["probe-info"]["locations"]
|
||||
p1_g1_time = data[x2_shot]["shock-point"][f"{probe_locs[i]}-g1"][1] / 1e6 # Convert to seconds
|
||||
p1_g2_time = data[x2_shot]["shock-point"][f"{probe_locs[i]}-g2"][1] / 1e6 # Convert to seconds
|
||||
|
||||
|
||||
p2_g1_time = data[x2_shot]["shock-point"][f"{probe_locs[i+1]}-g1"][1] / 1e6 # Convert to seconds
|
||||
p2_g2_time = data[x2_shot]["shock-point"][f"{probe_locs[i+1]}-g2"][1] / 1e6 # Convert to seconds
|
||||
|
||||
p2p = (TUNNEL_INFO["distance"][probe_locs[1]] - TUNNEL_INFO["distance"][probe_locs[0]]) / 1000 # convert to m
|
||||
|
||||
|
||||
p2p = (TUNNEL_INFO["distance"][probe_locs[1]] - TUNNEL_INFO["distance"][probe_locs[0]]) / 1000 # convert to m
|
||||
|
||||
p2p_1 = p2p / abs(p2_g1_time - p1_g1_time) # m/s
|
||||
p2p_2 = p2p / abs(p2_g2_time - p1_g2_time) # m/s
|
||||
|
||||
@ -297,8 +295,8 @@ def load_data(data_path: str, data={}) -> dict:
|
||||
data[x2_shot]["shock-speed"][f"{probe_locs[i]}-{probe_locs[i + 1]}-g2"] = p2p_2
|
||||
|
||||
print()
|
||||
|
||||
# Return the data & the successfully loaded data keys
|
||||
|
||||
# Return the data & the successfully loaded data keys
|
||||
return data #, tuple(data.keys())
|
||||
|
||||
data = {}
|
||||
@ -322,7 +320,7 @@ def genGraph(gData: dict, showPlot: bool = True):
|
||||
"ledgLoc": 'upper left',
|
||||
"plots": []
|
||||
}
|
||||
|
||||
|
||||
lims = []
|
||||
|
||||
for label in gData["info"]["pcb-refs"]: # + ["trigbox"]:
|
||||
@ -381,11 +379,11 @@ def genGraph(gData: dict, showPlot: bool = True):
|
||||
"x": 0.94, "y": 0.94
|
||||
})
|
||||
|
||||
#if len(lims) > 1:
|
||||
# OFFSET = 10
|
||||
# graphData["xLim"] = (float(min(lims) - OFFSET), float(max(lims) + OFFSET))
|
||||
|
||||
|
||||
if len(lims) > 1:
|
||||
OFFSET = 10
|
||||
graphData["xLim"] = (float(min(lims) - OFFSET), float(max(lims) + OFFSET))
|
||||
|
||||
|
||||
makeGraph(graphData, doProgramBlock=False, showPlot=showPlot, figSavePath="./images/{0}.png")
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user