diff --git a/inst/shiny/WQReviewGUI/www/WQReviewGUI.html b/inst/shiny/WQReviewGUI/www/WQReviewGUI.html index b0979db..6de3f96 100644 --- a/inst/shiny/WQReviewGUI/www/WQReviewGUI.html +++ b/inst/shiny/WQReviewGUI/www/WQReviewGUI.html @@ -1,18 +1,16 @@ - - - - + + - - - + - + -WQReview GUI + + +WQReview GUI User Guide @@ -43,166 +41,151 @@ - + - + - +
-
-

Introduction

-

Toolbox for discrete water-quality data review and exploration.Users are encouraged to post any bugs or comments for additional functionality on the issues page at:

-

WQ-Review Issues.

-

This package facilitates data review and exploration of discrete water-quality data through rapid and easy-to-use plotting functions and tabular data summaries. Data is imported with user-specified options for single or multiple sites and parameter codes using an ODBC connection to the user’s local NWIS server. A graphical user interface allows the user to easily explore their data through a variety of graphical and tabular outputs.

-

Screenshot

-
-

Requirements

- -
-
-

Bug reporting and enhancements

-

Please report any issues with the application or R package on the issues page at:

-

WQ-Review Issues.

-

Additionaly, please feel free to post any suggestions or enhancement requests.

-

Your participation will make this a better tool for everyone!

-
-
-

Installation for stand alone application (non-R users)

-
    -
  1. Download the application at
  2. -
-

ftp://ftpint.usgs.gov/private/cr/co/lakewood/tmills/wqReviewSetup.exe

-
    -
  1. Run wqReviewSetup.exe and follow the installation instructions.
  2. -
-

DO NOT INSTALL WQ-REVIEW INTO YOUR PROGRAM FILES DIRECTORY OR THE APPLICATION WILL NOT RUN. INSTALL TO C DRIVE OR YOUR DOCUMENTS FOLDER.

-
    -
  1. Update WQ-Review to the latest version either by clicking the checkbox at the end of the setup, or by going to Startmenu->Programs->WQ-Review->Update. A command prompt window will appear and stay open until the update is complete. When the update is complete it will close with no other prompts.
  2. -
-
-
-

Installation for R users

-
-

Step 1. Switch over to 32-bit R.

-

R must be run in 32-bit mode to use the ODBC driver. Open R-studio and click Tools-Global Options on the top toolbar. Under “General” in the global options dialog, you will see “R version:” at the top. Click “Change” next to the R version and select “Use your machine’s default version of R (32 bit)” to change to 32-bit R. R-studio will need to restart after doing this.

-
-
-

Step 2. Install the “devtools” package for installing WQ-Review directly from Github.

-

Open R-studio in 32-bit mode if it is not already open and type the following command in the console:

-
install.packages(c("curl","devtools"))
-

This will install the devtools package on your machine.

-

If an error appears about “Rtools not installed”, ignore this message, Rtools is not required for the devtools functions you will use.

-
-
-

Step 3. Install the WQ-Review package from Github.

-

Open R-studio in 32-bit mode if it is not already open and type the following commands in the console:

-
library(devtools)
-install_github("USGS-R/WQ-Review",build_vignettes = TRUE)
-

This will install the WQ-Review package as well as all other packages that WQ-Review relies on. It may take a minute to download and install the supporting packages during the first installation.

-
-
-

Run the app

-

The shiny app is launched by loading the WQ-Review package and running the function

-
library(WQReview)
-WQReviewGUI()
-
-
-
-

Guidance for setting up ODBC connection to NWIS

-

Your database administrator or IT specialist will may need to assist for these steps.

-
-

Step 1

-

You need to setup a user Data Source Name (User DSN). On 64bit Windows 7 and 8, run “C:/Windows/SysWOW64/odbcad32.exe”.

-

On 32bit Windows 7 and 8, run “C:/Windows/System32/odbcad32.exe”.

-

In the User DSN tab, if you do not see a connection with the same name as your NWIS server of interest, you must add a new connection. Click “Add” on the right.

-

Screenshot

-
-
-

Step 2

-

Scroll down until you see a driver named “Oracle in OraClient11g_home1” and click “Finish”. IF YOU DO NOT SEE THE ABOVE DRIVER LISTED, IT IS NOT INSTALLED AND YOU WILL NEED ASSISTANCE FROM AN IT SPECIALIST TO INSTALL IT, THE LINK TO GUIDANCE IS PROVIDED BELOW

-

Screenshot

-
-
-

Step 3

-

A new dialogue will appear. Click the dropdown box next to “TNS Service Name” and select the NWIS server you would like to connect to. After selecting the server, type in the server name into the “Data Source Name” text box at the top. DO NOT ENTER A USER ID, LEAVE THIS FIELD BLANK. You are finished, click OK to close the dialogue and then click OK in the main ODBC Data Source Administrator application to close the application.

-

Screenshot

-
-
-

If you do not have the driver installed

-

Install the Oracle client by following the instructions here:

-

http://nwis.usgs.gov/IT/ORACLE/Oracle.client.installation.htm

-

Then follow the instructions to setup the system DSN

-

http://nwis.usgs.gov/IT/INSTRUCT/HOWTO/DB_oracle_odbc.html

-

The ODBC connection must be setup for Oracle and in 32-bit mode.

-
-
-

Importing Data

This will describe the process for importing data into the WQReview Graphical User Interface (GUI). We will start by importing data for a single site using predefined NWIS parameter groups. ##Load the WQReview package and open the WQReview GUI

@@ -282,7 +265,7 @@

Selecting data to plot

Global plot controls

New data threshold

-

Point data in all plots can be labeled as “New” data based off of when that data was last modified using the “New data threshold” slider. Any data modified after the date indicated on the slider will be labeled as “New”. This helps identify data that has not been reviewed from historic data when the data are not displayed as a timeseries. Note that the “New data threshold” is set off of when the data were last modified for result-level plots (e.g. timeseries, seasonal, etc.) not when they were created. Sample-level plots (e.g. charge balance) are labeled new according to the sample collection date.

+

Point data in all plots can be labeled as “New” data based off of when that data was last modified using the “New data threshold” slider. Any data modified after the date indicated on the slider will be labeled as “New”. This helps identify data that has not been reviewed from historic data when the data are not displayed as a timeseries. Note that the “New data threshold” is set off of when the data were last modified for result-level plots (e.g. timeseries, seasonal, etc.) not when they were created. Sample-level plots (e.g. charge balance) are labeled new according to the sample collection date.

Record highlights

@@ -459,7 +442,7 @@

Plot controls

Ions vs conductance

This pane generates a x-y plot of sum of cations or anions vs conductance. The ratio of the sum of cations or anions vs specific conductance generally falls within a range of 0.92 - 1.24 for natural waters. The shaded region on the plot indicates this typical range. These are the values used in QWData for alert limits, see QWData documentation and references therein for further explanation.

-

At many sites, there will be a roughly linear relationship between the sum of cations or anions vs. conductance. If a point falls above or below the general trend line, this is an indication that the particular group of ions is either to low or too high.

+

At many sites, there will be a roughly linear relationship between the sum of cations or anions vs. conductance. If a point falls above or below the general trend line, this is an indication that the particular group of ions is either to low or too high.

