DEOS Data Extraction Program Operations Guide

DEOS Technical Note #16

Dr. Geoffrey E. Quelch

Research Fellow,
University of Delaware,
Center for Climatic Research


   University of Delaware
   NewarkDE 19716
   
  

Version 2

All material herein is copyright by the Delaware Environmental Observing System

Published: March 10th 2005

Revision History
Revision 1.12005/03/10GEQ
Initial version
Revision 1.22005/03/14GEQ
Outlined the data format and database tables used. Added units command options.
Revision 1.32005/03/15GEQ
Clarified the required and optional command line options.
Revision 1.42005/03/17GEQ
Clarified the start and end time format options (YYYY-MM-DD HH:MM:SS is allowed) and specified that the end time must be later than the start time.
Revision 1.52005/09/15GEQ
Added the time zone options.
Revision 1.62005/10/20GEQ
Added the caution at the top of the output file section.
Revision 1.72005/11/30GEQ
Clarified the data types option as in requiring numbers.
Revision 1.82006/01/20GEQ
Fixed print history.
Revision 1.92006/04/17GEQ
Added table describing data types and their IDs.
Revision 2.12006/09/26GEQ
Incremented version number of this document to 2.
Revision 2.22006/12/07GEQ
Added abbreviation command line option for specifying data types. Revised data type table to include abbreviations.
Revision 2.32007/01/04GEQ
Added an ID for the data types section. Added abbreviations to data types table.
Revision 2.1.42007/10/30GEQ
Revised data types table.

Abstract

This technical note describes the DEOS extract program, and the options for its use.


Table of Contents

Introduction
Running the Program
Command Line Options
User Option
Password Option
Database Option
Network Name Option
Station Name Option
Start Time Option
End Time Option
Time Zone Specification
Filename Option
Data Types Option
Dump File Type Option
Output Units
Verbose Option
Help Option
Database Parameters
Station_Data
Data_Types
Unit_Types
Schema_Units
Unit_Conversions
Output File
Comma-Separated Value (CSV) Format
HDRS
Database Parameters
Operational Use

Introduction

The DEOS extract function provides the functionality to retrieve and format data stored in the DEOS database.

Running the Program

The program is executed by the command extract from the command line.

extract { -u user-name | --user user-name } { -p password | --password password } { -d database | --database database } { -n network | --network-namenetwork } { -S station | --station-namestation } [--start-timetime string] [--end-timetime string] [ --local | --utc | --UTC ] [--filenamename] {--data-typeslist} [--dump-type[csv]] [ --english | --English | --si | --SI ] [ -vvalue | --verbosevalue ] [ -h | --help ]

Command Line Options

The extract program uses database configuration parameters to connect to the database storing the data for extraction.

User Option

The specification for the user option is:

{ -u username | --user username | --user=username }

This option will allow the program to connect to the database using the username provided. The user must already exist, and have sufficient permissions to access the database specified. This item is required.

Password Option

The specification for the password option is:

{ -p password | --password password | --password=password }

This option in combination with the username allows the program to connect to the database using the username provided. This item is required.

Database Option

The specification for the database option is:

{ -d database | --database database | --database=database }

This option will specify which database the program should use as a source of data, configuration items and a destination for any event logging items. This item is required.

Network Name Option

The specification for the network name option is:

{ -n network name | --network-name network name | --network-name=network name }

This option specifies the network name and is required.

Station Name Option

The specification for the station name option is:

{ -S name | --station-name name | --station-name=name }

This option specifies the station name and is required.

Start Time Option

The specification for the start time option is:

[ --start-time time string | --start-time=time string ]

This option specifies a timestamp for data extraction to begin. The time string format can be either YYYYMMDDHHMMSS or YYYY-MM-DD HH:MM:SS. If the latter is used, the string must be placed in quotes.

The default is 24 hours prior to the end time. The time string, if provided, must contain at least the year, month and day of month. If the hours, minutes and seconds entries are missing, the default is midnight.

End Time Option

The specification for the end time option is:

[ --end-time time string | --end-time=time string ]

This option specifies a timestamp for data extraction to end. The time string format can be YYYYMMDDHHMMSS or YYYY-MM-DD HH:MM:SS. If the latter is used, the string must be placed in quotes.

The default is the time the program is run. The time string, if provided, must contain at least the year, month and day of month. If the hours, minutes and seconds entries are missing, the default is midnight.

The end time must be later, i.e. more recent, than the start time.

Time Zone Specification

The specification for the time zone for output is:

[ --local | --utc | --UTC ]

This option specifies which time zone will be used in the output data and which time zone other time related command options are interpreted to be. The local option results in the usage of the default time zone for the station as specified in the station metadata. Specifying either utc or UTC will use UTC time in the output. The default value is local.

