Update info.yaml and quick refactor
This commit is contained in:
		@@ -12,31 +12,58 @@ shot-info:
 | 
				
			|||||||
  config: "x2s5823.config"
 | 
					  config: "x2s5823.config"
 | 
				
			||||||
  info: "x2s5823.txt"
 | 
					  info: "x2s5823.txt"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pcb-canny:
 | 
				
			||||||
 | 
					  - sigma: 4
 | 
				
			||||||
 | 
					    post_pres: 0.05
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Canny Args
 | 
					# Canny Args
 | 
				
			||||||
canny-args:
 | 
					canny-args:
 | 
				
			||||||
  - sigma: 2
 | 
					  - sigma: 2
 | 
				
			||||||
    post_pres: 0.03
 | 
					    post_pres: 0.03
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					no-graph:
 | 
				
			||||||
 | 
					  - "None"
 | 
				
			||||||
 | 
					  # - "at1"
 | 
				
			||||||
 | 
					  # - "at2"
 | 
				
			||||||
 | 
					  # - "at3"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # - "at4"
 | 
				
			||||||
 | 
					  # - "at5"
 | 
				
			||||||
 | 
					  # - "at6"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pcb-refs:
 | 
					pcb-refs:
 | 
				
			||||||
 | 
					  #- "at1"
 | 
				
			||||||
 | 
					  #- "at2"
 | 
				
			||||||
 | 
					  #- "at3"
 | 
				
			||||||
 | 
					  #
 | 
				
			||||||
 | 
					  #- "at4"
 | 
				
			||||||
 | 
					  #- "at5"
 | 
				
			||||||
 | 
					  #- "at6"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  - "st1"
 | 
					  - "st1"
 | 
				
			||||||
  - "st3"
 | 
					  - "st3"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
probe-info:
 | 
					probe-info:
 | 
				
			||||||
  type: "Fat"
 | 
					  type: "Fat"
 | 
				
			||||||
  locations: # In order of pulse
 | 
					 | 
				
			||||||
    - "st2"
 | 
					 | 
				
			||||||
  overhang: 1 # mm
 | 
					  overhang: 1 # mm
 | 
				
			||||||
  c2c: 5.6 # mm
 | 
					  c2c: 5.6 # mm
 | 
				
			||||||
  gauge-diam: 3.05 # mm
 | 
					  gauge-diam: 3.05 # mm
 | 
				
			||||||
  gauge-c2c: 4 #mm
 | 
					  gauge-c2c: 4 #mm
 | 
				
			||||||
  data-record:
 | 
					
 | 
				
			||||||
    type: "scope"
 | 
					  gauges:
 | 
				
			||||||
    config: "eProbe-Scope.txt"
 | 
					    - 1
 | 
				
			||||||
    data: "eProbe-Scope.csv"
 | 
					    - 2
 | 
				
			||||||
    
 | 
					  locations: # In order of pulse
 | 
				
			||||||
    trigger:
 | 
					    - "st2"
 | 
				
			||||||
      type: "channel"
 | 
					
 | 
				
			||||||
      channel: 4
 | 
					  data-records:
 | 
				
			||||||
      alignment-offset: 0 # 601 # us [TODO] Make this auto-magic
 | 
					    - type: "scope"
 | 
				
			||||||
      delay: 100 # us
 | 
					      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
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,23 +12,51 @@ shot-info:
 | 
				
			|||||||
  config: "x2s5824.config"
 | 
					  config: "x2s5824.config"
 | 
				
			||||||
  info: "x2s5824.txt"
 | 
					  info: "x2s5824.txt"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pcb-canny:
 | 
				
			||||||
 | 
					  - sigma: 4
 | 
				
			||||||
 | 
					    post_pres: 0.05
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Canny Args
 | 
					# Canny Args
 | 
				
			||||||