Uses

    @@ -543,7 +526,7 @@

    Tables

    This section will describe the various tables generated by the WQReview GUI. The WQ-Review GUI produces 2 general classes of tables: Auto-flag results, and data/QAQC tables. All tables can be downloaded as tab-delimited text files by clicking on the download button above each table. All tables are sortable by clicking on the header, and the number of entries per table page is adjusted using hte “show entries” dropdown. Additionally, all tables can be filtered using the search bar. Typing a value into the searchbar will search the table columns for that value and subset the table to only those rows containing the search value. For example, typing “WSQ” into the search bar will filter the table to only replicate samples.

    Auto-flagged samples

    -

    During data import, samples or results are auto-flagged following criteria developed by NAWQA for all water-quality data, and are defined here. For any flags comparing a current sample to historic data, the current sample is compared to all REVIEWED AND ACCEPTED data rather than prior samples in time. This is because data that have not been reviewed and accepted could themselves be problematic.

    +

    During data import, samples or results are auto-flagged following criteria developed by NAWQA for all water-quality data, and are defined at the end of this manual. For any flags comparing a current sample to historic data, the current sample is compared to all REVIEWED AND ACCEPTED data rather than prior samples in time. This is because data that have not been reviewed and accepted could themselves be problematic.

    Basic chemical flags

    This table contains basic chemical checks similar to those provided by the QWDATA unix software. The first 6 columns contain sample-level information and the remaining columns contain flags wit hthe column name coorresponding to the particular data check. If a sample fails a given data check, a flag is applied to the respective column for that sample.

    @@ -561,6 +544,53 @@

    Results flags

    Data and QAQC tables

    These tables are controlled similarly to the auto-flagged tables except that they can be generated according to site and date selection criteria. These tables include standard data tables, a wide (sample-result) and a long (by result) format table. 4 QAQC tables are also presented, including a chargebalance table, a table of replicate agreement, a summary table of blank detections, and a table comparing filtered ot unfiltered values. The last column of each of these QAQC tables contains a column with flags if a particular sample violates some standard QAQC measure. For example, a sample with a charge imbalance > 10% would get a flag in the final column of hte chargebalance table. The blank summary table is calculated on the fly given the input criteria For example, leaving the default date range (last 3 years) in the blank table input and selecting a site would summarize the blank detections for that 3 year period for that site.

    +
    +

    Flag descriptions

    +
    +

    SC_badLabVSField

    +

    The difference between Lab SC (90095) and field SC (00095) is greater than 10%

    +
    +
    +

    30.01.

    +

    pH lower than expected Every water-quality sample (environmental and QC) had its pH (p00400) checked for appropriate ranges. If the pH value is less than 4.5, the sample is flagged for 30.01.

    +
    +
    +

    30.02. pH higher than expected

    +

    Every water-quality sample (environmental and QC) had its pH (p00400) checked for appropriate ranges. If the pH value is higher than 9, the sample is flagged for 30.02.

    +
    +
    +

    30.03. Dissolved Oxygen higher than expected

    +

    Every water-quality sample (environmental and QC) had its dissolved oxygen (p00300) checked for appropriate ranges. If the D.O. value is higher than 25, the sample is flagged for 30.03.

    +
    +
    +

    30.11. Greater than max value in old data

    +

    New Environmental samples are compared to “old” environmental samples at the same site from water-year 1996 and later, for pesticides, nutrients, field parameters, and major ions. When a parameter has 5 or more “old” values at the site, and a new sample has a new maximum for that parameter, that sample and parameter are flagged for 30.11. Pesticides in Schedule 2437 which existed in the earlier schedules 2033 or 2060 (under different pcodes) are compared to the older pcodes as well as the Schedule 2437 pcodes.

    +
    +
    +

    30.12. Less than min value in old data

    +

    New Environmental samples are compared to “old” environmental samples at the same site from water-year 1996 and later, for pesticides, nutrients, field parameters, and major ions. When a parameter has 5 or more “old” values at the site, and a new sample has a new minimum for that parameter, that sample and parameter are flagged for 30.12. Pesticides in Schedule 2437 which existed in the earlier schedules 2033 or 2060 (under different pcodes) are compared to the older pcodes as well as the Schedule 2437 pcodes.

    +
    +
    +

    30.13. Schedule 2437 Pesticide hits greater than max hits in old data

    +

    The number of Schedule 2437 pesticide hits in new environmental samples is compared to 2437 pesticide hits in “old” environmental samples at the same site from water-year 2013 and later (the year Schedule 2437 began). When a site has 5 or more “old” pesticide samples and a new sample has a new maximum number of pesticide hits, that sample is flagged for 30.13. Only pesticides in Schedule 2437 are counted as hits.

    +
    +
    +

    30.14 Less than minimum pesticide hits in old data

    +

    The number of Schedule 2437 pesticide hits in new environmental samples is compared to 2437 pesticide hits in “old” environmental samples at the same site from water-year 2013 and later (the year Schedule 2437 began). When a site has five or more “old” pesticide samples and a new sample has a new minimum number of pesticide hits, that sample is flagged for 30.14. Only pesticides in Schedule 2437 are counted as hits.

    +
    +
    +

    30.15. Greater than 99p in old data

    +

    New Environmental samples are compared to “old” environmental samples at the same site from water-year 1996 and later, for pesticides, nutrients, field parameters, and major ions. When a parameter has 24 or more “old” values at the site, and a new sample has a value greater than the 99th percentile of the “old” data set for that parameter, that sample and parameter are flagged for 30.15. Pesticides in Schedule 2437 which existed in the earlier schedules 2033 or 2060 (under different pcodes) are compared to the older pcodes as well as the Schedule 2437 pcodes.

    +
    +
    +

    30.16. Less than 1p in old data

    +

    New Environmental samples are compared to “old” environmental samples at the same site from water-year 1996 and later, for pesticides, nutrients, field parameters, and major ions. When a parameter has 24 or more “old” values at the site, and a new sample has a value less than the 1st percentile of the “old” data set for that parameter, that sample and parameter are flagged for 30.15. Pesticides in Schedule 2437 which existed in the earlier schedules 2033 or 2060 (under different pcodes) are compared to the older pcodes as well as the Schedule 2437 pcodes.

    +
    +
    +

    30.21. Questionable cation-anion balance

    +

    For each environmental sample, the cation-anion percent difference was be calculated (using the same formula, but a slightly simpler procedure, than what NWIS-QWDATA uses) and compared to the value for specific conductance (P00095). The cation-anion ballance is flagged for 30.21 if any of the following conditions is true 1. specific conductance is less than or equal to 100 microsiemens/cm, AND percent difference is greater (in absolute value) than +/- 15 percent 2. specific conductance is greater than 100 and less than or equal to 1000 microsiemens/cm, AND percent difference is greater (in absolute value) than +/- 10 percent 3. specific conductance is greater than 1000 microsiemens/cm, AND percent difference is greater (in absolute value) than +/- 5 percent

    +
    +
    @@ -575,5 +605,6 @@

    Data and QAQC tables

    })(); - - + + + \ No newline at end of file diff --git a/inst/shiny/WQReviewGUI/www/WQReviewGUI_files/MathJax.js b/inst/shiny/WQReviewGUI/www/WQReviewGUI_files/MathJax.js new file mode 100644 index 0000000..b90b288 --- /dev/null +++ b/inst/shiny/WQReviewGUI/www/WQReviewGUI_files/MathJax.js @@ -0,0 +1,19 @@ +/* + * /MathJax.js + * + * Copyright (c) 2009-2015 The MathJax Consortium + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +if(document.getElementById&&document.childNodes&&document.createElement){if(!(window.MathJax&&MathJax.Hub)){if(window.MathJax){window.MathJax={AuthorConfig:window.MathJax}}else{window.MathJax={}}MathJax.isPacked=true;MathJax.version="2.5";MathJax.fileversion="2.5.3";MathJax.cdnVersion="2.5.3";MathJax.cdnFileVersions={};(function(d){var b=window[d];if(!b){b=window[d]={}}var e=[];var c=function(f){var g=f.constructor;if(!g){g=function(){}}for(var h in f){if(h!=="constructor"&&f.hasOwnProperty(h)){g[h]=f[h]}}return g};var a=function(){return function(){return arguments.callee.Init.call(this,arguments)}};b.Object=c({constructor:a(),Subclass:function(f,h){var g=a();g.SUPER=this;g.Init=this.Init;g.Subclass=this.Subclass;g.Augment=this.Augment;g.protoFunction=this.protoFunction;g.can=this.can;g.has=this.has;g.isa=this.isa;g.prototype=new this(e);g.prototype.constructor=g;g.Augment(f,h);return g},Init:function(f){var g=this;if(f.length===1&&f[0]===e){return g}if(!(g instanceof f.callee)){g=new f.callee(e)}return g.Init.apply(g,f)||g},Augment:function(f,g){var h;if(f!=null){for(h in f){if(f.hasOwnProperty(h)){this.protoFunction(h,f[h])}}if(f.toString!==this.prototype.toString&&f.toString!=={}.toString){this.protoFunction("toString",f.toString)}}if(g!=null){for(h in g){if(g.hasOwnProperty(h)){this[h]=g[h]}}}return this},protoFunction:function(g,f){this.prototype[g]=f;if(typeof f==="function"){f.SUPER=this.SUPER.prototype}},prototype:{Init:function(){},SUPER:function(f){return f.callee.SUPER},can:function(f){return typeof(this[f])==="function"},has:function(f){return typeof(this[f])!=="undefined"},isa:function(f){return(f instanceof Object)&&(this instanceof f)}},can:function(f){return this.prototype.can.call(this,f)},has:function(f){return this.prototype.has.call(this,f)},isa:function(g){var f=this;while(f){if(f===g){return true}else{f=f.SUPER}}return false},SimpleSUPER:c({constructor:function(f){return this.SimpleSUPER.define(f)},define:function(f){var h={};if(f!=null){for(var g in f){if(f.hasOwnProperty(g)){h[g]=this.wrap(g,f[g])}}if(f.toString!==this.prototype.toString&&f.toString!=={}.toString){h.toString=this.wrap("toString",f.toString)}}return h},wrap:function(i,h){if(typeof(h)!=="function"||!h.toString().match(/\.\s*SUPER\s*\(/)){return h}var g=function(){this.SUPER=g.SUPER[i];try{var f=h.apply(this,arguments)}catch(j){delete this.SUPER;throw j}delete this.SUPER;return f};g.toString=function(){return h.toString.apply(h,arguments)};return g}})})})("MathJax");(function(BASENAME){var BASE=window[BASENAME];if(!BASE){BASE=window[BASENAME]={}}var CALLBACK=function(data){var cb=function(){return arguments.callee.execute.apply(arguments.callee,arguments)};for(var id in CALLBACK.prototype){if(CALLBACK.prototype.hasOwnProperty(id)){if(typeof(data[id])!=="undefined"){cb[id]=data[id]}else{cb[id]=CALLBACK.prototype[id]}}}cb.toString=CALLBACK.prototype.toString;return cb};CALLBACK.prototype={isCallback:true,hook:function(){},data:[],object:window,execute:function(){if(!this.called||this.autoReset){this.called=!this.autoReset;return this.hook.apply(this.object,this.data.concat([].slice.call(arguments,0)))}},reset:function(){delete this.called},toString:function(){return this.hook.toString.apply(this.hook,arguments)}};var ISCALLBACK=function(f){return(typeof(f)==="function"&&f.isCallback)};var EVAL=function(code){return eval.call(window,code)};var TESTEVAL=function(){EVAL("var __TeSt_VaR__ = 1");if(window.__TeSt_VaR__){try{delete window.__TeSt_VaR__}catch(error){window.__TeSt_VaR__=null}}else{if(window.execScript){EVAL=function(code){BASE.__code=code;code="try {"+BASENAME+".__result = eval("+BASENAME+".__code)} catch(err) {"+BASENAME+".__result = err}";window.execScript(code);var result=BASE.__result;delete BASE.__result;delete BASE.__code;if(result instanceof Error){throw result}return result}}else{EVAL=function(code){BASE.__code=code;code="try {"+BASENAME+".__result = eval("+BASENAME+".__code)} catch(err) {"+BASENAME+".__result = err}";var head=(document.getElementsByTagName("head"))[0];if(!head){head=document.body}var script=document.createElement("script");script.appendChild(document.createTextNode(code));head.appendChild(script);head.removeChild(script);var result=BASE.__result;delete BASE.__result;delete BASE.__code;if(result instanceof Error){throw result}return result}}}TESTEVAL=null};var USING=function(args,i){if(arguments.length>1){if(arguments.length===2&&!(typeof arguments[0]==="function")&&arguments[0] instanceof Object&&typeof arguments[1]==="number"){args=[].slice.call(args,i)}else{args=[].slice.call(arguments,0)}}if(args instanceof Array&&args.length===1){args=args[0]}if(typeof args==="function"){if(args.execute===CALLBACK.prototype.execute){return args}return CALLBACK({hook:args})}else{if(args instanceof Array){if(typeof(args[0])==="string"&&args[1] instanceof Object&&typeof args[1][args[0]]==="function"){return CALLBACK({hook:args[1][args[0]],object:args[1],data:args.slice(2)})}else{if(typeof args[0]==="function"){return CALLBACK({hook:args[0],data:args.slice(1)})}else{if(typeof args[1]==="function"){return CALLBACK({hook:args[1],object:args[0],data:args.slice(2)})}}}}else{if(typeof(args)==="string"){if(TESTEVAL){TESTEVAL()}return CALLBACK({hook:EVAL,data:[args]})}else{if(args instanceof Object){return CALLBACK(args)}else{if(typeof(args)==="undefined"){return CALLBACK({})}}}}}throw Error("Can't make callback from given data")};var DELAY=function(time,callback){callback=USING(callback);callback.timeout=setTimeout(callback,time);return callback};var WAITFOR=function(callback,signal){callback=USING(callback);if(!callback.called){WAITSIGNAL(callback,signal);signal.pending++}};var WAITEXECUTE=function(){var signals=this.signal;delete this.signal;this.execute=this.oldExecute;delete this.oldExecute;var result=this.execute.apply(this,arguments);if(ISCALLBACK(result)&&!result.called){WAITSIGNAL(result,signals)}else{for(var i=0,m=signals.length;i0&&priority=0;i--){this.hooks.splice(i,1)}this.remove=[]}});var EXECUTEHOOKS=function(hooks,data,reset){if(!hooks){return null}if(!(hooks instanceof Array)){hooks=[hooks]}if(!(data instanceof Array)){data=(data==null?[]:[data])}var handler=HOOKS(reset);for(var i=0,m=hooks.length;ig){g=document.styleSheets.length}if(!i){i=document.head||((document.getElementsByTagName("head"))[0]);if(!i){i=document.body}}return i};var f=[];var c=function(){for(var k=0,j=f.length;k=this.timeout){i(this.STATUS.ERROR);return 1}return 0},file:function(j,i){if(i<0){a.Ajax.loadTimeout(j)}else{a.Ajax.loadComplete(j)}},execute:function(){this.hook.call(this.object,this,this.data[0],this.data[1])},checkSafari2:function(i,j,k){if(i.time(k)){return}if(document.styleSheets.length>j&&document.styleSheets[j].cssRules&&document.styleSheets[j].cssRules.length){k(i.STATUS.OK)}else{setTimeout(i,i.delay)}},checkLength:function(i,l,n){if(i.time(n)){return}var m=0;var j=(l.sheet||l.styleSheet);try{if((j.cssRules||j.rules||[]).length>0){m=1}}catch(k){if(k.message.match(/protected variable|restricted URI/)){m=1}else{if(k.message.match(/Security error/)){m=1}}}if(m){setTimeout(a.Callback([n,i.STATUS.OK]),0)}else{setTimeout(i,i.delay)}}},loadComplete:function(i){i=this.fileURL(i);var j=this.loading[i];if(j&&!j.preloaded){a.Message.Clear(j.message);clearTimeout(j.timeout);if(j.script){if(f.length===0){setTimeout(c,0)}f.push(j.script)}this.loaded[i]=j.status;delete this.loading[i];this.addHook(i,j.callback)}else{if(j){delete this.loading[i]}this.loaded[i]=this.STATUS.OK;j={status:this.STATUS.OK}}if(!this.loadHooks[i]){return null}return this.loadHooks[i].Execute(j.status)},loadTimeout:function(i){if(this.loading[i].timeout){clearTimeout(this.loading[i].timeout)}this.loading[i].status=this.STATUS.ERROR;this.loadError(i);this.loadComplete(i)},loadError:function(i){a.Message.Set(["LoadFailed","File failed to load: %1",i],null,2000);a.Hub.signal.Post(["file load error",i])},Styles:function(k,l){var i=this.StyleString(k);if(i===""){l=a.Callback(l);l()}else{var j=document.createElement("style");j.type="text/css";this.head=h(this.head);this.head.appendChild(j);if(j.styleSheet&&typeof(j.styleSheet.cssText)!=="undefined"){j.styleSheet.cssText=i}else{j.appendChild(document.createTextNode(i))}l=this.timer.create.call(this,l,j)}return l},StyleString:function(n){if(typeof(n)==="string"){return n}var k="",o,m;for(o in n){if(n.hasOwnProperty(o)){if(typeof n[o]==="string"){k+=o+" {"+n[o]+"}\n"}else{if(n[o] instanceof Array){for(var l=0;l="0"&&p<="9"){f[j]=o[f[j]-1];if(typeof f[j]==="number"){f[j]=this.number(f[j])}}else{if(p==="{"){p=f[j].substr(1);if(p>="0"&&p<="9"){f[j]=o[f[j].substr(1,f[j].length-2)-1];if(typeof f[j]==="number"){f[j]=this.number(f[j])}}else{var k=f[j].match(/^\{([a-z]+):%(\d+)\|(.*)\}$/);if(k){if(k[1]==="plural"){var d=o[k[2]-1];if(typeof d==="undefined"){f[j]="???"}else{d=this.plural(d)-1;var h=k[3].replace(/(^|[^%])(%%)*%\|/g,"$1$2%\uEFEF").split(/\|/);if(d>=0&&d=3){c.push([f[0],f[1],this.processSnippet(g,f[2])])}else{c.push(e[d])}}}}else{c.push(e[d])}}return c},markdownPattern:/(%.)|(\*{1,3})((?:%.|.)+?)\2|(`+)((?:%.|.)+?)\4|\[((?:%.|.)+?)\]\(([^\s\)]+)\)/,processMarkdown:function(b,h,d){var j=[],e;var c=b.split(this.markdownPattern);var g=c[0];for(var f=1,a=c.length;f1?d[1]:""));f=null}if(e&&(!b.preJax||d)){c.nodeValue=c.nodeValue.replace(b.postJax,(e.length>1?e[1]:""))}if(f&&!f.nodeValue.match(/\S/)){f=f.previousSibling}}if(b.preRemoveClass&&f&&f.className===b.preRemoveClass){a.MathJax.preview=f}a.MathJax.checked=1},processInput:function(a){var b,i=MathJax.ElementJax.STATE;var h,e,d=a.scripts.length;try{while(a.ithis.processUpdateTime&&a.i1){d.jax[a.outputJax].push(b)}b.MathJax.state=c.OUTPUT},prepareOutput:function(c,f){while(c.jthis.processUpdateTime&&h.i=0;p--){if((b[p].src||"").match(e)){r.script=b[p].innerHTML;if(RegExp.$2){var s=RegExp.$2.substr(1).split(/\&/);for(var o=0,k=s.length;o=parseInt(x[y])}}return true},Select:function(j){var i=j[c.Browser];if(i){return i(c.Browser)}return null}};var d=h.replace(/^Mozilla\/(\d+\.)+\d+ /,"").replace(/[a-z][-a-z0-9._: ]+\/\d+[^ ]*-[^ ]*\.([a-z][a-z])?\d+ /i,"").replace(/Gentoo |Ubuntu\/(\d+\.)*\d+ (\([^)]*\) )?/,"");c.Browser=c.Insert(c.Insert(new String("Unknown"),{version:"0.0"}),a);for(var u in a){if(a.hasOwnProperty(u)){if(a[u]&&u.substr(0,2)==="is"){u=u.slice(2);if(u==="Mac"||u==="PC"){continue}c.Browser=c.Insert(new String(u),a);var q=new RegExp(".*(Version/| Trident/.*; rv:)((?:\\d+\\.)+\\d+)|.*("+u+")"+(u=="MSIE"?" ":"/")+"((?:\\d+\\.)*\\d+)|(?:^|\\(| )([a-z][-a-z0-9._: ]+|(?:Apple)?WebKit)/((?:\\d+\\.)+\\d+)");var t=q.exec(d)||["","","","unknown","0.0"];c.Browser.name=(t[1]!=""?u:(t[3]||t[5]));c.Browser.version=t[2]||t[4]||t[6];break}}}c.Browser.Select({Safari:function(j){var i=parseInt((String(j.version).split("."))[0]);if(i>85){j.webkit=j.version}if(i>=538){j.version="8.0"}else{if(i>=537){j.version="7.0"}else{if(i>=536){j.version="6.0"}else{if(i>=534){j.version="5.1"}else{if(i>=533){j.version="5.0"}else{if(i>=526){j.version="4.0"}else{if(i>=525){j.version="3.1"}else{if(i>500){j.version="3.0"}else{if(i>400){j.version="2.0"}else{if(i>85){j.version="1.0"}}}}}}}}}}j.webkit=(navigator.appVersion.match(/WebKit\/(\d+)\./))[1];j.isMobile=(navigator.appVersion.match(/Mobile/i)!=null);j.noContextMenu=j.isMobile},Firefox:function(j){if((j.version==="0.0"||h.match(/Firefox/)==null)&&navigator.product==="Gecko"){var m=h.match(/[\/ ]rv:(\d+\.\d.*?)[\) ]/);if(m){j.version=m[1]}else{var i=(navigator.buildID||navigator.productSub||"0").substr(0,8);if(i>="20111220"){j.version="9.0"}else{if(i>="20111120"){j.version="8.0"}else{if(i>="20110927"){j.version="7.0"}else{if(i>="20110816"){j.version="6.0"}else{if(i>="20110621"){j.version="5.0"}else{if(i>="20110320"){j.version="4.0"}else{if(i>="20100121"){j.version="3.6"}else{if(i>="20090630"){j.version="3.5"}else{if(i>="20080617"){j.version="3.0"}else{if(i>="20061024"){j.version="2.0"}}}}}}}}}}}}j.isMobile=(navigator.appVersion.match(/Android/i)!=null||h.match(/ Fennec\//)!=null||h.match(/Mobile/)!=null)},Opera:function(i){i.version=opera.version()},MSIE:function(j){j.isIE9=!!(document.documentMode&&(window.performance||window.msPerformance));MathJax.HTML.setScriptBug=!j.isIE9||document.documentMode<9;MathJax.Hub.msieHTMLCollectionBug=(document.documentMode<9);if(document.documentMode<10&&!r.params.NoMathPlayer){try{new ActiveXObject("MathPlayer.Factory.1");j.hasMathPlayer=true}catch(m){}try{if(j.hasMathPlayer){var i=document.createElement("object");i.id="mathplayer";i.classid="clsid:32F66A20-7614-11D4-BD11-00104BD3F987";f.appendChild(i);document.namespaces.add("m","http://www.w3.org/1998/Math/MathML");j.mpNamespace=true;if(document.readyState&&(document.readyState==="loading"||document.readyState==="interactive")){document.write('');j.mpImported=true}}else{document.namespaces.add("mjx_IE_fix","http://www.w3.org/1999/xlink")}}catch(m){}}}});c.Browser.Select(MathJax.Message.browsers);if(g.AuthorConfig&&typeof g.AuthorConfig.AuthorInit==="function"){g.AuthorConfig.AuthorInit()}c.queue=g.Callback.Queue();c.queue.Push(["Post",r.signal,"Begin"],["Config",r],["Cookie",r],["Styles",r],["Message",r],function(){var i=g.Callback.Queue(r.Jax(),r.Extensions());return i.Push({})},["Menu",r],r.onLoad(),function(){MathJax.isReady=true},["Typeset",r],["Hash",r],["MenuZoom",r],["Post",r.signal,"End"])})("MathJax")}}; diff --git a/vignettes/WQReviewGUI.Rmd b/vignettes/WQReviewGUI.Rmd index d1e8f41..8af6fd0 100644 --- a/vignettes/WQReviewGUI.Rmd +++ b/vignettes/WQReviewGUI.Rmd @@ -304,7 +304,7 @@ This pane generates a plot of parameter values for blank samples over time. This section will describe the various tables generated by the WQReview GUI. The WQ-Review GUI produces 2 general classes of tables: Auto-flag results, and data/QAQC tables. All tables can be downloaded as tab-delimited text files by clicking on the download button above each table. All tables are sortable by clicking on the header, and the number of entries per table page is adjusted using hte "show entries" dropdown. Additionally, all tables can be filtered using the search bar. Typing a value into the searchbar will search the table columns for that value and subset the table to only those rows containing the search value. For example, typing "WSQ" into the search bar will filter the table to only replicate samples. ##Auto-flagged samples -During data import, samples or results are auto-flagged following criteria developed by NAWQA for all water-quality data, and are defined [here](http://internal.cida.usgs.gov/NAWQA/data_checks/docs/files/check30-sql.html). For any flags comparing a current sample to historic data, the current sample is compared to all REVIEWED AND ACCEPTED data rather than prior samples in time. This is because data that have not been reviewed and accepted could themselves be problematic. +During data import, samples or results are auto-flagged following criteria developed by NAWQA for all water-quality data, and are defined at the end of this manual. For any flags comparing a current sample to historic data, the current sample is compared to all REVIEWED AND ACCEPTED data rather than prior samples in time. This is because data that have not been reviewed and accepted could themselves be problematic. ###Basic chemical flags This table contains basic chemical checks similar to those provided by the QWDATA unix software. The first 6 columns contain sample-level information and the remaining columns contain flags wit hthe column name coorresponding to the particular data check. If a sample fails a given data check, a flag is applied to the respective column for that sample. @@ -316,4 +316,41 @@ This table contains flags for evaluating number of pesticide hits in schedule 24 This table contains flags for results that are either suspisously high or low compared to historic data. ##Data and QAQC tables -These tables are controlled similarly to the auto-flagged tables except that they can be generated according to site and date selection criteria. These tables include standard data tables, a wide (sample-result) and a long (by result) format table. 4 QAQC tables are also presented, including a chargebalance table, a table of replicate agreement, a summary table of blank detections, and a table comparing filtered ot unfiltered values. The last column of each of these QAQC tables contains a column with flags if a particular sample violates some standard QAQC measure. For example, a sample with a charge imbalance > 10% would get a flag in the final column of hte chargebalance table. **The blank summary table is calculated on the fly given the input criteria** For example, leaving the default date range (last 3 years) in the blank table input and selecting a site would summarize the blank detections for that 3 year period for that site. \ No newline at end of file +These tables are controlled similarly to the auto-flagged tables except that they can be generated according to site and date selection criteria. These tables include standard data tables, a wide (sample-result) and a long (by result) format table. 4 QAQC tables are also presented, including a chargebalance table, a table of replicate agreement, a summary table of blank detections, and a table comparing filtered ot unfiltered values. The last column of each of these QAQC tables contains a column with flags if a particular sample violates some standard QAQC measure. For example, a sample with a charge imbalance > 10% would get a flag in the final column of hte chargebalance table. **The blank summary table is calculated on the fly given the input criteria** For example, leaving the default date range (last 3 years) in the blank table input and selecting a site would summarize the blank detections for that 3 year period for that site. + +##Flag descriptions +###SC_badLabVSField +The difference between Lab SC (90095) and field SC (00095) is greater than 10% + +###30.01. +pH lower than expected Every water-quality sample (environmental and QC) had its pH (p00400) checked for appropriate ranges. If the pH value is less than 4.5, the sample is flagged for 30.01. + +###30.02. pH higher than expected +Every water-quality sample (environmental and QC) had its pH (p00400) checked for appropriate ranges. If the pH value is higher than 9, the sample is flagged for 30.02. + +###30.03. Dissolved Oxygen higher than expected +Every water-quality sample (environmental and QC) had its dissolved oxygen (p00300) checked for appropriate ranges. If the D.O. value is higher than 25, the sample is flagged for 30.03. + +###30.11. Greater than max value in old data +New Environmental samples are compared to “old” environmental samples at the same site from water-year 1996 and later, for pesticides, nutrients, field parameters, and major ions. When a parameter has 5 or more “old” values at the site, and a new sample has a new maximum for that parameter, that sample and parameter are flagged for 30.11. Pesticides in Schedule 2437 which existed in the earlier schedules 2033 or 2060 (under different pcodes) are compared to the older pcodes as well as the Schedule 2437 pcodes. + +###30.12. Less than min value in old data +New Environmental samples are compared to “old” environmental samples at the same site from water-year 1996 and later, for pesticides, nutrients, field parameters, and major ions. When a parameter has 5 or more “old” values at the site, and a new sample has a new minimum for that parameter, that sample and parameter are flagged for 30.12. Pesticides in Schedule 2437 which existed in the earlier schedules 2033 or 2060 (under different pcodes) are compared to the older pcodes as well as the Schedule 2437 pcodes. + +###30.13. Schedule 2437 Pesticide hits greater than max hits in old data +The number of Schedule 2437 pesticide hits in new environmental samples is compared to 2437 pesticide hits in “old” environmental samples at the same site from water-year 2013 and later (the year Schedule 2437 began). When a site has 5 or more “old” pesticide samples and a new sample has a new maximum number of pesticide hits, that sample is flagged for 30.13. Only pesticides in Schedule 2437 are counted as hits. + +###30.14 Less than minimum pesticide hits in old data +The number of Schedule 2437 pesticide hits in new environmental samples is compared to 2437 pesticide hits in “old” environmental samples at the same site from water-year 2013 and later (the year Schedule 2437 began). When a site has five or more “old” pesticide samples and a new sample has a new minimum number of pesticide hits, that sample is flagged for 30.14. Only pesticides in Schedule 2437 are counted as hits. + +###30.15. Greater than 99p in old data +New Environmental samples are compared to “old” environmental samples at the same site from water-year 1996 and later, for pesticides, nutrients, field parameters, and major ions. When a parameter has 24 or more “old” values at the site, and a new sample has a value greater than the 99th percentile of the “old” data set for that parameter, that sample and parameter are flagged for 30.15. Pesticides in Schedule 2437 which existed in the earlier schedules 2033 or 2060 (under different pcodes) are compared to the older pcodes as well as the Schedule 2437 pcodes. + +###30.16. Less than 1p in old data +New Environmental samples are compared to “old” environmental samples at the same site from water-year 1996 and later, for pesticides, nutrients, field parameters, and major ions. When a parameter has 24 or more “old” values at the site, and a new sample has a value less than the 1st percentile of the “old” data set for that parameter, that sample and parameter are flagged for 30.15. Pesticides in Schedule 2437 which existed in the earlier schedules 2033 or 2060 (under different pcodes) are compared to the older pcodes as well as the Schedule 2437 pcodes. + +###30.21. Questionable cation-anion balance +For each environmental sample, the cation-anion percent difference was be calculated (using the same formula, but a slightly simpler procedure, than what NWIS-QWDATA uses) and compared to the value for specific conductance (P00095). The cation-anion ballance is flagged for 30.21 if any of the following conditions is true +1. specific conductance is less than or equal to 100 microsiemens/cm, AND percent difference is greater (in absolute value) than +/- 15 percent +2. specific conductance is greater than 100 and less than or equal to 1000 microsiemens/cm, AND percent difference is greater (in absolute value) than +/- 10 percent +3. specific conductance is greater than 1000 microsiemens/cm, AND percent difference is greater (in absolute value) than +/- 5 percent \ No newline at end of file diff --git a/vignettes/WQReviewGUI.html b/vignettes/WQReviewGUI.html deleted file mode 100644 index 7952f6d..0000000 --- a/vignettes/WQReviewGUI.html +++ /dev/null @@ -1,471 +0,0 @@ - - - - - - - - - - - - - - -WQReview GUI User Guide - - - - - - - - - - - - - - - - - - - - -
    -

    Importing Data

    -

    This will describe the process for importing data into the WQReview Graphical User Interface (GUI). We will start by importing data for a single site using predefined NWIS parameter groups. ##Load the WQReview package and open the WQReview GUI

    -
      -
    1. Load the WQReview package by typing the following into your R script or command window:
    2. -
    -
    library(WQReview)
    -
      -
    1. To open the GUI run the WQReviewGUI() function.
    2. -
    -
    WQReviewGUI()
    -

    The GUI window will open in your system’s default internet browser. It is recommended that the GUI be run in Google Chrome. If the GUI opens in internet explorer, you need to change your system’s default browser to Google Chrome by opening Google Chrome and going to settings -> default browser (bottom of page).

    -
    -

    Data import options

    -

    The data import tab has 10 main inputs. A description of the input is given when the input is hovered over with the mouse cursor.

    -
      -
    1. Site number: This input takes a manually entered site number(s). Type the site number in and click “add”. You may add as many site numbers as you would like. Remove a site number by clicking it and hitting the backspace or delete keys. Alternatively, click in the box and press the backspace key to incrementally remove the numbers starting with the last entry.

    2. -
    3. Site number file: This input takes a file of site IDs. The file must be a single column text file of site numbers.Make sure leading zero’s have not been removed if using excel to generate the file.

    4. -
    5. Parameter codes: This input takes a manually entered parameter codes (pcodes). This behaves the same as the site number input.

    6. -
    7. Parameter groups: This input is used to select NWIS parameter groups to retrieve, rather than explicitly selecting individual pcodes.

    8. -
    9. pCode file: This input takes a file of pcodes. The file must be a single column text file of pcodes. Make sure leading zero’s have not been removed if using excel to generate the file.

    10. -
    11. Start date: The start date for the data pull. Samples collected after this date will be retrieved. The default value is 10 years before the current date.

    12. -
    13. End date: The end date for the data pull. Samples collected before this date will be retrieved. The default is the current date.

    14. -
    15. Server name (DSN): The name of your nwis server data source name (DSN) that was established during ODBC setup.

    16. -
    17. Environmental DB number: The number cooresponding to the environmental database. Default is “01”

    18. -
    19. QA DB Number: The number cooresponding to the QA sample database. Default is “02”

    20. -
    -
    -
    -

    A basic data import

    -

    We will start with a basic data import for a single site by parameter groups.

    -
      -
    1. Double check that your server name and database numbers are correct for your data.
    2. -
    3. Type a site ID into the site number input box and click “add”.
    4. -
    5. Select “All” parameter groups from the Parameter groups select box to pull data for all parameters or select a specific group of parameters. **Beware, if pulling selected groups of parameters (e.g. “cations”) chargebalance may not be able to be calculated.

    6. -
    7. Leave the date range input unchanged to pull the last 10 years of data or enter a date range in the date range input to pull a subset of the data.
    8. -
    9. Click the “Get data” button to import the data.
    10. -
    11. A dialogue box and status bar describing the import process will appear in the upper right corner of the GUI.
    12. -
    13. Once data has been retrieved, text will be displayed listing the results of the data import.

    14. -
    -

    If you encounter issues with the data import, send an email to tmills@usgs.gov and/or post an issue on the WQReview GitHub page at WQ-Review Issues

    -

    We can now begin to work with the data.

    -
    -
    -
    -

    Plot descriptions

    -

    This section will describe the plot types available in the WQReview GUI and the various ways to manipulate them.

    -
    -

    Symbology

    -

    The symbology in all plots is sensitive to the medium code and remark code. Data colors are mapped to the medium code and point data symbols are mapped to the remark code.

    -

    Currently supported medium codes include:

    -
      -
    1. WS
    2. -
    3. WG
    4. -
    5. OA
    6. -
    7. WSQ
    8. -
    9. WGQ
    10. -
    11. OAQ
    12. -
    -

    Currently supported remark codes include:

    -
      -
    1. No remark code (listed as “Sample” in legend)
    2. -
    3. <
    4. -
    5. ‘>’
    6. -
    7. E
    8. -
    -
    -
    -

    Labelling conventions

    -

    All axis pertaining to a particular pcode will be labelled with that pcode’s NWIS parameter name, which includes the units of measurement. The main title of the plot will either by labelled with the NWIS station name if only one station is plotted, or “multi-site plot” if multiple stations are displayed.

    -
    -
    -

    Selecting data to plot

    -

    Generally, plots are controlled by selecting a site and then a data type from an input box or pick list. In most cases the plot will be displayed or refreshed automatically. PLOTS WILL NOT BE DISPLAYED IF A SITE AND DATA TYPE ARE NOT SELECTED EVEN IF ONLY ONE SITE OR DATA TYPE IS PRESENT. Additionally, a plot will not be displayed if there are no data to plot, for example if a particular parameter was not measured at a selected site but is selected for plotting. Multiple sites of multiple parameters can be plotted on certain plot types.

    -
    -
    -

    Global plot controls

    -
    -

    New data threshold

    -

    Point data in all plots can be labeled as “New” data based off of when that data was last modified using the “New data threshold” slider. Any data modified after the date indicated on the slider will be labeled as “New”. This helps identify data that has not been reviewed from historic data when the data are not displayed as a timeseries. Note that the “New data threshold” is set off of when the data were last modified for result-level plots (e.g. timeseries, seasonal, etc.) not when they were created. Sample-level plots (e.g. charge balance) are labeled new according to the sample collection date.

    -
    -
    -

    Record highlights

    -

    Samples or results will be hilighted with a red halo if that sample or result has been flagged for one or more of the data checks listed in the data check table.

    -
    -
    -

    Plot clicking, brushing, and hovering

    -

    Most plots are interactive in that the user can click on a point, or zoom into specific areas of the plot. Boxplots are not interactive.

    -
    -

    Clicking

    -

    Clicking on a datapoint will populate a table with all data pertaining to that point. This table will persist until another point is clicked.

    -
    -
    -

    Brushing

    -

    The user may also select and area of the plot by holding down a mouse click and drawing a rectangle around hte area of interest. A new plot will appear below, zoomed into the area of interest. Additionaly, a table will be displayed below with all data pertaining to the points within the zoomed area. Points in the zoomed plot can also be click to get information.

    -
    -
    -

    Hovering

    -

    Hovering the mouse over any given data point will display basic information about the data point on the left sidebar of the plot frame.

    -
    -
    -
    -
    -

    Plot types

    -

    This section will describe the details of each different plot type and how to control them in the WQReview GUI.

    -
    -

    Timeseries

    -

    This tab generates of plot of a selected parameter through time.

    -
    -

    Uses

    -
      -
    • Identifying general trends at a site through time.
    • -
    • Identifying temporal outliers.
    • -
    -
    -
    -

    Data selection options

    -
      -
    • Select one or multiple sites
    • -
    • Select only one parameter
    • -
    -
    -
    -

    Plot controls

    -
      -
    • Multi-site options: Plot all sites on one plot (multisite) or plot sites on individual side-by-side plots (facet).
    • -
    • Add LOESS: Adds a locally weighted scatterplot smooth and shaded 95% confidence interval around the smooth
    • -
    • Display hydrograph: displays the instantaneous hydrograph if data are available under parameter code “00061”
    • -
    -
    -
    -
    -

    Seasonal plot

    -

    This pane generates a seasonal timeseries of parameter value by day of year (DOY) to examine seasonality in parameter values.

    -
    -

    Uses

    -
      -
    • Identifying seasonality in parameter values.
    • -
    • Identifying seasonal outliers.
    • -
    -
    -
    -

    Data selection options

    -
      -
    • Select one or multiple sites
    • -
    • Select only one parameter
    • -
    -
    -
    -

    Plot controls

    -
      -
    • Multi-site options: Plot all sites on one plot (multisite) or plot sites on individual side-by-side plots (facet).
    • -
    • Add LOESS: Adds a locally weighted scatterplot smooth and shaded 95% confidence interval around the smooth
    • -
    -
    -
    -
    -

    Parameter box plot

    -

    This pane generates a box plot of one or more parameters for one or more sites. Note that this is not an appropriate censored boxplot. Censored results are given the censored value for quantile calculations.

    -
    -

    Uses

    -
      -
    • Comparing parameter values at a site(s).
    • -
    • Identifying outliers in a parameter.
    • -
    -
    -
    -

    Data selection options

    -
      -
    • Select one or multiple sites
    • -
    • Select one or multiple parameters
    • -
    -
    -
    -

    Plot controls

    -
      -
    • Log 10 scale: This plots parameter values on a log10 scale.
    • -
    • Show sample points: This displays individual sample points.
    • -
    • Multi-site options: Plot all sites on one plot (multisite) or plot sites on individual side-by-side plots (facet).
    • -
    -
    -
    -
    -

    Parameter-parameter plot

    -

    This pane generates an x-y plot of a selected parameter vs another selected parameter.

    -
    -

    Uses

    -
      -
    • Identifying relationships between parameters.
    • -
    • Identifying outliers in related parameters.
    • -
    -
    -
    -

    Data selection options

    -
      -
    • Select one or multiple sites
    • -
    • Select only one parameter per axis
    • -
    -
    -
    -

    Plot controls

    -
      -
    • Multi-site options: Plot all sites on one plot (multisite) or plot sites on individual side-by-side plots (facet).
    • -
    • Add linear fit: Add a linear regression line to the x-y data.
    • -
    • Log 10 scale: This plots parameter values on a log10 scale.
    • -
    -
    -
    -
    -

    Matrix plot

    -

    This pane generates a plot matrix of one or more parameters for one or more sites. Essentially, this is a parameter-parameter plot for multiple parameters. The lower triangular quadrant of panels are parameter-parameter plots, the diagonal contains a histogram of values and the labelled pcodes, and the upper triangular quadrant of panels contains the correlation coefficients.

    -
    -

    Uses

    -
      -
    • Data exploration.
    • -
    • Site characterization.
    • -
    -
    -
    -

    Data selection options

    -
      -
    • Select one or multiple sites
    • -
    • Select one or multiple parameters
    • -
    -
    -
    -

    Plot controls

    -

    *None

    -
    -
    -
    -

    Chargebalance timeseries

    -

    This pane generates a timeseries plot of charge balance percent difference. The plot is annotated with a horizontal dashed line indicating the range of +- 5% and a solid line indicating the range of +- 10%. Symbol type indicates if enough major elements were analyzed to constitute a roughly complete balance. For example, a sample missing calcium would be given a symbol of “Incomplete” because it is a major constituent in the charge balance, but a sample missing fluoride would still be given a “Complete” symbol because it is only a minor constituent of the charge balance.

    -
    -

    Uses

    -
      -
    • Obtaining a quick visual snapshot of charge imbalance at a site.
    • -
    • Identifying charge imbalance issues with current data and comparing to historic chargebalance behavior.
    • -
    -
    -
    -

    Data selection options

    -
      -
    • Select one or multiple sites
    • -
    -
    -
    -

    Plot controls

    -
      -
    • Multi-site options: Plot all sites on one plot (multisite) or plot sites on individual side-by-side plots (facet).
    • -
    -
    -
    -
    -

    Ions vs conductance

    -

    This pane generates a x-y plot of sum of cations or anions vs conductance. The ratio of the sum of cations or anions vs specific conductance generally falls within a range of 0.92 - 1.24 for natural waters. The shaded region on the plot indicates this typical range. These are the values used in QWData for alert limits, see QWData documentation and references therein for further explanation.

    -

    At many sites, there will be a roughly linear relationship between the sum of cations or anions vs. conductance. If a point falls above or below the general trend line, this is an indication that the particular group of ions is either to low or too high.

    -
    -

    Uses

    -
      -
    • Identifying samples that fall outside of the typical range of rations of ions/specific conductance.
    • -
    • Identifying which group of ions, cations or anions, are responsible for charge imbalance issues.
    • -
    -
    -
    -

    Data selection options

    -
      -
    • Select one or multiple sites
    • -
    -
    -
    -

    Plot controls

    -
      -
    • Multi-site options: Plot all sites on one plot (multisite) or plot sites on individual side-by-side plots (facet).
    • -
    -
    -
    -
    -

    Rep-parm boxplot

    -

    This pane generates a plot of replicate relative percent difference for all replicates analyzed at a given site. READ THE FOLLOWING ON REPLICATE PAIRING

    -

    Replicate pairs are identified as follows:

    -
      -
    1. An environmental sample is a sample with medium code of WS or WG and a sample type of 7.
    2. -
    3. A replicate sample is a sample with a medium code of WSQ or WGQ and a sample type of 7.
    4. -
    5. An environmental-replicate pair is defined as a replicate sample collected at the same site as an environmental sample on the same day.
    6. -
    -

    NOTE THAT CENSORED RESULTS ARE GIVEN THE CENSORED VALUE FOR CALCULATIONS. DO NOT INTERPRET REPLICATE ANALYSES BASED ENTIRELY OFF OF THE RELATIVE PERCENT DIFFERENCE PLOT. SEE REPLICATE TABLE AS WELL.

    -

    Boxplots can be grouped by time frame to compare current replicate agreement to historic using the “New replicate threshold” data input at the top of the page. This functions exactly the same as the “New data threshold” described in the Global Controls section of this vignette.

    -
    -

    Uses

    -
      -
    • Assessing general replicate agreement at a site for multiple parameters.
    • -
    • Comparing current replicate analyses to historic agreement.
    • -
    -
    -
    -

    Data selection options

    -
      -
    • Select one or multiple sites
    • -
    • Select one or multiple parameters
    • -
    -
    -
    -

    Plot controls

    -
      -
    • New replicate threshold: Sets the date break for historic vs new replicate analyses.
    • -
    • Show sample points: This displays individual sample points.
    • -
    -
    -
    -
    -

    Blank sample timeseries

    -

    This pane generates a plot of parameter values for blank samples over time.

    -
    -

    Uses

    -
      -
    • Identifying systematic detections in blank samples at a given time, for example during a change in field or laboratory method or reporting level.
    • -
    -
    -
    -

    Data selection options

    -
      -
    • Select one or multiple sites
    • -
    • Select only one parameter
    • -
    -
    -
    -

    Plot controls

    -
      -
    • Multi-site options: Plot all sites on one plot (multisite) or plot sites on individual side-by-side plots (facet).
    • -
    -
    -
    -
    -
    -
    -

    Tables

    -

    This section will describe the various tables generated by the WQReview GUI. The WQ-Review GUI produces 2 general classes of tables: Auto-flag results, and data/QAQC tables. All tables can be downloaded as tab-delimited text files by clicking on the download button above each table. All tables are sortable by clicking on the header, and the number of entries per table page is adjusted using hte “show entries” dropdown. Additionally, all tables can be filtered using the search bar. Typing a value into the searchbar will search the table columns for that value and subset the table to only those rows containing the search value. For example, typing “WSQ” into the search bar will filter the table to only replicate samples.

    -
    -

    Auto-flagged samples

    -

    During data import, samples or results are auto-flagged following criteria developed by NAWQA for all water-quality data, and are defined here. For any flags comparing a current sample to historic data, the current sample is compared to all REVIEWED AND ACCEPTED data rather than prior samples in time. This is because data that have not been reviewed and accepted could themselves be problematic.

    -
    -

    Basic chemical flags

    -

    This table contains basic chemical checks similar to those provided by the QWDATA unix software. The first 6 columns contain sample-level information and the remaining columns contain flags wit hthe column name coorresponding to the particular data check. If a sample fails a given data check, a flag is applied to the respective column for that sample.

    -
    -
    -

    Pesticide flags

    -

    This table contains flags for evaluating number of pesticide hits in schedule 2437. If there are too many or too few hits in the current sample compared to historic data, the sample gets flagged.

    -
    -
    -

    Results flags

    -

    This table contains flags for results that are either suspisously high or low compared to historic data.

    -
    -
    -
    -

    Data and QAQC tables

    -

    These tables are controlled similarly to the auto-flagged tables except that they can be generated according to site and date selection criteria. These tables include standard data tables, a wide (sample-result) and a long (by result) format table. 4 QAQC tables are also presented, including a chargebalance table, a table of replicate agreement, a summary table of blank detections, and a table comparing filtered ot unfiltered values. The last column of each of these QAQC tables contains a column with flags if a particular sample violates some standard QAQC measure. For example, a sample with a charge imbalance > 10% would get a flag in the final column of hte chargebalance table. The blank summary table is calculated on the fly given the input criteria For example, leaving the default date range (last 3 years) in the blank table input and selecting a site would summarize the blank detections for that 3 year period for that site.

    -
    -
    - - - - - - - - diff --git a/vignettes/flagDescriptions.htm b/vignettes/flagDescriptions.htm new file mode 100644 index 0000000..ca79fc8 --- /dev/null +++ b/vignettes/flagDescriptions.htm @@ -0,0 +1,137 @@ + + + + + + + + + + + + + +Automated Data flags + + + + + + + + + + + + + + + + + + + + + +
    + + + + + +
    +

    SC_badLabVSField

    +

    The difference between Lab SC (90095) and field SC (00095) is greater than 10%

    +
    +
    +

    30.01.

    +

    pH lower than expected Every water-quality sample (environmental and QC) had its pH (p00400) checked for appropriate ranges. If the pH value is less than 4.5, the sample is flagged for 30.01.

    +
    +
    +

    30.02. pH higher than expected

    +

    Every water-quality sample (environmental and QC) had its pH (p00400) checked for appropriate ranges. If the pH value is higher than 9, the sample is flagged for 30.02.

    +
    +
    +

    30.03. Dissolved Oxygen higher than expected

    +

    Every water-quality sample (environmental and QC) had its dissolved oxygen (p00300) checked for appropriate ranges. If the D.O. value is higher than 25, the sample is flagged for 30.03.

    +
    +
    +

    30.11. Greater than max value in old data

    +

    New Environmental samples are compared to “old” environmental samples at the same site from water-year 1996 and later, for pesticides, nutrients, field parameters, and major ions. When a parameter has 5 or more “old” values at the site, and a new sample has a new maximum for that parameter, that sample and parameter are flagged for 30.11. Pesticides in Schedule 2437 which existed in the earlier schedules 2033 or 2060 (under different pcodes) are compared to the older pcodes as well as the Schedule 2437 pcodes.

    +
    +
    +

    30.12. Less than min value in old data

    +

    New Environmental samples are compared to “old” environmental samples at the same site from water-year 1996 and later, for pesticides, nutrients, field parameters, and major ions. When a parameter has 5 or more “old” values at the site, and a new sample has a new minimum for that parameter, that sample and parameter are flagged for 30.12. Pesticides in Schedule 2437 which existed in the earlier schedules 2033 or 2060 (under different pcodes) are compared to the older pcodes as well as the Schedule 2437 pcodes.

    +
    +
    +

    30.13. Schedule 2437 Pesticide hits greater than max hits in old data

    +

    The number of Schedule 2437 pesticide hits in new environmental samples is compared to 2437 pesticide hits in “old” environmental samples at the same site from water-year 2013 and later (the year Schedule 2437 began). When a site has 5 or more “old” pesticide samples and a new sample has a new maximum number of pesticide hits, that sample is flagged for 30.13. Only pesticides in Schedule 2437 are counted as hits.

    +
    +
    +

    30.14 Less than minimum pesticide hits in old data

    +

    The number of Schedule 2437 pesticide hits in new environmental samples is compared to 2437 pesticide hits in “old” environmental samples at the same site from water-year 2013 and later (the year Schedule 2437 began). When a site has five or more “old” pesticide samples and a new sample has a new minimum number of pesticide hits, that sample is flagged for 30.14. Only pesticides in Schedule 2437 are counted as hits.

    +
    +
    +

    30.15. Greater than 99p in old data

    +

    New Environmental samples are compared to “old” environmental samples at the same site from water-year 1996 and later, for pesticides, nutrients, field parameters, and major ions. When a parameter has 24 or more “old” values at the site, and a new sample has a value greater than the 99th percentile of the “old” data set for that parameter, that sample and parameter are flagged for 30.15. Pesticides in Schedule 2437 which existed in the earlier schedules 2033 or 2060 (under different pcodes) are compared to the older pcodes as well as the Schedule 2437 pcodes.

    +
    +
    +

    30.16. Less than 1p in old data

    +

    New Environmental samples are compared to “old” environmental samples at the same site from water-year 1996 and later, for pesticides, nutrients, field parameters, and major ions. When a parameter has 24 or more “old” values at the site, and a new sample has a value less than the 1st percentile of the “old” data set for that parameter, that sample and parameter are flagged for 30.15. Pesticides in Schedule 2437 which existed in the earlier schedules 2033 or 2060 (under different pcodes) are compared to the older pcodes as well as the Schedule 2437 pcodes.

    +
    +
    +

    30.21. Questionable cation-anion balance

    +

    For each environmental sample, the cation-anion percent difference was be calculated (using the same formula, but a slightly simpler procedure, than what NWIS-QWDATA uses) and compared to the value for specific conductance (P00095). The cation-anion ballance is flagged for 30.21 if any of the following conditions is true 1. specific conductance is less than or equal to 100 microsiemens/cm, AND percent difference is greater (in absolute value) than +/- 15 percent 2. specific conductance is greater than 100 and less than or equal to 1000 microsiemens/cm, AND percent difference is greater (in absolute value) than +/- 10 percent 3. specific conductance is greater than 1000 microsiemens/cm, AND percent difference is greater (in absolute value) than +/- 5 percent

    +
    + + +
    + + + + + + + +