Plotting Tool - User Guide
This is an attempt to standardize data plotting in Space Team Aachen, or at least to create a standard tool for it. If you just want to use the tool, read the first two parts of the article. If you want to help to develop the tool, then go to the section “Developer information”. Do you miss some functionalities which aren't listed in the section “Developer information”? Feel free to comment them down below.
The tool is currently in the beta phase. I did some tests and everything should work, but I'm not quite sure that my tests covered all cases. So if problems occur, don't hesitate to write me a message (Max Heckmann).
Functionalities
Currently, the plotting tool covers the following functionalities:
- Process "tdms", "csv" and "txt" files
- Process multiple files at once
- generate time values with increment
- Automatically creates a folder-structure for the results
- Freely selectable start and end time
- Choose custom label for y-axis (x-axis is always time in seconds)
- Generate a normal plot
- Generate a plot of the data processed by a move-mean filter (20th order)
- Generate a spectrogram of the fourier analysis
- Merge the generated .fig files into singular files
Accessing the tool
First, you're going to need MATLAB. Thankfully, the RWTH provides a free Matlab license for all students. Click here for further information. Next, you need the plotting tool itself. If you already set up your git account and key, just clone the repository. Don't forget to pull before every use, in order to get all the updates.
Don't worry, there is another solution for all mechanical engineers and other people who are not that familiar with “new” technology. With this solution, you still need access to Space Team Aachen GitLab, but you don't have to set up the SSH-Key. Press the download button in the right corner, as you can see in the picture.
Once you have all the files on your PC. Open the file “PlottingTool.mlapp”. (Compare with the picture)
This probably takes some time. First, Matlab will open up. Then, without doing anything, a smaller window will open which looks like this:
Using the tool
Press “Select Folder” in order to choose the folder which contains the data. Important: Don't select a file – only the folder. The software is able to handle multiple files in a folder. After that, press the “Load” button. This might take some time as well. You can only press the load button ones. Restart the software if you made a mistake. The UI should look similar to this.
The software generates a row with bold letters for each file. This row provides settings for the whole file. So, in the example above, there were 4 relevant files in the folder. Under each of these file-setting-rows are rows for the different channels, which provide the possibility for specific channel settings. That means, for example, the 03_AIC.tdms file probably looked like this:
**N2 Valves** | **N2 Purge** | **N2 Supply** | **N2O Supply DLR** | **Injector** |
1.23 | 24.3 | 53.2 | 12.2 | 12.0 |
3.0 | 22.7 | 19.1 | 23.8 | 2.4 |
... | ... | ... | ... | ... |
You maybe noticed the missing time column in the chart above. This is not a mistake. It's sometimes possible to measure the data in such a constant frequency, that there is no need to measure the time. If so, all the program needs to know is the time difference between each measurement-value – the increment. This is nothing else than the reciprocal of the measurement frequency.
The following paragraph describes the usage of the "First row secs" checkbox, which is a feature, which isn't implemented yet, although it is already visible in the UI.
If you measured the time separately, because the measurement frequency isn't constant, check the box called “First row secs”. If this checkbox is ticked, the software would assume that the file “03_AIC.tdms” looks like this:
**Time \[s\]** | **N2 Valves** | **N2 Purge** | **N2 Supply** | **N2O Supply DLR** | **Injector** |
0.1 | 1.23 | 24.3 | 53.2 | 12.2 | 12.0 |
0.2 | 3.0 | 22.7 | 19.1 | 23.8 | 2.4 |
... | ... | ... | ... | ... | ... |
The rest of the user interface is self-explanatory. “Graph” generates a normal plot, "Fourier" analyses the spectrum, “movemean” generates a plot of the data processed by a move-mean filter of the 20th order. You have the opportunity to set a start and an end time for the plots (use a period, not a comma). If the end time is zero, the software plots the data till the end. You can set a specific y label for each plot. The x label is always time in seconds. Here are some random examples:
Press “Generate Plots” if you're done with the settings. Choose a storage location – I recommend creating a new folder. Press “ok”. Now different figures are popping up and immediately vanish again. Wait till all figures are closed. The plots should now be found in the specified location.
The plots are always saved as png and fig files. If you need a different y-scale for some plots, find specific data points or much more, open the fig file with Matlab. The Matlab figure UI provides such functionalities, as well as the possibility to save the edited plot.
One last disclaimer: If there is a mistake in the data set, if you use a comma instead of a period, if you write words in fields which expect a number and in many other cases, the software will crash. This software isn't made to be used without a brain.
Merge Tool
To access the merge tool, follow the instructions for the plotting tool, but select the file "mergeTool.mlapp" instead.
The merge tool functions very similarly to the main Plotting tool. In the top of the UI there is a "Select File" and "Path" Text field. Use either of these to specify the first file and then press "Add". Repeat this process for every file you wish to use.
Now you can use the "X-Axis Label" and "Y-Axis Label" text fields to change the Labels as needed. In the Rows below you should now see all the .fig files you selected with a "Name in Legend" text field, which allows you to change how the extracted data will be labled in the legend.
Finally hit the "Generate Merged Plot" button and you will be asked to select the location, where the "merged.fig" and "merged.png" files will be placed. You can continue to use the tool and add more .fig files after the generation.
IMPORTANT: The merge tool, will extract only the "main" plot from each file. I.e. if you merge a Derivative .fig file (which contains both the original function and it's derivative), only the derivative will be added to the new merged figure.
Merging with subplots
To merge with subplots please consult this guide:
For every supported amount of selected files, there are two sublpot Versions A and B. Simply select the one you wish to use in the drop down menu:
Developer information
There are numerous functionalities still missing. The following list provides an overview of all important functions, that should be added as soon as possible (more or less). The order of precedence represents the priority.
- Get the custom x-Axis label to work on the fourier plot
- Add try and catch statements around every user input
- Add support for merging plots with multiple data entries
You are very welcome to help develop this tool further. If you are planning to do so, please send me a message (Max Heckmann) and I give you a short introduction in the already existing code. This probably saves you some time.