canny-args:
 | 
					canny-args:
 | 
				
			||||||
  - sigma: 2
 | 
					  - sigma: 2
 | 
				
			||||||
    post_pres: 0.03
 | 
					    post_pres: 0.03
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					no-graph:
 | 
				
			||||||
 | 
					  - "None"
 | 
				
			||||||
 | 
					  # - "at1"
 | 
				
			||||||
 | 
					  # - "at2"
 | 
				
			||||||
 | 
					  # - "at3"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # - "at4"
 | 
				
			||||||
 | 
					  # - "at5"
 | 
				
			||||||
 | 
					  # - "at6"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pcb-refs:
 | 
					pcb-refs:
 | 
				
			||||||
 | 
					  #- "at1"
 | 
				
			||||||
 | 
					  #- "at2"
 | 
				
			||||||
 | 
					  #- "at3"
 | 
				
			||||||
 | 
					  #
 | 
				
			||||||
 | 
					  #- "at4"
 | 
				
			||||||
 | 
					  #- "at5"
 | 
				
			||||||
 | 
					  #- "at6"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  - "st1"
 | 
					  - "st1"
 | 
				
			||||||
  - "st3"
 | 
					  - "st3"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
probe-info:
 | 
					probe-info:
 | 
				
			||||||
  type: "Thin"
 | 
					  type: "Thin"
 | 
				
			||||||
  locations: # In order of pulse
 | 
					 | 
				
			||||||
    - "st2"
 | 
					 | 
				
			||||||
  overhang: 1 # mm
 | 
					  overhang: 1 # mm
 | 
				
			||||||
  c2c: 5.6 # mm
 | 
					  c2c: 5.6 # mm
 | 
				
			||||||
  gauge-diam: 0.8 # mm
 | 
					  gauge-diam: 0.8 # mm
 | 
				
			||||||
  gauge-c2c: 1.8 #mm
 | 
					  gauge-c2c: 1.8 #mm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  gauges:
 | 
				
			||||||
 | 
					    - 1
 | 
				
			||||||
 | 
					    - 2
 | 
				
			||||||
 | 
					  locations: # In order of pulse
 | 
				
			||||||
 | 
					    - "st2"
 | 
				
			||||||
 | 
					    - "st3"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  data-record:
 | 
					  data-record:
 | 
				
			||||||
    type: "scope"
 | 
					    type: "scope"
 | 
				
			||||||
    config: "eProbe-Scope.txt"
 | 
					    config: "eProbe-Scope.txt"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,6 +12,10 @@ shot-info:
 | 
				
			|||||||
  config: "x2s5827.config"
 | 
					  config: "x2s5827.config"
 | 
				
			||||||
  info: "x2s5827.txt"
 | 
					  info: "x2s5827.txt"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pcb-canny:
 | 
				
			||||||
 | 
					  - sigma: 4
 | 
				
			||||||
 | 
					    post_pres: 0.05
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Canny Args
 | 
					# Canny Args
 | 
				
			||||||
canny-args:
 | 
					canny-args:
 | 
				
			||||||
  - sigma: 2
 | 
					  - sigma: 2
 | 
				
			||||||
@@ -20,18 +24,41 @@ canny-args:
 | 
				
			|||||||
  - sigma: 0.75
 | 
					  - sigma: 0.75
 | 
				
			||||||
    post_pres: 0.1
 | 
					    post_pres: 0.1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					no-graph:
 | 
				
			||||||
 | 
					  - "None"
 | 
				
			||||||
 | 
					  # - "at1"
 | 
				
			||||||
 | 
					  # - "at2"
 | 
				
			||||||
 | 
					  # - "at3"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # - "at4"
 | 
				
			||||||
 | 
					  # - "at5"
 | 
				
			||||||
 | 
					  # - "at6"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pcb-refs:
 | 
					pcb-refs:
 | 
				
			||||||
 | 
					  #- "at1"
 | 
				
			||||||
 | 
					  #- "at2"
 | 
				
			||||||
 | 
					  #- "at3"
 | 
				
			||||||
 | 
					  #
 | 
				
			||||||
 | 
					  #- "at4"
 | 
				
			||||||
 | 
					  #- "at5"
 | 
				
			||||||
 | 
					  #- "at6"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  - "st1"
 | 
					  - "st1"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
probe-info:
 | 
					probe-info:
 | 
				
			||||||
  type: "Thin"
 | 
					  type: "Thin"
 | 
				
			||||||
  locations: # In order of pulse
 | 
					 | 
				
			||||||
    - "st2"
 | 
					 | 
				
			||||||
    - "st3"
 | 
					 | 
				
			||||||
  overhang: 1 # mm
 | 
					  overhang: 1 # mm
 | 
				
			||||||
  c2c: 5.6 # mm
 | 
					  c2c: 5.6 # mm
 | 
				
			||||||
  gauge-diam: 0.8 # mm
 | 
					  gauge-diam: 0.8 # mm
 | 
				
			||||||
  gauge-c2c: 1.8 #mm
 | 
					  gauge-c2c: 1.8 #mm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  gauges:
 | 
				
			||||||
 | 
					    - 1
 | 
				
			||||||
 | 
					    - 2
 | 
				
			||||||
 | 
					  locations: # In order of pulse
 | 
				
			||||||
 | 
					    - "st2"
 | 
				
			||||||
 | 
					    - "st3"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  data-record:
 | 
					  data-record:
 | 
				
			||||||
    type: "scope"
 | 
					    type: "scope"
 | 
				
			||||||
    config: "eProbe-Scope.txt"
 | 
					    config: "eProbe-Scope.txt"
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -22,31 +22,52 @@ canny-args:
 | 
				
			|||||||
  - sigma: 1
 | 
					  - sigma: 1
 | 
				
			||||||
    post_pres: 0.2
 | 
					    post_pres: 0.2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pcb-refs:
 | 
					pcb-canny:
 | 
				
			||||||
  - "st1"
 | 
					  - sigma: 4
 | 
				
			||||||
 | 
					    post_pres: 0.05
 | 
				
			||||||
 | 
					
 | 
				
			||||||
no-graph:
 | 
					no-graph:
 | 
				
			||||||
  - "None"
 | 
					  - "None"
 | 
				
			||||||
 | 
					  # - "at1"
 | 
				
			||||||
 | 
					  # - "at2"
 | 
				
			||||||
 | 
					  # - "at3"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # - "at4"
 | 
				
			||||||
 | 
					  # - "at5"
 | 
				
			||||||
 | 
					  # - "at6"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pcb-refs:
 | 
				
			||||||
 | 
					  #- "at1"
 | 
				
			||||||
 | 
					  #- "at2"
 | 
				
			||||||
 | 
					  #- "at3"
 | 
				
			||||||
 | 
					  #
 | 
				
			||||||
 | 
					  #- "at4"
 | 
				
			||||||
 | 
					  #- "at5"
 | 
				
			||||||
 | 
					  #- "at6"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  - "st1"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
probe-info:
 | 
					probe-info:
 | 
				
			||||||
  type: "Thin"
 | 
					  type: "Thin"
 | 
				
			||||||
  locations: # In order of pulse
 | 
					 | 
				
			||||||
    - "st2"
 | 
					 | 
				
			||||||
    - "st3"
 | 
					 | 
				
			||||||
  overhang: 1 # mm
 | 
					  overhang: 1 # mm
 | 
				
			||||||
  c2c: 5.6 # mm
 | 
					  c2c: 5.6 # mm
 | 
				
			||||||
  gauge-diam: 0.8 # mm
 | 
					  gauge-diam: 0.8 # mm
 | 
				
			||||||
  gauge-c2c: 1.8 #mm
 | 
					  gauge-c2c: 1.8 #mm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  data-records:
 | 
					  gauges:
 | 
				
			||||||
    - type: "scope"
 | 
					    - 1
 | 
				
			||||||
      config: "eProbe-Scope.txt"
 | 
					    - 2
 | 
				
			||||||
      data: "eProbe-Scope.csv"
 | 
					  locations: # In order of pulse
 | 
				
			||||||
 | 
					    - "st2"
 | 
				
			||||||
 | 
					    - "st3"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  data-record:
 | 
				
			||||||
 | 
					    type: "scope"
 | 
				
			||||||
 | 
					    config: "eProbe-Scope.txt"
 | 
				
			||||||
 | 
					    data: "eProbe-Scope.csv"
 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
      trigger: # Redundant?
 | 
					    trigger: # Redundant?
 | 
				
			||||||
        type: "channel"
 | 
					      type: "channel"
 | 
				
			||||||
        channel: 4
 | 
					      channel: 4
 | 
				
			||||||
        alignment-offset: 0 # 601 # us [TODO] Make this auto-magic
 | 
					      alignment-offset: 0 # 601 # us [TODO] Make this auto-magic
 | 
				
			||||||
        delay: 100 # us
 | 
					      delay: 100 # us
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@@ -20,7 +20,12 @@ canny-args:
 | 
				
			|||||||
  - sigma: 1
 | 
					  - sigma: 1
 | 
				
			||||||
    post_pres: 0.2
 | 
					    post_pres: 0.2
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pcb-canny:
 | 
				
			||||||
 | 
					  - sigma: 4
 | 
				
			||||||
 | 
					    post_pres: 0.05
 | 
				
			||||||
 | 
					
 | 
				
			||||||
no-graph:
 | 
					no-graph:
 | 
				
			||||||
 | 
					  - "None"
 | 
				
			||||||
  - "at1"
 | 
					  - "at1"
 | 
				
			||||||
  - "at2"
 | 
					  - "at2"
 | 
				
			||||||
  - "at3"
 | 
					  - "at3"
 | 
				
			||||||
@@ -30,38 +35,37 @@ no-graph:
 | 
				
			|||||||
  - "at6"
 | 
					  - "at6"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pcb-refs:
 | 
					pcb-refs:
 | 
				
			||||||
  - "st1"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  - "at1"
 | 
					  - "at1"
 | 
				
			||||||
  - "at2"
 | 
					  - "at2"
 | 
				
			||||||
  - "at3"
 | 
					  - "at3"
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
  - "at4"
 | 
					  - "at4"
 | 
				
			||||||
  - "at5"
 | 
					  - "at5"
 | 
				
			||||||
  - "at6"
 | 
					  - "at6"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  - "st1"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
probe-info:
 | 
					probe-info:
 | 
				
			||||||
  type: "Thin"
 | 
					  type: "Thin"
 | 
				
			||||||
 | 
					  overhang: 1 # mm
 | 
				
			||||||
 | 
					  c2c: 5.6 # mm
 | 
				
			||||||
 | 
					  gauge-diam: 0.8 # mm
 | 
				
			||||||
 | 
					  gauge-c2c: 1.8 #mm
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  gauges:
 | 
					  gauges:
 | 
				
			||||||
    - 1
 | 
					    - 1
 | 
				
			||||||
    - 2
 | 
					    - 2
 | 
				
			||||||
  locations: # In order of pulse
 | 
					  locations: # In order of pulse
 | 
				
			||||||
    - "st2"
 | 
					    - "st2"
 | 
				
			||||||
    - "st3"
 | 
					    - "st3"
 | 
				
			||||||
  overhang: 1 # mm
 | 
					
 | 
				
			||||||
  c2c: 5.6 # mm
 | 
					  data-record:
 | 
				
			||||||
  gauge-diam: 0.8 # mm
 | 
					    type: "scope"
 | 
				
			||||||
  gauge-c2c: 1.8 #mm
 | 
					    config: "eProbe-Scope.txt"
 | 
				
			||||||
  
 | 
					    data: "eProbe-Scope.csv"
 | 
				
			||||||
  data-records:
 | 
					 | 
				
			||||||
    - type: "scope"
 | 
					 | 
				
			||||||
      config: "eProbe-Scope.txt"
 | 
					 | 
				
			||||||
      data: "eProbe-Scope.csv"
 | 
					 | 
				
			||||||
    
 | 
					    
 | 
				
			||||||
      trigger: # Redundant?
 | 
					    trigger: # Redundant?
 | 
				
			||||||
        type: "channel"
 | 
					      type: "channel"
 | 
				
			||||||
        channel: 4
 | 
					      channel: 4
 | 
				
			||||||
        alignment-offset: 0 # 601 # us [TODO] Make this auto-magic
 | 
					      alignment-offset: 0 # 601 # us [TODO] Make this auto-magic
 | 
				
			||||||
        delay: 100 # us
 | 
					      delay: 100 # us
 | 
				
			||||||
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
@@ -2,6 +2,7 @@
 | 
				
			|||||||
