Skip to content
Snippets Groups Projects
Commit f7985688 authored by David Schäfer's avatar David Schäfer
Browse files

Update GettingStarted.md

parent 0449555a
No related branches found
No related tags found
Loading
Pipeline #3247 passed with stage
in 8 minutes and 46 seconds
......@@ -79,8 +79,8 @@ Now create your our own configuration file `saqc/ressources/data/myconfig.csv`
and paste the following lines into it:
varname;test;plot
SM2;range(min=10, max=60);False
SM2;spikes_simpleMad(window="30d", z=3.5);True
SM2;flagRange(min=10, max=60);False
SM2;spikes_flagMad(window="30d", z=3.5);True
These lines illustrate how different quality control tests can be specified for
different variables by following the pattern:
......@@ -128,6 +128,26 @@ So, what do we see here?
only. Thus, the plot aggregates all preceeding tests (here: `range`) to black
points and highlights the flags of the selected test as red points.
#### Save outputs to file
If you want the final results to be saved to a csv-file, you can do so by the
use of the `-o` option:
```sh
saqc -c ressources/data/config.csv -d ressources/data/data.csv -o ressources/data/out.csv
```
Which saves a dataframe that contains both the original data and the quality
flags that were assigned by SaQC for each of the variables:
Date,SM1,SM1_flags,SM2,SM2_flags
2016-04-01 00:05:48,32.685,OK,29.3157,OK
2016-04-01 00:20:42,32.7428,OK,29.3157,OK
2016-04-01 00:35:37,32.6186,OK,29.3679,OK
2016-04-01 00:50:32,32.736999999999995,OK,29.3679,OK
...
### Configure SaQC
#### Change test parameters
......@@ -138,8 +158,8 @@ example, you could modify your `myconfig.csv` and change the parameters of the
range-test:
varname;test;plot
SM2;range(min=-20, max=60);False
SM2;spikes_simpleMad(window="30d", z=3.5);True
SM2;flagRange(min=-20, max=60);False
SM2;spikes_flagMad(window="30d", z=3.5);True
Rerunning SaQC as above produces the following plot:
![Changing the config](images/example_plot_2.png "Changing the config")
......@@ -156,10 +176,10 @@ are then executed sequentially and can be plotted seperately. E.g. you could do
something like this:
varname;test;plot
SM1;range(min=10, max=60);False
SM2;range(min=10, max=60);False
SM1;spikes_simpleMad(window="15d", z=3.5);True
SM2;spikes_simpleMad(window="30d", z=3.5);True
SM1;flagRange(min=10, max=60);False
SM2;flagRange(min=10, max=60);False
SM1;spikes_flagMad(window="15d", z=3.5);True
SM2;spikes_flagMad(window="30d", z=3.5);True
which gives you separate plots for each line where the plotting option is set to
`True` as well as one summary "data plot" that depicts the joint flags from all
......@@ -178,7 +198,7 @@ series. Also, you can write your own tests using a python-based
[extension language](docs/GenericFunctions.md). This would look like this:
varname;test;plot
SM2;harmonize_shift2Grid(freq="15Min");False
SM2;harm_shift2Grid(freq="15Min");False
SM2;flagGeneric(func=(SM2 < 30));True
The above executes an internal framework that harmonizes the timestamps of SM2
......@@ -196,23 +216,4 @@ Also, all values where SM2 is below 30 are flagged via the custom function (see
plot below). You can learn more about the syntax of these custom functions
[here](docs/GenericFunctions.md).
![Example custom function](images/example_plot_4.png "Example custom function")
#### Save outputs to file
If you want the final results to be saved to a csv-file, you can do so by the
use of the `-o` option:
```sh
saqc -c ressources/data/config.csv -d ressources/data/data.csv -o ressources/data/out.csv
```
Which saves a dataframe that contains both the original data and the quality
flags that were assigned by SaQC for each of the variables:
Date,SM1,SM1_flags,SM2,SM2_flags
2016-04-01 00:05:48,32.685,OK,29.3157,OK
2016-04-01 00:20:42,32.7428,OK,29.3157,OK
2016-04-01 00:35:37,32.6186,OK,29.3679,OK
2016-04-01 00:50:32,32.736999999999995,OK,29.3679,OK
...
![Example custom function](images/example_plot_4.png "Example custom function")
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment