Compare commits
23 Commits
b86694e603
...
main
Author | SHA1 | Date | |
---|---|---|---|
aeef8f9253 | |||
247c503885 | |||
c4b0dd1fef | |||
3398414b55 | |||
1b66ac1f24 | |||
7d6b3403f5 | |||
313ef7d1de | |||
9570111f61 | |||
f3bb6f870f | |||
df1c20f0c3 | |||
46ef08874a | |||
e59aa2d034 | |||
5ffbf17ac6 | |||
ab3547b26c | |||
30376abeb9 | |||
511995830c | |||
8125efa26a | |||
e653885de1 | |||
5b1bf0eedb | |||
2e5dc27055 | |||
02fc4bb079 | |||
0921e27df6 | |||
578378f23e |
39
README.md
Normal file
39
README.md
Normal file
@ -0,0 +1,39 @@
|
||||
# Ionization Probe Analysis Code
|
||||
|
||||
> Written by Cal Wing (<c.wing@uq.net.au> - 45811953) in 2024 for his Thesis
|
||||
|
||||
## Installation
|
||||
|
||||
Run `pip install -r requirements.txt` or equivilient for your envoroment.
|
||||
|
||||
## Running
|
||||
|
||||
Run `main.py` it will then generate all the output graphs and put them in (a git untracked) folder called `./images`.
|
||||
|
||||
By default all data graphs will be generated - you need to change the functions called at the end in the `if '__name__ == '__main__':` section.
|
||||
|
||||
## `./data` Explanation
|
||||
|
||||
I like YAML files to store information. All the data shot folders have a file call `_info.yaml` this file contained all the info about the shot so that when it would load & be graphed it would be correct.
|
||||
|
||||
I hope the values are self explanatory but they may not - sorry
|
||||
|
||||
## Changes to [canny_shock_finder.py](./canny_shock_finder.py)
|
||||
|
||||
Basically I hacked in an extra argument `print_func`, that is used to override the `print` function in the file. It assumes its either a callable reference (like print, the default) or None (it then uses a no-operation function to silence all output)
|
||||
|
||||
I also removed the error catching around lines ~497 so the function blindly continues if it can't graph.
|
||||
|
||||
I also enabled grid lines on the graphs.
|
||||
|
||||
The UQ colours being used on the graphs is due to some funky ~~abuse~~ *utlitly* I built into my [`makeGraph`](#makegraph) library.
|
||||
|
||||
## MakeGraph
|
||||
|
||||
> This refers to the [makeGraph.py](./makeGraph.py) file/version *in this code base*, I would not trust the exact specifics for versions found elsewhere, but the general gist is the same.
|
||||
|
||||
A *long* time ago I wrote a wrapper for matplotlib that has expanded into a formatting tool. The crux of it is that I can throw a dictionary at the `makeGraph` function and it will do all the hard work for me.
|
||||
|
||||
There are a few fun things that loading the lib will do - like overriding the default colour cyclers to use only the UQ colours - so if your going to liberate / adapt it be wary.
|
||||
|
||||
All the graphing done in the [`main.py`](./main.py) uses makeGraph, its not the most scary thing in the world as its basically ~~AI~~ *a big if conditional*.
|
@ -15,7 +15,7 @@ Chris James (c.james4@uq.edu.au) - 04/07/17
|
||||
|
||||
# Amened by Cal Wing to make the function not print
|
||||
|
||||
VERSION_STRING = "17-Oct-2024"
|
||||
VERSION_STRING = "20-Oct-2024"
|
||||
|
||||
def canny_shock_finder(time_list, pressure_list, sigma = 4, derivative_threshold = 0.001, auto_derivative = False, post_suppression_threshold = 0.05,
|
||||
post_shock_pressure = None, start_time = None, find_second_peak = None, plot = True, plot_scale_factor = None,
|
||||
@ -116,6 +116,8 @@ def canny_shock_finder(time_list, pressure_list, sigma = 4, derivative_threshold
|
||||
:param plot_time_scale: See plot_time_unit above. These two inputs allow the results plot to be in a different
|
||||
time unit to the original data. The user must specify this scale to connect the original and plotted
|
||||
time units. Defaults to 1.0 (so no change if time units are seconds).
|
||||
:param print_func: Callable Reference to call when print is called in this function. Defaults to 'print' but if 'None'
|
||||
is passed it uses a no-operation function to silence all output.
|
||||
"""
|
||||
|
||||
# Make the function silent / have print overridable
|
||||
@ -360,6 +362,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')
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Data Info File
|
||||
# Cal Wing - Oct 24
|
||||
|
||||
long_name: "Shot 1 (x2s5823) - Fat Probe - 2024-10-15"
|
||||
long_name: "Shot 1 (x2s5823) - Thick Probe (ST2) - 2024-10-15\nProtruding ST1 - Mars Entry Conditions"
|
||||
name: "Shot 1"
|
||||
date: "2024-10-15"
|
||||
time: "13:02"
|
||||
@ -23,22 +23,22 @@ canny-args:
|
||||
|
||||
no-graph:
|
||||
- "None"
|
||||
# - "at1"
|
||||
# - "at2"
|
||||
# - "at3"
|
||||
- "at1"
|
||||
- "at2"
|
||||
- "at3"
|
||||
|
||||
# - "at4"
|
||||
# - "at5"
|
||||
# - "at6"
|
||||
- "at4"
|
||||
- "at5"
|
||||
- "at6"
|
||||
|
||||
pcb-refs:
|
||||
#- "at1"
|
||||
#- "at2"
|
||||
#- "at3"
|
||||
#
|
||||
#- "at4"
|
||||
#- "at5"
|
||||
#- "at6"
|
||||
- "at1"
|
||||
- "at2"
|
||||
- "at3"
|
||||
|
||||
- "at4"
|
||||
- "at5"
|
||||
- "at6"
|
||||
|
||||
- "st1"
|
||||
- "st3"
|
||||
@ -49,6 +49,7 @@ probe-info:
|
||||
c2c: 5.6 # mm
|
||||
gauge-diam: 3.05 # mm
|
||||
gauge-c2c: 4 #mm
|
||||
dist-uncert: 3.05 #mm
|
||||
|
||||
gauges:
|
||||
- 1
|
||||
@ -60,6 +61,7 @@ probe-info:
|
||||
- type: "scope"
|
||||
config: "eProbe-Scope.txt"
|
||||
data: "eProbe-Scope.csv"
|
||||
time-uncert: 0.00000001428571428571 # s
|
||||
|
||||
trigger: # Redundant?
|
||||
type: "channel"
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Data Info File
|
||||
# Cal Wing - Oct 24
|
||||
|
||||
long_name: "Shot 2 (x2s5824) - Thin Probe - 2024-10-15"
|
||||
long_name: "Shot 2 (x2s5824) - Thin Probe (ST2) - 2024-10-15\nProtruding ST2 - Mars Entry Conditions"
|
||||
name: "Shot 2"
|
||||
date: "2024-10-15"
|
||||
time: "17:18"
|
||||
@ -49,18 +49,20 @@ probe-info:
|
||||
c2c: 5.6 # mm
|
||||
gauge-diam: 0.8 # mm
|
||||
gauge-c2c: 1.8 #mm
|
||||
dist-uncert: 0.8 #mm
|
||||
|
||||
gauges:
|
||||
- 1
|
||||
- 2
|
||||
locations: # In order of pulse
|
||||
- "st2"
|
||||
- "st3"
|
||||
# - "st3"
|
||||
|
||||
data-records:
|
||||
- type: "scope"
|
||||
config: "eProbe-Scope.txt"
|
||||
data: "eProbe-Scope.csv"
|
||||
time-uncert: 0.00000001428571428571 # s
|
||||
|
||||
trigger: # Redundant?
|
||||
type: "channel"
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Data Info File
|
||||
# Cal Wing - Oct 24
|
||||
|
||||
long_name: "Shot 2 (x2s5827) - Thin Probe Pair (ST2 & ST3) - 2024-10-16"
|
||||
long_name: "Shot 2 (x2s5827) - Thin Probe Pair (ST2 & ST3) - 2024-10-16\nProtruding ST2 & ST3 - Mars Entry Conditions"
|
||||
name: "Shot 3"
|
||||
date: "2024-10-16"
|
||||
time: "18:40"
|
||||
@ -52,6 +52,7 @@ probe-info:
|
||||
c2c: 5.6 # mm
|
||||
gauge-diam: 0.8 # mm
|
||||
gauge-c2c: 1.8 #mm
|
||||
dist-uncert: 0.8 #mm
|
||||
|
||||
gauges:
|
||||
- 1
|
||||
@ -64,6 +65,7 @@ probe-info:
|
||||
- type: "scope"
|
||||
config: "eProbe-Scope.txt"
|
||||
data: "eProbe-Scope.csv"
|
||||
time-uncert: 0.00000001428571428571 # s
|
||||
|
||||
trigger: # Redundant?
|
||||
type: "channel"
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Data Info File
|
||||
# Cal Wing - Oct 24
|
||||
|
||||
long_name: "Shot 4 (x2s5829) - Thin Probe Pair (ST2 & ST3) - 2024-10-17"
|
||||
long_name: "Shot 4 (x2s5829) - Thin Probe Pair (ST2 & ST3) - 2024-10-17\nProtruding ST2 & ST3 - Mars Entry Conditions"
|
||||
name: "Shot 4"
|
||||
date: "2024-10-17"
|
||||
time: "17:00"
|
||||
@ -54,6 +54,7 @@ probe-info:
|
||||
c2c: 5.6 # mm
|
||||
gauge-diam: 0.8 # mm
|
||||
gauge-c2c: 1.8 #mm
|
||||
dist-uncert: 0.8 #mm
|
||||
|
||||
gauges:
|
||||
- 1
|
||||
@ -66,6 +67,7 @@ probe-info:
|
||||
- type: "scope"
|
||||
config: "eProbe-Scope.txt"
|
||||
data: "eProbe-Scope.csv"
|
||||
time-uncert: 0.00000001428571428571 # s
|
||||
|
||||
trigger: # Redundant?
|
||||
type: "channel"
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Data Info File
|
||||
# Cal Wing - Oct 24
|
||||
|
||||
long_name: "Shot 5 (x2s5829) - Thin Probe Pair (ST2 & ST3) - 2024-10-17"
|
||||
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"
|
||||
@ -52,6 +52,7 @@ probe-info:
|
||||
c2c: 5.6 # mm
|
||||
gauge-diam: 0.8 # mm
|
||||
gauge-c2c: 1.8 #mm
|
||||
dist-uncert: 0.8 #mm
|
||||
|
||||
gauges:
|
||||
- 1
|
||||
@ -64,6 +65,7 @@ probe-info:
|
||||
- type: "scope"
|
||||
config: "eProbe-Scope.txt"
|
||||
data: "eProbe-Scope.csv"
|
||||
time-uncert: 0.00000001428571428571 # s
|
||||
|
||||
trigger: # Redundant?
|
||||
type: "channel"
|
||||
|
@ -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 (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"
|
||||
@ -25,6 +25,14 @@ canny-args:
|
||||
- sigma: 1
|
||||
post_pres: 0.05
|
||||
|
||||
|
||||
x2-canny:
|
||||
- sigma: 1
|
||||
post_pres: 0.02
|
||||
|
||||
- sigma: 0.5
|
||||
post_pres: 0.01
|
||||
|
||||
no-graph:
|
||||
- "at1"
|
||||
- "at2"
|
||||
@ -55,11 +63,13 @@ probe-info:
|
||||
c2c: 5.6 # mm
|
||||
gauge-diam: 0.8 # mm
|
||||
gauge-c2c: 1.8 #mm
|
||||
dist-uncert: 0.8 #mm
|
||||
|
||||
data-records:
|
||||
- type: "scope"
|
||||
config: "eProbe-Scope.txt"
|
||||
data: "eProbe-Scope.csv"
|
||||
time-uncert: 0.00000001428571428571 # s
|
||||
|
||||
trigger: # Redundant?
|
||||
type: "channel"
|
||||
@ -69,9 +79,13 @@ probe-info:
|
||||
|
||||
- type: "x2"
|
||||
channels: # Gauge Channel Name
|
||||
- "st2"
|
||||
- "st1"
|
||||
- "st3"
|
||||
|
||||
scaler:
|
||||
st1: 1
|
||||
st3: 10
|
||||
|
||||
trigger:
|
||||
type: "x2"
|
||||
# Info isn't really needed
|
||||
|
@ -1,8 +1,8 @@
|
||||
# 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"
|
||||
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"
|
||||
|
||||
@ -27,6 +27,16 @@ canny-args:
|
||||
- sigma: 1
|
||||
post_pres: 0.05
|
||||
|
||||
x2-canny:
|
||||
- sigma: 2
|
||||
post_pres: 0.03
|
||||
|
||||
- sigma: 1
|
||||
post_pres: 0.2
|
||||
|
||||
- sigma: 1
|
||||
post_pres: 0.05
|
||||
|
||||
no-graph:
|
||||
- "None"
|
||||
- "at1"
|
||||
@ -58,11 +68,13 @@ probe-info:
|
||||
c2c: 5.6 # mm
|
||||
gauge-diam: 0.8 # mm
|
||||
gauge-c2c: 1.8 #mm
|
||||
dist-uncert: 0.8 #mm
|
||||
|
||||
data-records:
|
||||
- type: "scope"
|
||||
config: "eProbe-Scope.txt"
|
||||
data: "eProbe-Scope.csv"
|
||||
time-uncert: 0.00000001428571428571 # s
|
||||
|
||||
trigger: # Redundant?
|
||||
type: "channel"
|
||||
@ -72,9 +84,13 @@ probe-info:
|
||||
|
||||
- type: "x2"
|
||||
channels: # Gauge Channel Name
|
||||
- "st2"
|
||||
- "st1"
|
||||
- "st3"
|
||||
|
||||
scaler:
|
||||
st1: 1
|
||||
st3: 10
|
||||
|
||||
trigger:
|
||||
type: "x2"
|
||||
# Info isn't really needed
|
||||
|
@ -35,3 +35,37 @@ volt-scale:
|
||||
|
||||
trigbox: 0.001 #V / mV
|
||||
trigbox_delay: 0.001 #V / mV
|
||||
|
||||
|
||||
uncertainties:
|
||||
probe-dist:
|
||||
sd1: 0.002 # +/- m
|
||||
sd2: 0.002 # +/- m
|
||||
sd3: 0.002 # +/- m
|
||||
|
||||
st1: 0.002 # +/- m
|
||||
st2: 0.002 # +/- m
|
||||
st3: 0.002 # +/- m
|
||||
|
||||
at1: 0.002 # +/- m
|
||||
at2: 0.002 # +/- m
|
||||
at3: 0.002 # +/- m
|
||||
|
||||
at4: 0.002 # +/- m
|
||||
at5: 0.002 # +/- m
|
||||
at6: 0.002 # +/- m
|
||||
|
||||
# [TODO] This could be better
|
||||
st1-g1: 0.002 # +/- m
|
||||
st1-g2: 0.002 # +/- m
|
||||
|
||||
st2-g1: 0.002 # +/- m
|
||||
st2-g2: 0.002 # +/- m
|
||||
|
||||
st3-g1: 0.002 # +/- m
|
||||
st3-g2: 0.002 # +/- m
|
||||
|
||||
|
||||
time:
|
||||
x2-daq: 0.00000039999999999996 # 30MHz ?
|
||||
|
||||
|
Reference in New Issue
Block a user