# Cal Wing - Oct 24
 | 
					# 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 (ST1, ST2 & ST3) - 2024-10-18 - Flush ST2"
 | 
				
			||||||
 | 
					comments: "G2 Pointless, Wasn't attached"
 | 
				
			||||||
name: "Shot 6"
 | 
					name: "Shot 6"
 | 
				
			||||||
date: "2024-10-18"
 | 
					date: "2024-10-18"
 | 
				
			||||||
time: "14:00"
 | 
					time: "14:00"
 | 
				
			||||||
@@ -62,4 +63,17 @@ probe-info:
 | 
				
			|||||||
        alignment-offset: 0 # 601 # us [TODO] Make this auto-magic
 | 
					        alignment-offset: 0 # 601 # us [TODO] Make this auto-magic
 | 
				
			||||||
        delay: 100 # us
 | 
					        delay: 100 # us
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    - type: "x2"
 | 
				
			||||||
 | 
					      channels: # Gauge Channel Name
 | 
				
			||||||
 | 
					        - "st2"
 | 
				
			||||||
 | 
					        - "st3"
 | 
				
			||||||
 | 
					      
 | 
				
			||||||
 | 
					      trigger:
 | 
				
			||||||
 | 
					        type: "x2"
 | 
				
			||||||
 | 
					        # Info isn't really needed
 | 
				
			||||||
 | 
					        channel: "trigbox"
 | 
				
			||||||
 | 
					        alignment-offset: 0 # 601 # us [TODO] Make this auto-magic
 | 
				
			||||||
 | 
					        delay: 0 # us
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,6 +12,10 @@ shot-info:
 | 
				
			|||||||
  config: "{0}.config"
 | 
					  config: "{0}.config"
 | 
				
			||||||
  info: "{0}.txt"
 | 
					  info: "{0}.txt"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					pcb-canny:
 | 
				
			||||||
 | 
					  - sigma: 4
 | 
				
			||||||
 | 
					    post_pres: 0.05
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Canny Args
 | 
					# Canny Args
 | 
				
			||||||
canny-args:
 | 
					canny-args:
 | 
				
			||||||
  - sigma: 2
 | 
					  - sigma: 2
 | 
				
			||||||
