Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
kvalobs:kvoss:system:qc2:test:acceptance:alg001 [2009-12-20 00:18:21] paule created |
kvalobs:kvoss:system:qc2:test:acceptance:alg001 [2022-05-31 09:29:32] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== ALG001 ====== | ====== ALG001 ====== | ||
- | ===== Acceptance Test For Redistribution of 24 hour accumulated precipitation ===== | ||
+ | ===== Acceptance Test for Redistribution of 24 hour accumulated precipitation ===== | ||
+ | ^Step ^Direction ^Expected Result ^Pass/Fail Criteria or Comment ^ | ||
+ | |001 | Clear all previous data: | -- | -- | | ||
+ | | |$psql kvalobs | -- | -- | | ||
+ | | |psql> DELETE FROM data WHERE obstime>' | ||
+ | |002 |Load the test data, e.g.: | -- | -- | | ||
+ | |||
+ | {{kvalobs: | ||
+ | |||
+ | | |psql> \COPY data FROM '/ | ||
+ | | |Check the copy is successful: | -- | -- | | ||
+ | | | select count(*) from data WHERE obstime>' | ||
+ | |003 | Download the {{kvalobs: | ||
+ | |||
+ | |||
+ | Also edit the config file so that it contains the following text: | ||
+ | < | ||
+ | ... | ||
+ | # Flags to set on successful completion | ||
+ | S_fd=7 | ||
+ | change_fmis=3-> | ||
+ | change_fmis=0-> | ||
+ | |||
+ | ... | ||
+ | </ | ||
+ | (NB this is a recent update) | ||
+ | |||
+ | |004 |Look for results prior to running the control: | -- | -- | | ||
+ | | |select count(*) from data where obstime>' | ||
+ | |005 | Start the kvQc2 daemon and monitor until the algorithm run is complete. | -- | -- | | ||
+ | | |select count(*) from data where obstime>' | ||
+ | < | ||
+ | |006 | Download the following processing and plotting scripts {{kvalobs: | ||
+ | |007 | ./ | ||
+ | | | If files are downloaded from dokit: Please note dokit changes uploaded files to lower case ... an R script, example.R, becomes example.r Also need to "chmod +x" for scripts downloaded from dokit. | -- | -- | | ||
+ | | | On dev-vm116, R is installed but " | ||
+ | |008 | -- | -- | -- | | ||
+ | |009 | -- | -- | -- | | ||
+ | |010 | -- | -- | -- | | ||
+ | |||
+ | Alternative configuration file for performing triangulation interpolation: | ||
+ | |||
+ | |||
+ | ===== Notes ===== | ||
+ | |||
+ | **Prerequisites** | ||
+ | |||
+ | Set up the test data (these are prepatory notes for now for set up on pak} | ||
+ | |||
+ | |||
+ | * $ psql kvalobs | ||
+ | * psql=> DELETE FROM data WHERE obstime>' | ||
+ | * psql=> COPY data FROM '/ | ||
+ | |||
+ | |||
+ | * Run generator.pl commands (current set in / | ||
+ | |||
+ | < | ||
+ | kvalobs@pak: | ||
+ | Welcome to psql 8.3.8, 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=# DELETE FROM data WHERE obstime>' | ||
+ | DELETE 124515 | ||
+ | kvalobs=# COPY data FROM '/ | ||
+ | COPY 124515 | ||
+ | kvalobs=# \q | ||
+ | |||
+ | kvalobs@pak: | ||
+ | 2027.dat | ||
+ | 2047_paramid_110.dat | ||
+ | kvalobs@pak: | ||
+ | |||
+ | Saved the results of the TEST data into a file and made ready for reinsert | ||
+ | |||
+ | | ||
+ | $ ./ | ||
+ | (NB afterwards replace " | ||
+ | $ mv TEST-DATA-2027-SIMULATED.dat.temp 2027ProcessedTestData.dat | ||
+ | |||
+ | |||
+ | Run Qc2 RA_RR24 with triangle interpolation... | ||
+ | |||
+ | kvalobs=# select * from data where obstime>' | ||
+ | </ | ||
+ | |||
+ | {{kvalobs: | ||
+ | |||
+ | {{kvalobs: | ||
+ | |||
+ | NB | ||
+ | < | ||
+ | $ cksum 2027processedtestdata.dat.gz | ||
+ | 1877035137 1486134 2027processedtestdata.dat.gz | ||
+ | </ | ||
+ | |||
+ | {{kvalobs: | ||
+ | |||
+ | {{kvalobs: | ||
+ | |||
+ | generator.pl | ||
+ | < | ||
+ | # | ||
+ | # | ||
+ | # set missing values to -11111 at first and then update them all later | ||
+ | # NB we rely on the -32676 for counting good values ... | ||
+ | # | ||
+ | # Note: to run psql command from the command line: | ||
+ | # | ||
+ | # psql kvalobs -c ' | ||
+ | # psql kvalobs -c " | ||
+ | # echo " | ||
+ | # psql kvalobs -f com.sql | ||
+ | # | ||
+ | # Example use: | ||
+ | # ./ | ||
+ | |||
+ | system(" | ||
+ | system("/ | ||
+ | |||
+ | open (SCRIPT_FILE, | ||
+ | |||
+ | $user_name= getpwuid $>; | ||
+ | |||
+ | if($#ARGV < 4) { | ||
+ | & | ||
+ | exit; | ||
+ | } | ||
+ | |||
+ | |||
+ | $DATE=$ARGV[0]; | ||
+ | $N=$ARGV[1]; | ||
+ | $STID=$ARGV[2]; | ||
+ | $TID=$ARGV[3]; | ||
+ | $PID=$ARGV[4]; | ||
+ | |||
+ | # substr(controlinfo, | ||
+ | |||
+ | $M=$N-1; | ||
+ | |||
+ | $UP1=" | ||
+ | |||
+ | $UP2=" | ||
+ | |||
+ | print SCRIPT_FILE " | ||
+ | print SCRIPT_FILE $UP1," | ||
+ | print SCRIPT_FILE " | ||
+ | print SCRIPT_FILE $UP2," | ||
+ | |||
+ | for ($i=1; $i < $N; $i++){ | ||
+ | $j=$i-1; | ||
+ | print SCRIPT_FILE " | ||
+ | print SCRIPT_FILE " | ||
+ | print SCRIPT_FILE " | ||
+ | print SCRIPT_FILE " | ||
+ | } | ||
+ | |||
+ | print SCRIPT_FILE " | ||
+ | print SCRIPT_FILE " | ||
+ | print SCRIPT_FILE " | ||
+ | |||
+ | |||
+ | |||
+ | close (SCRIPT_FILE); | ||
+ | |||
+ | system(" | ||
+ | |||
+ | ## ---------------------------------------------------- | ||
+ | |||
+ | sub shouldo { | ||
+ | |||
+ | (" | ||
+ | Hi $user_name, usage is: | ||
+ | $0 \" | ||
+ | |||
+ | e.g. ./ | ||
+ | |||
+ | ") | ||
+ | } | ||
+ | |||
+ | ## ---------------------------------------------------- | ||
+ | </ | ||
+ | |||
+ | {{kvalobs: | ||
+ | |||
+ | |||
+ | ====== Further Investigations ====== | ||
+ | |||
+ | It is possible to use the script generator.pl modify some real data and substitute missing values and an accummulated value, while also storing the original values. (NB copy and paste generator.pl from the listing above). | ||
+ | ^Step ^Direction ^Expected Result ^Pass/Fail Criteria or Comment ^ | ||
+ | |I |Select candidate data. One needs a start time and a number of days interval. | -- | -- | | ||
+ | |II |Run " | ||
+ | | | | ||
+ | | |Repeat as many times as required to build test data. | -- | -- | | ||
+ | |III |Run the algorithm and analyse the results. | -- | -- | | ||
+ | |||
+ | |||
+ | |||
+ | ===== For example: ===== | ||
+ | |||
+ | |||
+ | **Before** | ||
+ | |||
+ | < | ||
+ | 58390 | 2032-03-02 06:00:00 | 0.3 | 110 | 2032-03-02 06:25:19 | 302 | 0 | 0 | 0.3 | 1110000000001001 | 3000000000000070 | | ||
+ | 58390 | 2032-03-03 06:00:00 | 4.5 | 110 | 2032-03-03 06:10:32 | 302 | 0 | 0 | 4.5 | 1110000000001001 | 3000000000000070 | | ||
+ | 58390 | 2032-03-04 06:00:00 | 2.5 | 110 | 2032-03-04 06:10:54 | 302 | 0 | 0 | 2.5 | 1110000000001000 | 7000000000000000 | | ||
+ | 58390 | 2032-03-05 06:00:00 | 8.5 | 110 | 2032-03-05 06:25:24 | 302 | 0 | 0 | 8.5 | 1110000000001000 | 7000000000000000 | | ||
+ | 58390 | 2032-03-06 06:00:00 | 7 | 110 | 2032-03-06 06:25:24 | 302 | 0 | 0 | 7 | 1110000000001000 | 7000000000000000 | | ||
+ | 58390 | 2032-03-07 06:00:00 | 0.2 | 110 | 2032-03-07 06:25:21 | 302 | 0 | 0 | 0.2 | 1110000000001000 | 7000000000000000 | | ||
+ | 58390 | 2032-03-08 06:00:00 | -1 | 110 | 2032-03-08 06:25:17 | 302 | 0 | 0 | -1 | 1110000000001000 | 7000000000000000 | | ||
+ | 58390 | 2032-03-09 06:00:00 | 2.4 | 110 | 2032-03-09 06:06:31 | 302 | 0 | 0 | 2.4 | 1110000000001000 | 7000000000000000 | | ||
+ | 58390 | 2032-03-10 06:00:00 | 2.2 | 110 | 2032-03-10 06:25:20 | 302 | 0 | 0 | 2.2 | 1110000000001001 | 3000000000000070 | | ||
+ | |||
+ | </ | ||
+ | |||
+ | **Command** | ||
+ | < | ||
+ | ./ | ||
+ | </ | ||
+ | |||
+ | |||
+ | **After** | ||
+ | < | ||
+ | 58390 | 2032-03-02 06:00:00 | 0.3 | 110 | 2032-03-02 06:25:19 | 302 | 0 | 0 | 0.3 | 1110000000001001 | 3000000000000070 | | ||
+ | 58390 | 2032-03-03 06:00:00 | | ||
+ | 58390 | 2032-03-04 06:00:00 | | ||
+ | 58390 | 2032-03-05 06:00:00 | | ||
+ | 58390 | 2032-03-06 06:00:00 | | ||
+ | 58390 | 2032-03-07 06:00:00 | | ||
+ | 58390 | 2032-03-08 06:00:00 | | ||
+ | 58390 | 2032-03-09 06:00:00 | 25.1 | 110 | 2032-03-09 06:06:31 | 302 | 0 | 0 | 2.4 | 9999999999992990 | 7000000000000000 | TEST-DATA-RA_RR24 original=2.4 | ||
+ | 58390 | 2032-03-10 06:00:00 | 2.2 | 110 | 2032-03-10 06:25:20 | 302 | 0 | 0 | 2.2 | 1110000000001001 | 3000000000000070 | | ||
+ | |||
+ | </ |