Filename Option

The specification for the filename option is:

[ --filename name | --filename=name ]

This option will specify which file name the data will be placed in. If a value isn't provided, the default value will be /tmp/YYYYMMDDHHMMSS.DUMP-TYPE where the time string is generated from the time the file was generated and DUMP-TYPE is the argument given to the command line option of the same name.

Data Types Option

The specification for the data types option is:

{ --data-types items | --data-types=items }

This option specifies which data types will be extracted and placed into the output file. The 'items' entry must be a comma-separated list of numeric data type IDs or alphabetic abbreviations for extraction. It is not possible to mix numeric and alphabetic IDs. No spaces are allowed in the list or an error will result, even if the list is enclosed in quotes.

Dump File Type Option

The specification for the dump file type is:

[ --dump-type [csv] | --dump-type=[csv] ]

This option will specify which file name the data will be placed in. The default value is 'csv', comma-separated values.

Output Units

The specification for the output units is:

[ --english | --English | --si | --SI ]

This option will specify which units will be used on output. If this option isn't supplied, English units are assumed.

Verbose Option

The specification for the verbose option is:

[ -v value | --verbose value ]

The value provided for the verbose setting (a digit between 0 and 5) indicates how much output is generated, 0 being minimal and 5 being extremely verbose. Positive values of setting send data to the ELF, negative value also print the message to the screen. If no value is provided, the setting is assumed to be 1.

Help Option

The specification for the help option is:

[ -h | --help ]

This option prints a summary of all the command line options and exits.

Database Parameters

The following database tables provide input for the extract program.

Station_Data

This table contains the actual station data for DEOS .

Data_Types

This table contains metadata about the various data types DEOS handles.

The available data types are described in the following table.

Availablility of Data

It should be noted that data for all data types may not be available from every station and that data for some data types are derived from other data and so may not be immediately available.

Table 1. Data Types

IDAbbreviationDescription
0RRHRadar Precipitation (60)
1RFHGage Precipitation (60)
2ATAir Temperature
3DPDew Point Temperature
4WSWind Speed
5WGHWind Gust Speed (60)
6WDWind Direction
7BPBarometric Pressure
8SRSolar Radiation
9WG5Wind Gust Speed (5)
10RF5Gage Precipitation (5)
11RHRelative humidity
12HIHeat Index
13WCWind Chill
14STSoil Temperature
15VVoltage
16RHABias-adjusted Gage Precipitation (60)
17R5ABias-adjusted Gage Precipitation (5)
18VWCVolumetric Water Content
19SDRRaw Snow Depth
20RR6Radar Precipitation (6)
21LFLeaf wetness
22VBVisibility
23GHGage Height
24RFDPrecip (daily)
25DSCDischarge
26WTWater Temperature
27SVStream Velocity
28RFQGage Precipitation (15)
29PHpH
30SCConductance
31PO2Dissolved Oxygen %saturation
32DO2Dissolved Oxygen Volume
33TBBTurbidity (BB)
34WHSignificant Wave Height
35WPDWave Period (Dominant)
36WPAWave Period (Average)
37WDAWave Direction (Average)
38BPTBarometric Pressure Trend
39TDTide (Deviation)
40FTFuel temperature
41FMFuel moisture
42WGIWind Gust Direction
43TMDMean Daily Temp.
44TXDMax Daily Temp.
45TNDMin Daily Temp.
46HDDHeating Degree Days
47CDDCooling Degree Days
48WSDMean Wind Speed
49WDDMean Wind Direction
50WGDPeak Wind Gust Speed (Daily)
51RFEGage Precipitation (Daily)
52SFDDaily Snow Fall
53TMMMTD Mean Temp.
54TXMMTD Max Temp.
55TNMMTD Min Temp.
56RFMMTD Total Rainfall.
57SFMMTD Snow Fall
58WSMMTD Mean Wind Speed
59WDMMTD Mean Wind Direction
60WGMPeak Wind Gust Speed (MTD)
61HDMMTD Heating Degree Days
62CDMMTD Cooling Degree Days
63RXMMTD Max Gage Rainfall
64SXMMTD Max Snow Fall
65RFYYTD Total Rainfall.
66SFYYTD Snow Fall
67HDYYTD Heating Degree Days
68CDYYTD Cooling Degree Days
69GHDMean Daily Gage Height
70GHXMax Daily Gage Height.
71GHNMin Daily Gage Height.
72DCDMean Daily Discharge
73DCXMax Daily Discharge
74DCNMin Daily Discharge
75GHMMTD Avg Gage Height.
76GXDMTD Max Gage Height.
77GNDMTD Min Gage Height.
78DCMMTD Mean Discharge
79DXMMTD Max Discharge
80DNMMTD Min Discharge
81VMMTD Volume
82VYYTD Volume.
83WTDMean Water Temp
84WHDMean Wave Ht
85WHXMax Wave Ht
86WHNMean Wave Period
87TDMMTD Mean Water Temp
88THDMTD Mean Wave Ht
89VHXMTD Max Wave Ht
90VHNMTD Mean Wave Period (Dominant)
91SF5Snow Fall (5)
92SFHSnow Fall (60)
93WGXWind Gust Speed (10)
94RFXGage Precipitation (10)
95TMTurbidity (MC)
96WDHMean Hourly Wind Dir
97DPDMean Daily Dew Point Temperature
98RHDMean Daily Relative Humidity>
99ATHMean Hourly Air Temperature
100DPHMean Hourly Dew Point Temperature
101RHHMean Hourly Relative Humidity
102GXHMaximum Hourly Wind Gust
103BPHMean Hourly Barometric Pressure
104SRHMean Hourly Solar Radiation
105WSHMean Hourly Wind Speed
106HIHHourly Maximum Heat Index
107HIDDaily Maximum Heat Index
108HIMMonthly Maximum Heat Index
109WCHHourly Minimum Wind Chill
110WCDDaily Minimum Wind Chill
111WCNMonthly Minimum Wind Chill
112WLWell Water Level
113WLDMean Daily Well Water Level
114SALConcentration of dissolved salts
115WXHMaximum Hourly Wave Height
116SWHAverage Hourly Wave Height
117SPHSignificant Hourly Wave Period
118SHWave Direction Spread
119SMDDaily Mean Specific Conductance
120AMDDaily Mean Concentration of Dissolved Salts
121SVDDaily Mean Dissolved O2 %Saturation
122DMDDaily Mean Dissolved Oxygen Volume
123PXDDaily Mean Hydrogen Ion Concentration
124BXDDaily Maximum Turbidity (Broad Band)
125BMDDaily Mean Turbidity (Broad Band)
126SMMMTD Mean Conductance
127AMMMTD Mean Dissolved Salt Conc.
128SVMMTD Mean Oxygen %saturation
129DMMMTD Mean Oxygen Volume
130PXMMTD Mean pH
131BXMMTD Maximum Turbidity (BB)
132BMMMTD Mean Turbidity (BB)
133HMDDaily Mean Wave Height
134HXDDaily Maximum Wave Height
135PMDDaily Mean Wave Period
136WMDDaily Mean Wave Direction
137HMMMTD Mean Wave Height
138HXMMTD Maximum Wave Height
139PMMMTD Mean Wave Period
140WMMMTD Mean Wave Direction
141WXDDaily Maximum Water Temperature
142WNDDaily Minimum Water Temperature
143WXMMTD Maximum Water Temperature
144WNMMTD Minimum Water Temperature
145AXDDaily Maximum Dissolved Salt Conc.
146ANDDaily Minimum Dissolved Salt Conc.
147SXDDaily Maximum Oxygen %saturation
148SNDDaily Minimum Oxygen %saturation
1491XDDaily Maximum pH
1501NDDaily Minimum pH
151AXMMTD Maximum Dissolved Salt Conc.
152ANMMTD Minimum Dissolved Salt Conc.
153SXXMTD Maximum Oxygen %saturation
154SNXMTD Minimum Oxygen %saturation
1551XMMTD Maximum pH
1561NMMTD Minimum pH
157WDPAvg Water Depth
158DDDDaily Mean Water Depth
159DXDDaily Max Water Depth
160DNDDaily Min Water Depth
161DDMMTD Mean Water Depth
1622XMMTD Max Water Depth
1632NMMTD Min Water Depth
1643DDDaily Avg Hourly Wave Height
1653XDDaily Max Hourly Wave Height
1663DMMTD Avg Hourly Wave Height
1673XMMTD Max Hourly Wave Height
168PT1Potential Evapotranspiration (Hamon 1963)
169PT2Potential Evapotranspiration (Hargreaves 1985)
170PTPotential Temperature
171EPTEquivalent Potential Temperature
172ETEquivalent Temperature
173EDEnergy Density
174RFEReference Evapotranspiration
175SDGSnow Depth
176PARPhotosynthetically Active Radiation
17748A48-Hour Snow Accumulation
178SDNRaw Snow Depth (Natural)
179NDGSnow Depth (Natural)
180GDDGrowing Degree Days
181DMRDaily Avg RH
182DXRDaily Max RH
183DNRDaily Min RH
184DMSDaily Avg ST
185DXSDaily Max ST
186DNSDaily Min ST
187DMVDaily Avg VWC
188DXVDaily Max VWC
189DNVDaily Min VWC
190MMRMTD Avg RH
191MMIMTD Avg Soil Temp
192MXIMTD Max Soil Temp
193MNIMTD Min Soil Temp
194MMVMTD Avg VWC
195MXVMTD Max VWC
196MNVMTD Min VWC
197DSEDaily Solar
198MDGMTD GDD
199YDGYTD GDD
200MDRMTD RET
201YDRYTD RET
202MSEMTD Avg Solar
203LCCLowest Cloud Cover Layer
204HCCHighest Cloud Cover Layer
205CWLWater Level
206PWLPredicted Water Level
207WLAWater Level Anomaly
208SA5Snow Accumulation
209HPFSnow Depth (HPF)
210SSTSnow Storm Total
211NNNNutr-Nitrogen as N
212PPPPhosphate-Phosphorus as P
213INNInorg Nitrogen as N
214ENTEnterococcus (Bacteria)
215HOXHistorical Maximum Monthly Dissolved Oxygen
216HONHistorical Minimum Monthly Dissolved Oxygen
217HOAHistorical Average Monthly Dissolved Oxygen
218HBXHistorical Maximum Monthly Enterococcus
219HBNHistorical Minimum Monthly Enterococcus
220HBAHistorical Average Monthly Enterococcus
221HNXHistorical Maximum Monthly Nutrient-Nitrogen as N
222HNNHistorical Minimum Monthly Nutrient-Nitrogen as N
223HNAHistorical Average Monthly Nutrient-Nitrogen as N
224HIXHistorical Maximum Monthly Inorganic Nitrogen (nitrite and nitrate) as N
225HINHistorical Minimum Monthly Inorganic Nitrogen (nitrite and nitrate) as N
226HIAHistorical Average Monthly Inorganic Nitrogen (nitrite and nitrate) as N
227HHXHistorical Maximum Monthly pH
228HHNHistorical Minimum Monthly pH
229HHAHistorical Average Monthly pH
230HPXHistorical Maximum Monthly Phosphate-Phosphorus as P
231HPNHistorical Minimum Monthly Phosphate-Phosphorus as P
232HPAHistorical Average Monthly Phosphate-Phosphorus as P