@@ -66,4 +70,17 @@ probe-info:
 | 
				
			|||||||
        alignment-offset: 0 # 601 # us [TODO] Make this auto-magic
 | 
					        alignment-offset: 0 # 601 # us [TODO] Make this auto-magic
 | 
				
			||||||
        delay: 100 # us
 | 
					        delay: 100 # us
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    - type: "x2"
 | 
				
			||||||
 | 
					      channels: # Gauge Channel Name
 | 
				
			||||||
 | 
					        - "st2"
 | 
				
			||||||
 | 
					        - "st3"
 | 
				
			||||||
 | 
					      
 | 
				
			||||||
 | 
					      trigger:
 | 
				
			||||||
 | 
					        type: "x2"
 | 
				
			||||||
 | 
					        # Info isn't really needed
 | 
				
			||||||
 | 
					        channel: "trigbox"
 | 
				
			||||||
 | 
					        alignment-offset: 0 # 601 # us [TODO] Make this auto-magic
 | 
				
			||||||
 | 
					        delay: 0 # us
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										102
									
								
								main.py
									
									
									
									
									
								
							
							
						
						
									
										102
									
								
								main.py
									
									
									
									
									
								
							@@ -30,11 +30,11 @@ with open(TUNNEL_INFO_FILE, 'r') as file:
 | 
				
			|||||||
    TUNNEL_INFO = yaml.safe_load(file)
 | 
					    TUNNEL_INFO = yaml.safe_load(file)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
data_to_load = [
 | 
					data_to_load = [
 | 
				
			||||||
    #"x2s5823",
 | 
					    "x2s5823",
 | 
				
			||||||
    #"x2s5824",
 | 
					    "x2s5824",
 | 
				
			||||||
    #"x2s5827",
 | 
					    "x2s5827",
 | 
				
			||||||
    "x2s5829",
 | 
					    "x2s5829",
 | 
				
			||||||
    #"x2s5830",
 | 
					    "x2s5830",
 | 
				
			||||||
    "x2s5831",
 | 
					    "x2s5831",
 | 
				
			||||||
    "x2s5832"
 | 
					    "x2s5832"
 | 
				
			||||||
]
 | 
					]
 | 
				
			||||||
@@ -201,13 +201,25 @@ def load_data(data_path: str, data={}) -> dict:
 | 
				
			|||||||
    # Find Shock Times
 | 
					    # Find Shock Times
 | 
				
			||||||
    # X2 - Canning Edge
 | 
					    # X2 - Canning Edge
 | 
				
			||||||
    data[x2_shot]["shock-point"] = {}
 | 
					    data[x2_shot]["shock-point"] = {}
 | 
				
			||||||
    for ref in dataInfo["pcb-refs"]:
 | 
					    cArgs = dataInfo["pcb-canny"]
 | 
				
			||||||
 | 
					    for i, ref in enumerate(dataInfo["pcb-refs"]):
 | 
				
			||||||
        refData = data[x2_shot]["data"]["x2"][ref]
 | 
					        refData = data[x2_shot]["data"]["x2"][ref]
 | 
				
			||||||
        first_value, first_value_uncertainty, _, _ = canny_shock_finder(x2_time_us, refData, plot=False, print_func=None)
 | 
					
 | 
				
			||||||
 | 
					        if i in range(len(cArgs)):
 | 
				
			||||||
 | 
					            sigma = cArgs[i]["sigma"]
 | 
				
			||||||
 | 
					            post_sup_thresh = cArgs[i]["post_pres"]
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            sigma = cArgs[-1]["sigma"]
 | 
				
			||||||
 | 
					            post_sup_thresh = cArgs[-1]["post_pres"]
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        first_value, first_value_uncertainty, _, _ = canny_shock_finder(x2_time_us, refData, sigma=sigma, post_suppression_threshold=post_sup_thresh, plot=False, print_func=None)
 | 
				
			||||||
        shock_point = np.where(x2_time_us >= first_value)[0][0] # [BUG] Seems to give n+1
 | 
					        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
 | 
					        data[x2_shot]["shock-point"][ref] = shock_point, first_value
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    # ---- Gauge Canning Edge ----
 | 
				
			||||||
    for i, probe in enumerate(dataInfo["probe-info"]["locations"]):
 | 
					    for i, probe in enumerate(dataInfo["probe-info"]["locations"]):
 | 
				
			||||||
        probeCh1 = data[x2_shot]["data"]["probes"][0]
 | 
					        probeCh1 = data[x2_shot]["data"]["probes"][0]
 | 
				
			||||||
        probeCh2 = data[x2_shot]["data"]["probes"][1]
 | 
					        probeCh2 = data[x2_shot]["data"]["probes"][1]
 | 
				
			||||||
