Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
kvalobs:kvoss:system:qc2:test:vm101notes [2010-06-22 22:08:55] paule |
kvalobs:kvoss:system:qc2:test:vm101notes [2022-05-31 09:29:32] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Installation and test on dev-vm101 notes ====== | + | ====== Installation and test on dev-vm101 notes [kvqc2_1.0.1 and other revisions ... ] ====== |
The following notes describe the installation and use of **kvqc2 version 1.0.1** Sources: https:// | The following notes describe the installation and use of **kvqc2 version 1.0.1** Sources: https:// | ||
+ | |||
+ | **Algorithms in this release:** | ||
+ | |||
+ | ^ AlgoCode ^Description | ||
+ | | 9 | SingleMinMaxAverage | **kvqc2_1.0.1** For a given paramid and corresponding Max paramid and Min paramid calculates a correction for a single missing value as average of max and min. If no max or min available or specified then reverts to simple linear. | | ||
+ | | 10 | SingleLinear |**kvqc2_1.0.1** Replaces a single missing value with a linear interpolated value. If specified checks that the correction lies within the available max ... min range, if not sets to nearest of max or min. Run for any paramid and optional max, min specified in the configuration file. | | ||
===== Installation ===== | ===== Installation ===== | ||
Line 8: | Line 14: | ||
* Log into dev-vm101 as user kvalobs | * Log into dev-vm101 as user kvalobs | ||
- | * If an old kvqc2 exists stop the running kvqc2 process | + | * If an old kvqc2 exists stop the running kvqc2 process |
* Remove active configuration files (this is to just ensure that when the new kvqc2 version is set running it does not find and use an old configuration file) | * Remove active configuration files (this is to just ensure that when the new kvqc2 version is set running it does not find and use an old configuration file) | ||
Line 14: | Line 20: | ||
< | < | ||
$ cd / | $ cd / | ||
- | $ mv ProcessUnit.cfg ProcessUnit.cfg | + | $ mv XXX.cfg XXX.hold |
$ mv ProcessUnit.cfg ProcessUnit.hold | $ mv ProcessUnit.cfg ProcessUnit.hold | ||
</ | </ | ||
Line 22: | Line 28: | ||
* Install the latest version of kvqc2 | * Install the latest version of kvqc2 | ||
* Log in as a user with sudoer permission | * Log in as a user with sudoer permission | ||
+ | * NB one may need to run " | ||
< | < | ||
Line 27: | Line 34: | ||
</ | </ | ||
- | Note: the above is the standard way to do this, but did not work. Here is the trace (this is a separate issue to work on!!!) | + | An alternative |
- | + | ||
- | < | + | |
- | paule@dev-vm101: | + | |
- | kvqc2 - Non-real-time and geo-statistical quality controls. | + | |
- | paule@dev-vm101: | + | |
- | Reading package lists... Done | + | |
- | Building dependency tree... Done | + | |
- | kvqc2 is already the newest version. | + | |
- | You might want to run `apt-get -f install' | + | |
- | The following packages have unmet dependencies: | + | |
- | libkvcpp-dev: | + | |
- | libkvcpp1: Depends: libkvalobs1 (= 2.1.4-1) but 2.1.4-3 is to be installed | + | |
- | E: Unmet dependencies. Try ' | + | |
- | paule@dev-vm101: | + | |
- | </ | + | |
- | + | ||
- | Instead installed | + | |
i.e. using "sudo dpkg -i kvqc2_1.0.1-1_i386.deb" | i.e. using "sudo dpkg -i kvqc2_1.0.1-1_i386.deb" | ||
Line 59: | Line 49: | ||
Setting up kvqc2 (1.0.1-1) ... | Setting up kvqc2 (1.0.1-1) ... | ||
paule@dev-vm101: | paule@dev-vm101: | ||
+ | </ | ||
+ | |||
+ | **Bug Fix and Confirmation of apt-get install** | ||
+ | |||
+ | Initial tests illustrated that some data was written back to thedatabase at too high a precision. This is fixed in revision 1782: https:// | ||
+ | |||
+ | < | ||
+ | paule@dev-vm101: | ||
+ | Reading package lists... Done | ||
+ | Building dependency tree... Done | ||
+ | The following packages will be upgraded: | ||
+ | kvqc2 | ||
+ | 1 upgraded, 0 newly installed, 0 to remove and 78 not upgraded. | ||
+ | Need to get 288kB of archives. | ||
+ | After unpacking 0B of additional disk space will be used. | ||
+ | Get:1 http:// | ||
+ | Fetched 288kB in 0s (12.7MB/s) | ||
+ | (Reading database ... 52403 files and directories currently installed.) | ||
+ | Preparing to replace kvqc2 1.0.1-1 (using .../ | ||
+ | Unpacking replacement kvqc2 ... | ||
+ | Setting up kvqc2 (1.0.2-1) ... | ||
+ | paule@dev-vm101: | ||
</ | </ | ||
Line 99: | Line 111: | ||
< | < | ||
- | kvalobs@dev-vm101: | + | kvalobs@dev-vm101: |
</ | </ | ||
Line 170: | Line 182: | ||
</ | </ | ||
- | * Stop (Ctrl^C) the running process (NB may have to wait 1 minute) and then restart as the daemon process with " | + | * Stop (Ctrl C) the running process |
^Step 4 ^kvstart^ | ^Step 4 ^kvstart^ | ||
Line 212: | Line 224: | ||
NB Times in UTC!!! | NB Times in UTC!!! | ||
- | Here are some observations: | + | * Here are some observations: |
< | < | ||
kvalobs@dev-vm101: | kvalobs@dev-vm101: | ||
Line 223: | Line 236: | ||
20100622235953: | 20100622235953: | ||
--------------- Single Linear | --------------- Single Linear | ||
+ | </ | ||
+ | |||
+ | Then ... nothing else happened. Note strict filters are being applied to the data. Now rerun but **remove the | ||
+ | A_fqclevel=0 setting**. i.e. in DailyProcessUnitMissing.cfg: | ||
+ | |||
+ | < | ||
+ | # | ||
+ | </ | ||
+ | |||
+ | * Reset the run time and observe Qc2.log output. | ||
+ | |||
+ | < | ||
--------------- Case 10: Single Linear | --------------- Case 10: Single Linear | ||
20100623000814: | 20100623000814: | ||
Line 250: | Line 275: | ||
20100623000831: | 20100623000831: | ||
--------------- ProcessUnitT Writing Data 7.2 76928 2010-6-20 23:0:0 | --------------- ProcessUnitT Writing Data 7.2 76928 2010-6-20 23:0:0 | ||
+ | </ | ||
+ | * Pick a random entry from above and check the output in the kvalobs databse: | ||
- | </ | + | < |
+ | kvalobs@dev-vm101: | ||
+ | Welcome to psql 8.3.3, the PostgreSQL interactive terminal. | ||
+ | |||
+ | Type: \copyright for distribution terms | ||
+ | \h for help with SQL commands | ||
+ | \? for help with psql commands | ||
+ | \g or terminate with semicolon to execute query | ||
+ | \q to quit | ||
+ | |||
+ | kvalobs=# select * from data where obstime=' | ||
+ | | ||
+ | -----------+---------------------+----------+---------+---------------------+--------+--------+-------+-----------+------------------+------------------+---------- | ||
+ | 76930 | 2010-06-21 13:00:00 | | ||
+ | (1 row) | ||
+ | |||
+ | kvalobs=# select * from data where obstime between ' | ||
+ | | ||
+ | -----------+---------------------+----------+---------+---------------------+--------+--------+-------+-----------+------------------+------------------+---------- | ||
+ | 76930 | 2010-06-21 12:00:00 | 7.6 | 211 | 2010-06-21 12:36:27 | 11 | 0 | 0 | 7.6 | 0110000000100000 | 7000000000000000 | | ||
+ | 76930 | 2010-06-21 13:00:00 | | ||
+ | 76930 | 2010-06-21 14:00:00 | 9.1 | 211 | 2010-06-21 14:24:02 | 22 | 0 | 0 | 9.1 | 0110000000000000 | 7100000400000000 | | ||
+ | (3 rows) | ||
+ | kvalobs=# | ||
+ | </ | ||
+ | |||
+ | Note: After seeing the above info I added CfailedString=" | ||
+ | |||
+ | **NB** Lots of work to be done tuning the control flag settings etc!!! :-) | ||
+ | |||
+ | **NB** Currently only work on data where " | ||
+ | |||
+ | ==== Further testing ==== | ||
+ | |||
+ | ^Step 7 ^Opportunity for ad hoc testing^ | ||
+ | |||
+ | * Rerun the algorithm over a longer time interval, i.e. set Last_NDays to a value > 3 | ||
+ | * Observe output, repeat tests for different controlflag filter settings. | ||
+ | The algorithm checks << | ||
+ | |||
+ | * Set the algorithm to run at the end of the day (at the time of writing it is set to 22:09 UTC). | ||
+ | * During the working day the algorithm has not yet acted on any of the recent data. One can add a missing value for a specific case in the test database and then observe the results later. This is a laborious endeavour but allows very specific tests to be carried out. | ||
+ | |||
+ | ^Step 8 ^Bulk testing^ | ||
+ | |||
+ | On dev-vm101 the directory / | ||
+ | |||
+ | |data-203603-GeneralSingleMissing-P7.dat | ||
+ | |ThreeDays.dat | ||
+ | |||
+ | On each day for all stations the “original” hourly temperature has been set to a missing value -32767 for the times 05:00, 11:00, 17:00 and 23:00 UT and the original value is kept for reference, in curly bracket in CFAILED. | ||
+ | < | ||
+ | |12320|2036-03-01 11: | ||
+ | </ | ||
+ | |||
+ | To use the testdata, clean up old entries in the kvalobs db with commands like: | ||
+ | < | ||
+ | sql> DELETE FROM data WHERE obstime between ' | ||
+ | </ | ||
+ | |||
+ | Reload test data: | ||
+ | < | ||
+ | sql> | ||
+ | </ | ||
+ | |||
+ | And capture results with | ||
+ | < | ||
+ | sql> select * from data WHERE obstime between ' | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | **EXAMPLE TEST** | ||
+ | |||
+ | |8i |Clean up previous entries | | ||
+ | | | ||
+ | | |sql > DELETE FROM data WHERE obstime between ' | ||
+ | |8ii |Load test data | | ||
+ | < | ||
+ | |||
+ | |8iii |/ | ||
+ | | |edit the file to change run time to the next minute, and then: | | ||
+ | | | $ mv / | ||
+ | | |monitor output | ||
+ | | | tail -f / | ||
+ | | |NB This is a heavy test and the log file will fill and rotate, so "Ctrl C" the above command and restart a few times, otherwise it looks like the program has stalled | ||
+ | |8iv |When finished | ||
+ | < | ||
+ | | |Also, put the algorithm back on hold since it will try and run everyday ...| | ||
+ | | | $ mv / | ||
+ | **ANALYSIS** | ||
+ | |||
+ | < | ||
+ | cat FullMissingLinear.dat | grep -v " | ||
+ | </ | ||
+ | |||
+ | |||
+ | The above command just strips out the two columns of data to compare, e.g.just looking at the first lines | ||
+ | < | ||
+ | cat FullMissingLinear.dat | grep -v " | ||
+ | </ | ||
+ | |||
+ | gives: | ||
+ | < | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | FIXME Values to be rounded to 1 decimal place. Investigate and fix. | ||
+ | |||
+ | Then plot in R: (BE CAREFUL copying and pasting the long lines !!!) | ||
+ | |||
+ | < | ||
+ | $ R | ||
+ | FileName=" | ||
+ | dim=100 | ||
+ | |||
+ | UTD <- read.table(FileName, | ||
+ | |||
+ | # | ||
+ | pdf() | ||
+ | plot(UTD[, | ||
+ | # pch=46 for dots | ||
+ | lines(c(-dim, | ||
+ | lines(c(-dim-10, | ||
+ | lines(c(0, | ||
+ | lines(c(-dim-10, | ||
+ | |||
+ | dev.off() | ||
+ | |||
+ | #To exit R: | ||
+ | |||
+ | quit() | ||
+ | |||
+ | # NB the script creates the plot " | ||
+ | </ | ||
+ | |||
+ | {{kvalobs: | ||
+ | |||
+ | More examples of other parameters available at: | ||
+ | |||
+ | ^https:// | ||
+ | --- // |