Unit_Types

This table contains metadata about the various unit types DEOS handles. In particular, which units the DEOS system uses by default.

Schema_Units

This table contains metadata about the various schema types DEOS handles the two principal being SI and English. This table enables a mapping between the DEOS internal units and the user selected schema. uses by default.

Unit_Conversions

This table contains metadata concerning conversion of units types, and in particular how to convert the internal DEOS unit schema to the two principal schema's of SI and English.

Output File

Further Processing of Data May Lead To Rounding Errors

Further processing of large amounts of data following generation by the extract program, particularly when using English units may generate rounding errors. This has been particularly apparent during testing when performing additional processing of precipitation data from DEOS stations (due principally to the number of data points) in English units. If such processing is required, it is strongly advised the user retrieve data in SI units and convert to English as a final step.

The extract program generates files in the following formats.

Comma-Separated Value (CSV) Format

  • The first line of the file is a header describing the data columns and will contain the data described below in comma separated form.

    • Time

    • Data item header #1 with units in parentheses

    • Other header items in the same format

  • The second and subsequent lines of the file contain comma-separated data each applicable for the time indicated.

    • Time string in YYYY-MM-DD HH:MM:SS (UTC SX), where SX is the timezone offset

    • Data item #1

    • Other data items in the same format

HDRS

The extract program serves as the back-end portion of the HDRS system. The front end is a set of web pages that allow the user to select the data types, time range and geographical area of interest for which they want data. The web front end writes the request data to the database. A PL/SQL package copntrols the queuing system and runs the extract program as needed to fulfill the data request.

Database Parameters

The following database tables provide configuration options for the cfgen program.

DEOS_Server_Settings

Table 2. cfgen Database Controls

NameDescription
NUM_PROCESSESMaximum number of extract processes to run.
DELAY_BETWEEN_RUNSThe time delay in minutes between runs.
RETENSION_TIMEThe time delay before the data files are deleted.
EXTRACTION_LIMITThe maximum number of data items a user can request.
BASE_DIRThe directory when output files are stored.
ENABLEDIndicates whether the HDRS system is enabled.
EXECThe full path to the executable file.
USERNAMEThe name of the user account under which to run the extract process.
PASSWORDThe password of the user account under which to run the extract process.
URLThe URL that gets written to the top of the metadata file.
ADDRESSThe USPS address that gets written to the top of the metadata file.
ADMIN_EMAILThe email address of the person receiving error reports.

Operational Use

For operational use, the program can be run either in batch, using the cron system, and to be run at an appropriate or run on an as needed basis.