@@ -230,27 +242,29 @@ def load_data(data_path: str, data={}) -> dict:
 | 
				
			|||||||
            time_offset = None
 | 
					            time_offset = None
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Find G1 Shock Time
 | 
					        # Find G1 Shock Time
 | 
				
			||||||
        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)
 | 
					        if 1 in dataInfo["probe-info"]["gauges"]:
 | 
				
			||||||
        if first_value is 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)
 | 
				
			||||||
            print(f"[ERROR] {x2_shot} - {probe}-g1 could not be detected using: Sigma = {sigma}, post_suppression_threshold = {post_sup_thresh}")
 | 
					            if first_value is None:
 | 
				
			||||||
            raise ValueError(f"{probe}-g1 not detected")
 | 
					                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")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        shock_point = np.where(scope_time >= first_value)[0][0] # [BUG] Seems to give n+1
 | 
					            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
 | 
					            data[x2_shot]["shock-point"][f"{probe}-g1"] = shock_point, first_value
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Do the same for G2
 | 
					        if 2 in dataInfo["probe-info"]["gauges"]:
 | 
				
			||||||
        if i > 0:
 | 
					            # Do the same for G2
 | 
				
			||||||
            time_offset = data[x2_shot]["shock-point"][f"{privPoint}-g2"][1] + CANNY_TIME_OFFSET
 | 
					            if i > 0:
 | 
				
			||||||
 | 
					                time_offset = data[x2_shot]["shock-point"][f"{privPoint}-g2"][1] + CANNY_TIME_OFFSET
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        # Find G2 Shock Time
 | 
					            # 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)
 | 
					            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:
 | 
					            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}")
 | 
					                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")
 | 
					                raise ValueError(f"{probe}-g2 not detected")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        shock_point = np.where(scope_time >= first_value)[0][0] # [BUG] Seems to give n+1
 | 
					            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
 | 
					            data[x2_shot]["shock-point"][f"{probe}-g2"] = shock_point, first_value
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Calculate Shock Speeds
 | 
					    # Calculate Shock Speeds
 | 
				
			||||||
    print("="*30, x2_shot, "="*30)
 | 
					    print("="*30, x2_shot, "="*30)
 | 
				
			||||||
