This is a julia package that is intended to make the day-to-day data crunching at the university of Alberta WAAM lab a little easier. I haven't gotten around to porting over the pyrometer tools yet, so it's really just a fancy power data import tool for the time being.
My intention is to open up the code I have been using to others. By creating a package, the algorithms can be used in short scripts to automate new tasks.
As this is a julia package, you will first need to install julia. The easiest way to do this is to follow the instructions at the julia downloads page.
After julia is installed, launch it and enter the following command to install this package:
julia> import Pkg; Pkg.add(url="https://github.com/Jarrod-Angove/WAAMTools.jl")
Once the package is installed, you need to tell the current session to use it (this is something you will need to do every time you launch julia; the installation steps only happen once):
julia> using WAAMTools
You can then start using the functions provided by the package.
Run the following command in the REPL to find the mean power(s) for a file with the absolute path path/to/my_power_file.csv
julia> my_mean = mean(importer("path/to/my_power_file.csv"))
The my_mean
variable will then be a tuple of either one or two objects depending on how many samples were run for this file. If all you want are the mean values associated with each (read below for the other options), you can use the following commands
julia> mean_sample1 = my_mean[1].summary.mean
julia> mean_sample2 = my_mean[2].summary.mean
mean_sample1
will then be the mean power for the cold plate, and mean_sample2
will be the mean power for the hot plate. Please note that these values are the average power [W] input over time, and do not account for heat transfer efficiency or torch travel speed.
As data for the WAAM system is collected in the form of CSV/xlsx files, it needs to be imported and cleaned up. This can be done with the importer command, which will create a power_info
object from the given file:
importer(file, directory)
Import the power file CSV in directory
into a power_file
object, which has the fields:
voltage
= the voltage read from the CSV in [V]current
= the current read from the CSV in [A]time
= the time, formatted into seconds, from the CSVfile
= the file name input
For example, if you wanted to import the file Plate18_power.csv
, located in the directory home/user.../power_files/
, you would input the following in the REPL:
julia> plate18_data = importer("Plate18_power.csv", "home/user.../power_files/")
Once you have a power_info
object, you can access the components with julia dot notation:
julia> plate18_data.voltage
The above command will return a vector of the voltages stored in plate18_data
.
Alternatively, you can input the complete file path as a single string to get the same results;
julia> importer("home/use.../power_files/Plate18_power.csv")
Which will return the same data object.
Once you have a power_info
object from this import, you can do a few things. The main purpose of this package is splitting power data into averages, so the main function is mean
, which takes one of these objects and does a few things:
- Identify stable regions for averaging
- Calculates the mean and standard deviation of these regions
- If there are multiple regions (for trials where there are 2 beads on a plate), split the resulting data into individual
sample_power
objects, which contain all information relevant to the sample power calculation.
julia> my_mean_data = mean(plate18_dat)
Once you have a sample_power
object, you are basically done! This contains the following fields:
name
→ the original file namesummary
→ a summary of the mean data calculationranges
→ the selected time range for the mean (in seconds)mean
→ the average power in [w], not including efficiency or ttsnsamples
→ the number of samples in the original file (1 or 2)npoints
→ the number of points sampled for this averagestd
→ the standard deviation from the mean
hotcold
→ "c" for cold plate and "h" for hot plate; just to keep track of stuff
In summary, if you wanted to find the average power input for the cold plate data of plate 18, you would use the following commands
julia> my_mean_data = mean(importer("path/to/data.csv"))
julia> cold_plate_average = my_mean_data[1].summary.mean
Likewise, if you wanted to find the standard deviation of the hot plate data:
julia> hot_plate_std = my_mean_data[2].summary.std
If you forgot where your data came from, you can use my_mean_data.name
to see its original file name, or my_mean_data.hotcold
to see if the mean data corresponds to the first (cold plate) or second (hot plate) sample.
You can view what the algorithm is selecting by using the view_range
function, which plots the power data and the range(s) selected by the algorithm:
julia> view_range(importer("path/to/Plate15_data.csv"))
Which will produce the plot: