Finalise README

This commit is contained in:
Cal Wing 2024-10-25 16:21:42 +10:00
parent 247c503885
commit aeef8f9253
2 changed files with 26 additions and 4 deletions

View File

@ -1,6 +1,6 @@
# Ionization Probe Analysis Code # Ionization Probe Analysis Code
> Written by Cal Wing (c.wing@uq.net.au - 45811953) in 2024 for his Thesis > Written by Cal Wing (<c.wing@uq.net.au> - 45811953) in 2024 for his Thesis
## Installation ## Installation
@ -10,10 +10,30 @@ Run `pip install -r requirements.txt` or equivilient for your envoroment.
Run `main.py` it will then generate all the output graphs and put them in (a git untracked) folder called `./images`. 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 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 ## `./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 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. 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*.

View File

@ -15,7 +15,7 @@ Chris James (c.james4@uq.edu.au) - 04/07/17
# Amened by Cal Wing to make the function not print # 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, 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, 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 :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 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). 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 # Make the function silent / have print overridable