HYDSTRA/WQ is designed to hold information about discrete water quality samples and their analyses. There are more fields to describe a sample than TS provides, for example sample method, preservation method, sampling project, etc. Result values can have qualifiers like > and <.
You should store water quality in HYDSTRA/TS if the data comes from a continuous probe on a logger, and in HYDSTRA/WQ if the data comes from an analytical laboratory.
Can I analyse continuous and discrete WQ data together?
Yes. All WQ data appears as a TS datasource, so you can use standard TS programs like HYPLOT to plot continuous data from loggers and discrete data from HYDSTRA/.WQ on the same page.
How do I access WQ data from TS programs?
You need to consult DATASRC.INI to be absolutely sure. The copy of DATASRC.INI you are using may come from \HYD\DAT\INI, or if there is none there you are using the delivered default in \HYD\SYS\MISC. The delivered default has a number of datasources preconfigured:
SW - Data from the WQ Warehouse (quickest and best of the warehouse is up to date)
WQ - Data directly from the archive
WX - Data from the archive, with period of record for each variable
Your system administrator may have overridden these defaults with something else, which is why you need to look in \HYD\DAT\INI first.
In any case, you simply specify the appropriate datasource letters in the 'Suffix' field on the parameter screen of any standard TS analysis program.
How many different analyses can I store for a sample?
There is no limit to the number of analyses you can store. You simply need to ensure that you have registered a WQ variable for each of the analyses you need to store.
Can I qualify results with codes like 'too numerous to count', 'trace', 'less than' or 'greater than'?
Yes. The results record contains a field 'FLAG' which is looked up against code 'RES' in the CODES database. You can change this code to add new entries or change existing ones if you wish.
For codes like 'trace' we suggest you put in a value of zero in the numeric field. For below detection limit we suggest you store the detection limit and a flag of '<' as the value.
How can I find all the Phosphorus readings which exceeded a specified value?
The easiest way to do global searches is to use the Warehouse file. This assumes that the warehouse has been recently updated using the WREHOUSE job. To access the WQ warehouse, use the main WQ archive manage WQMANAGE and tab down to the WREHOUSE table. If you Unlink this table you can then apply successive filters to find data which meets any constraint you wish. Once you have the records you want you can copy them to your TEMP directory as a private WREHOUSE file for later use.
Why does HYDSTRA/WQ have a warehouse file?
The water quality databases are split into SAMPLES and RESULTS tables. As a consequence it can be a little complex to formulate queries across samples and results (as one example, the date is in the sample record and the value in the result record). By creating a single file which joins every result to its sample record you end up with a single table which you can filter easily in the WQ manage.
The only disadvantage of the warehouse file is that it needs to be re-created regularly in a process which can be quite time consuming.
I need to see summary statistics for a parameter
Every time the WREHOUSE job is run the SUMMARY table is regenerated at the same time. SUMMARY contains statistics like max, min, mean, median, 10 and 90 percentile etc for every station/variable combination in the archive. You can simple open the WQ manage and tab down to the SUMMARY table to view these summaries. If you need the same statistics on a subset of the data you can run STVRSUMM on a retrieval file.
How can I extract data from WQ into a spreadsheet?
You first need to retrieve the appropriate data using WQX or by applying filters to the warehouse and exporting the result. Once you have a WREHOUSE format retrieval file in your TEMP directory you can use EXTRCSV to convert the data to CSV format suitable for importing into a spreadsheet.
How can I get external data into WQ?
You can export spreadsheet data to a CSV file and then import the data using WQIMP. Before you can import it you will need to configure the import using the WQIMPDB databases.
Alternatively you can write a Perl spell which reads the CSV file and writes SAMPLES and RESULTS records using the HYDBASE Perl library calls. HYDBASE.PL can be found in \HYD\SYS\RUN, and there is (some) documentation in the library on how to create text files which can be imported into HYDSTRA databases. You would use the WQMANAGE job to import SAMPLES.TXT and RESULTS.TXT to import text files into work files. We do not expect normal users to write Perl code, we would normally do it under contract for you.
In either case you will end up with a WQ workfile which you can then import into the main archive using the File/Import facility in WQMANAGE. As data is imported to archive it is comprehensively checked for valid codes, valid values, a valid SITE, etc.
I need to key in the same set of results repeatedly for many samples.
You can specify a 'form' in the WQMANAGE. A form is simply a group of variables which are to be entered in order. You need to specify a named group under the WQFORMS group and then invoke that group in the WQMANAGE job. Once you have invoked a specific form the WQMANAGE job will automatically add dummy results whenever you create a sample.