@@ -268,34 +282,38 @@ def load_data(data_path: str, data={}) -> dict:
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    print()
 | 
					    print()
 | 
				
			||||||
    for probe in dataInfo["probe-info"]["locations"]:
 | 
					    for probe in dataInfo["probe-info"]["locations"]:
 | 
				
			||||||
        g1_time = data[x2_shot]["shock-point"][f"{probe}-g1"][1] / 1e6 # Convert to seconds
 | 
					        if f"{probe}-g1" in data[x2_shot]["shock-point"] and f"{probe}-g2" in data[x2_shot]["shock-point"]:
 | 
				
			||||||
        g2_time = data[x2_shot]["shock-point"][f"{probe}-g2"][1] / 1e6 # Convert to seconds
 | 
					            g1_time = data[x2_shot]["shock-point"][f"{probe}-g1"][1] / 1e6 # Convert to seconds
 | 
				
			||||||
        c2c_dist = dataInfo["probe-info"]["c2c"] / 1000 # convert to m
 | 
					            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
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        probe_velocity = c2c_dist / abs(g2_time - g1_time) # m/s
 | 
					            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)")
 | 
					            print(f"{probe} Measured a shock speed of {probe_velocity:.2f} m/s ({probe_velocity/1000:.2f} km/s)")
 | 
				
			||||||
        data[x2_shot]["shock-speed"][probe] = probe_velocity # m/s
 | 
					            data[x2_shot]["shock-speed"][probe] = probe_velocity # m/s
 | 
				
			||||||
 | 
					        else:
 | 
				
			||||||
 | 
					            print(f"Unable to calculate probe velocity, only have one probe: {f"{probe}-g2" if f"{probe}-g2" in data[x2_shot]["shock-point"] else f"{probe}-g1"}")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if len(dataInfo["probe-info"]["locations"]) > 1:
 | 
					    if len(dataInfo["probe-info"]["locations"]) > 1:
 | 
				
			||||||
        for i in range(len(dataInfo["probe-info"]["locations"]) - 1):
 | 
					        for i in range(len(dataInfo["probe-info"]["locations"]) - 1):
 | 
				
			||||||
            probe_locs = dataInfo["probe-info"]["locations"]
 | 
					            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
 | 
					            if f"{probe_locs[i]}-g1" in data[x2_shot]["shock-point"] and f"{probe_locs[i+1]}-g1" in data[x2_shot]["shock-point"]:
 | 
				
			||||||
            p2p_2 = p2p / abs(p2_g2_time - p1_g2_time) # m/s
 | 
					                p1_g1_time = data[x2_shot]["shock-point"][f"{probe_locs[i]}-g1"][1] / 1e6 # Convert to seconds
 | 
				
			||||||
 | 
					                p2_g1_time = data[x2_shot]["shock-point"][f"{probe_locs[i+1]}-g1"][1] / 1e6 # Convert to seconds
 | 
				
			||||||
            print(f"{probe_locs[i]}-{probe_locs[i + 1]} - G1 - Measured a shock speed of {p2p_1:.2f} m/s ({p2p_1/1000:.2f} km/s)")
 | 
					                p2p_1 = p2p / abs(p2_g1_time - p1_g1_time) # m/s
 | 
				
			||||||
            print(f"{probe_locs[i]}-{probe_locs[i + 1]} - G2 - Measured a shock speed of {p2p_2:.2f} m/s ({p2p_2/1000:.2f} km/s)")
 | 
					                print(f"{probe_locs[i]}-{probe_locs[i + 1]} - G1 - Measured a shock speed of {p2p_1:.2f} m/s ({p2p_1/1000:.2f} km/s)")
 | 
				
			||||||
            data[x2_shot]["shock-speed"][f"{probe_locs[i]}-{probe_locs[i + 1]}-g1"] = p2p_1
 | 
					                data[x2_shot]["shock-speed"][f"{probe_locs[i]}-{probe_locs[i + 1]}-g2"] = p2p_2
 | 
				
			||||||
            data[x2_shot]["shock-speed"][f"{probe_locs[i]}-{probe_locs[i + 1]}-g2"] = p2p_2
 | 
					            
 | 
				
			||||||
 | 
					            if f"{probe_locs[i]}-g2" in data[x2_shot]["shock-point"] and f"{probe_locs[i+1]}-g2" in data[x2_shot]["shock-point"]:
 | 
				
			||||||
 | 
					                p1_g2_time = data[x2_shot]["shock-point"][f"{probe_locs[i]}-g2"][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_2 = p2p / abs(p2_g2_time - p1_g2_time) # m/s
 | 
				
			||||||
 | 
					                print(f"{probe_locs[i]}-{probe_locs[i + 1]} - G2 - Measured a shock speed of {p2p_2:.2f} m/s ({p2p_2/1000:.2f} km/s)")
 | 
				
			||||||
 | 
					                data[x2_shot]["shock-speed"][f"{probe_locs[i]}-{probe_locs[i + 1]}-g1"] = p2p_1
 | 
				
			||||||
 | 
					                
 | 
				
			||||||
    print()
 | 
					    print()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Return the data & the successfully loaded data keys
 | 
					    # Return the data & the successfully loaded data keys
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user