Link to USGS home

loadmeas

Name:
loadmeas - A utility to review discharge measurement summary information and automatically load it into ADAPS.

Note (5/6/2010): This script was retired from active support in Dec. 2008 with the release of the new SiteVisit system. Although it was originally planned to be rewritten to be compatible with SiteVisit, it was subsequently replaced with functionality added to SWAMI and SiteVisit itself. This page is available for historical reference. Comments can be sent to GS-W OSW Scripts@usgs.gov.

Information:

This much needed script automates the process of entering discharge measurement into ADAPS. Now that we collect so many of our measurements electronically, it is a little silly to require a human (you) to always hand-enter the discharge summary information into the data base. Thanks to Burl Goree you no longer need to do that - or at least you only need to do it to fill in the fields missing in your electronic file. Keep reading for the details.

Using loadmeas:

The operation of the program is meant to be intuitive. A more detailed manual or readme file has not yet been written. Whether or not it will be depends on how many questions come in. In general program operation proceeds as follows:

  1. Launch loadmeas from your NWIS Sun server.
  2. Click on the loadmeas "Load from File" button. A dialog box will allow you to select the electronic file of your choice from any directory on the Sun server.
  3. Loadmeas will scan the file and sense the appropriate file type. Note that loadmeas does not use the file name for this function. If the electronic file does not contain a station ID, loadmeas will immediately prompt the user for one.
  4. Loadmeas will load all discharge summary information contained in the file into the main screen display. ADAPS program MS_EDIT measurement fields not contained in the electronic file will be left blank.
  5. Loadmeas will use the station ID from the electronic file and retrieve from ADAPS the station name, last measurement number, and last measurement date for use in comparing against the electronic file.
  6. The user will be allowed to then edit the data as necessary by modifying existing fields or adding to blank fields as desired. The user can move through the fields using the mouse, enter key, or the tab key. Pick lists will appear for fields with fixed input selections (control code, measurement type, etc.).
  7. When the user is finished editing, the "Send to ADAPS" button will push the data into ADAPS. Note that this is done using a expect script adding the data just as a user would using program MS_EDIT. The script does not have any "backdoor" into the database.
  8. After the "Send to ADAPS" button is pushed but prior to starting the MS_EDIT session, the script will validate the data to check for manditory fields. The user will be prompted to fix any missing data that ADAPS requires.
  9. If the script fails to complete the MS_EDIT session, the user will be notified of the point at which it failed. Note that failure to finish loading the measurement will mean that no measurement data was loaded and user will have to "fix" the problem before attempting to reload the file again.
  10. The user can then load another file and repeat the process or exit loadmeas with the "EXIT" button.

Current electronic measurement files supported
Sutron DMX (.nst)
RDI ADCP Discharge Measurement Wizard (.dmw)
Aquacalc AQCUSH8c firmware (.csv)
Sontek Flow Tracker
SWIM
Q-Calc

There are a few things that can be set as arguments when starting the program, although in most cases these will not be necessary.

Usage: loadmeas [-i] [-t ] [-db ] [-m1] [-m2] [-help]
-i The measurement number will default to 1 greater than the last measurement number for the station
-t Displays file information to the screen only
-db The is used in the tsql statements and overrides the value in the .nwisdb file
-m1 The code for First Discharge will be set to "Measured" as default
-m2 The code for Second Discharge will be set to "Measured" as default
-help Displays this usage information.

Notes:

Installation:

Script Language:

main script: Tcl/tk (via wish)
ADAPS loader: expect

Requirements:

Nothing Special

Original Author(s): Burl Goree, Louisiana Water Science Center

Note the original author is noted on this page for the purposes of giving credit only. Please address questions/comments to OSW (GS-W OSW Scripts@usgs.gov).

Known Problems/Limitations/Need Improvements:
The script may not currently support all the types of electronic discharge measurements being made in WRD. If you are currently using a discharge measurement file type that is not supported, please email the details (including a sample file) to GS-W OSW Scripts@usgs.gov.

Scripts:

Version 1.1.0 (Posted 10/02/07):
- Added support for WinRiver II Hydroml
- Pop-up menu now defaults to the entry value
- Degrees C or F are stripped when you post rather than during verify so you don't get in a loop

loadmeas download (Zip file = 16K)

NOTE: This version is included in OSW Install package 1.0-8 released 10/09/07. If your script is out of date please reinstall the latest package from http://water.usgs.gov/usgs/osw/adaps/OSW_scripts_pkg.html

NOTE: V1.0.5 was distributed in the OSW Scripts package for NWIS 4.7. This updated version will be distributed in the next NWIS release. To install this over the top of the current Scripts Package version, do the following as user "nwis":
- unzip the new version and place in /usr/opt/osw
- check group and permissions, group should be nwuser and permission should be -rwxr-x---
- if needed, set group to nwuser "chgrp nwuser loadmeas"
- if needed, set permissions "chmod 750 loadmeas"

Back to Scripts
[an error occurred while processing this directive]