DEOS : ODD-DIVAS Interface Specification

DEOS Technical Note #12

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: June 22nd 2004

Revision History
Revision 1.12004/06/22GEQ
Initial version
Revision 1.22005/03/31GEQ
Added network data display description.
Revision 1.32005/05/23GEQ
Added monthly station summary data display description. Added description of any image displayed. Added description of caching for pages.
Revision 1.42005/10/18GEQ
Added brief option description to current station conditions page.
Revision 1.52005/12/02GEQ
Added configuration section.
Revision 1.62006/01/17GEQ
Added snow network page description section.
Revision 1.72006/01/24GEQ
Added DelDOT network page description section. Added links to network names section.
Revision 1.82006/01/31GEQ
Added public ODD-DIVAS interface description.
Revision 2.12006/09/26GEQ
Updated daily station PHP script to station_daily from station_latest. Incremented version number of this document to 2.
Revision 2.22006/12/05GEQ
Added current well conditions page.
Revision 2.32007/06/20GEQ
Added DNERR network page.
Revision 2.42007/07/27GEQ
Added USACE buoy network page.
Revision 2.1.42007/11/28GEQ
Added full option to display derived temperature values.
Revision 2.1.72008/07/29GEQ
Added monthly agricultural page. Added link to getDataCount function.

Table of Contents

Introduction
Configuration
Cache System
Generic Data Access Page
Purpose
Options
Network Data Display
Current Data
Snow Data
Well Data
Station Data Display
Current Tabulated and Graphical Data
Agricultural Tabulated Data
Monthly Tabulated Data
Time Period Graphical Data
Daily Tabulated Summary Data
Software Interface
Common Features
Interface Functions

Introduction

This document summarizes the interface to the ODD-DIVAS component of the DEOS system. Options to the scripts below utilize the HTTP GET request format. Options are separated from their values by an equals sign with no surrounding spaces.

Any of the pages described below may contain an icon, if so, this icon will be a link to the organization with ultimate responsibility for the data on this page.

Configuration

The ODD-DIVAS system utilizes a configuration file for internal settings.

Cache System

The ODD-DIVAS system utilizes a cache to speed delivery of content. This cache is situated under the odd-divas/cache/ file-system. The cache consists of two types of sub-directory as described in the following sections.

Images and Image Data

When pages are requested that generate images and allow pop-ups of the data making up the image, each request generates a directory named with the UNIX time stamp of the initial request. Once the connection by that user is closed, the directory is no longer used and so should be removed from the server.

Cumulative Data

For pages that take considerable time to generate, once the page has been generated, the next request for that information will be served from the cache. Currently, two page types utilize the cache.

Daily Data

The daily cached files are stored in directory cache/{network}/{station}/{year}/{month}/ where the items in {} are replaced by the appropriate values. The file in this directory containing the daily data will be called N.html where N is the number of the day of the month.

Monthly Data

The monthly cached files are stored in directory cache/{network}/{station}/{year}/ where the items in {} are replaced by the appropriate values. The file containing the monthly data will be called N-{unit}.html where N is the number of the month and {unit} is either SI or english as appropriate. The page source is created the first time that that page is accessed after the month has ended.

Monthly Agricultural Data

The monthly Agricultural data cached files are stored in directory cache/{network}/{station}/{year}/ where the items in {} are replaced by the appropriate values. The file containing the monthly data will be called N-Ag-{unit}.html where N is the number of the month and {unit} is either SI or english as appropriate. The page source is created the first time that that page is accessed after the month has ended.

Generic Data Access Page

The following section describes the generic entry point to the ODD-DIVAS system. It provides a simple interface to all the available data displays implemented independent of any direct interface provided by the organization operating the DEOS system. If this interface is not required, then the capability can be removed by deleting the file odd-divas/retrieval_list.php.

Purpose

Provide a generic interface to the complete set of dynamic data that ODD-DIVAS can generate, from the current data time back up to 168 hrs ago for individual stations and 24 hours for networks.[1]

Options

There are no options to pass, the code retrieves all networks and stations that have the "in use" setting enabled in the database and creates the HTML to connect to them with the data display system.

Example 1. Generic Data Access Page


[URL]odd-divas/retrieval_list.php

Network Data Display

This section summarizes the network data display interface to the ODD-DIVAS system.

Current Data

The following section describes the current network data entry point to the ODD-DIVAS system.

Purpose

To provide a textual snapshot of the current conditions of the network.

Options

The following are the options understood by this component of the ODD-DIVAS system.

Required Options

The following items are required.

  • data_type; the valid possibilities are:

    • DEOS

    • DelDOT

    • NIDS (NEXRAD radar DPA data)

    • USGS-Water (USGS stream-flow and tidal stations)

    • NDBC (buoy data)

    • MET (METAR and RAWS data)

    • DNERR (Water quality and buoy data)

    • US Army Corps of Engineers (USACE) (buoy data)

Optional Options

The following items are optional.

  • units; what unit types to display (e.g., SI or english, default is SI).

Other Features

The pages are built to auto refresh at an appropriate frequency (typically, twice that of the data update.)

The color scheme should be self explanatory.

The "Change to English units" link should be self-explanatory

Example 2. Network Current Data


[URL]odd-divas/network_current.php?data_type=DEOS&units=english

will display the current conditions for the DEOS network using english units.

Snow Data

The following section describes the current snow data entry point to the ODD-DIVAS system.

Purpose

To provide an updated textual and graphical snapshot of the current snow conditions of the network.

Options

The following are the options understood by this component of the ODD-DIVAS system.

Required Options

The following items are required.

  • network; name of network (e.g., DEOS)

Optional Options

The following items are optional.

  • units; what unit types to display (e.g., SI or english, default is SI).

Other Features

The pages are built to auto refresh at an appropriate frequency (typically, twice that of the data update.)

The "Change to English units" link should be self-explanatory

Example 3. Snow Data


[URL]odd-divas/snow_current.php?network=DEOS&units=english

will display the current conditions for the DEOS network using english units.

Well Data

The following section describes the current DGS well data entry point to the ODD-DIVAS system.

Purpose

To provide an updated textual and graphical snapshot of the current well conditions of the DGS network.

Options

The following are the options understood by this component of the ODD-DIVAS system.

Required Options

The following items are required.

  • network; name of network (e.g., DGS-Wells)

Optional Options

The following items are optional.

  • units; what unit types to display (e.g., SI or english, default is SI).

Other Features

The pages are built to auto refresh at an appropriate frequency (typically, twice that of the data update.)

The "Change to English units" link should be self-explanatory

Example 4. Well Data


[URL]odd-divas/well_current.php?network=DGS-Wells&units=english

will display the current conditions for the DEOS network using english units.

Station Data Display

This section summarizes the station display interface to the ODD-DIVAS system.

Current Tabulated and Graphical Data

The following section describes the current station data entry point to the ODD-DIVAS system. Current data is that data that is within two data cycles of the current time for the network the station is a part of. For the DEOS stations, that means data will only be displayed if it occurs with 10 minutes of the current time.

Purpose

To provide a snapshot of the current conditions at a single station. The display and availability of graphic and text pop-ups to display the proceeding 24 hours of data are optional as controlled by the brief option described below.

Options

The following are the options understood by this component of the ODD-DIVAS system.

Required Options

The following items are required.

  • station; name of station (e.g., KDOV, KDEN)

  • network; name of network (e.g., DEOS, NWS)

Optional Options

The following items are optional.

  • units; what unit types to display (e.g., SI or english, default is SI).

  • brief; when set to non-zero a succinct summary page is generated (e.g., no pop-up graphs and data frames); when brief is zero or omitted entirely, a normal page is generated.

  • full; when set to non-zero additional derived temperature data are displayed if available. The additional values are equivalent temperature, potential temperature and equivalent potential temperature.

Other Features

The pages are built to auto refresh at an appropriate frequency (typically, twice that of the data update.)

The Chart column generates a pop-up with the 24 hour graph for that variable.

The Data link does the same for the raw data.

The "Change to English units" link should be self-explanatory

Example 5. Station Current Data


[URL]odd-divas/station_current.php?station=KDOV&network=NWS&units=english

will display the current conditions for station KDOV, of the NWS network, using english units.

Agricultural Tabulated Data

The following section describes the monthly Agricultural data entry point to the ODD-DIVAS system. Monthly agricultural data is that data that is within a specified month; the data page also includes important year-to-date values of some of the data items reported as monthly values.

Purpose

To provide a set of agricultural data for a given month for a given station for selected data.

Options

The following are the options understood by this component of the ODD-DIVAS system.

Required Options

The following items are required.

  • station; name of station (e.g., DAGF, DBNG)

  • network; name of network (e.g., DEOS)

Optional Options

The following items are optional.

  • units; what unit types to display (e.g. options are SI and english, the default is SI).

The following allow historical data to be displayed

  • year; the four-digit year

  • month; the month number

Other Features

The day number entries generate a pop-up giving the daily summary a described below.

The "Change to English units" should be self-explanatory.

Example 6. Station Agricultural Data


[URL]odd-divas/station_ag.php?station=DTOW&year=2004&month=3&network=DEOS&units=english

will display one month of agricultural data (for March 2004) for station DTOW.

Monthly Tabulated Data

The following section describes the monthly climatological data entry point to the ODD-DIVAS system. Monthly data is that data that is within a specified month; the data page also includes important year-to-date values of some of the data items reported as monthly values.

Purpose

To provide a set of climatological data for a given month for a given station for selected climatological data.

Options

The following are the options understood by this component of the ODD-DIVAS system.

Required Options

The following items are required.

  • station; name of station (e.g., KDOV, KDEN)

  • network; name of network (e.g., DEOS, NWS)

Optional Options

The following items are optional.

  • units; what unit types to display (e.g. options are SI and english, the default is SI).

The following allow historical data to be displayed

  • year; the four-digit year

  • month; the month number

Other Features

The day number entries generate a pop-up giving the daily summary a described below.

The "Change to English units" should be self-explanatory.

Example 7. Station Monthly Data


[URL]odd-divas/station_monthly.php?station=DBBB&year=2004&month=3&network=DEOS&units=english

will display one month of data (for March 2004) for station DBBB.

Time Period Graphical Data

The following section describes the period data entry point to the ODD-DIVAS system. Period data is that data that is within a specified range prior to a given date and time.

Purpose

To provide a complete set of graphical data for a given station and time period for all recorded meteorological data.

Options

The following are the options understood by this component of the ODD-DIVAS system.

Required Options

The following items are required.

  • station; name of station (e.g., KDOV, KDEN)

  • network; name of network (e.g., DEOS, NWS)

Optional Options

The following items are optional.

  • units; what unit types to display (e.g. options are SI and english, the default is SI).

  • range; how many hours of data to display, default is 24.

The following allow historical data to be displayed

  • year; the four-digit year

  • month; the month number

  • day; the day of the month

  • hour; the hour of the day

  • minute; the minute of the hour

  • second; the second of the hour

Other Features

Each of the graphs is a link to a pop-up window containing the raw data making up the graph.

The "Current" link brings up the page for the current data settings using #2 above.

The "Change to English units" should be self-explanatory.

Example 8. Station Time Period Data


[URL]odd-divas/station_period.php?station=KBWI&year=2004&month=3&day=31&hour=0&minute=0
&network=NWS&range=168&units=english

will display one week of data for station KBWI ending at midnight on 2004/3/31.

Daily Tabulated Summary Data

The following section describes the latest data display entry point to the ODD-DIVAS system. Latest data is data from a specific single day tabulated into hourly summarizes.

Purpose

To provide a complete set of tabulated hourly data for a given station and day period period for all recorded meteorological data.

Options

The following are the options understood by this component of the ODD-DIVAS system.

Required Options

The following items are required.

  • station; name of station (e.g., KDOV, KDEN)

  • network; name of network (e.g., DEOS, NWS)

Optional Options

The following items are optional and allow historical data to be displayed.

  • year; the four-digit year

  • month; the month number

  • day; the day of the month

Example 9. Station Daily Tabulated Summary Data


[URL]odd-divas/station_daily.php?station=KDEN&network=NWS

will display one day of hourly tabulated data for station KDEN ending at midnight on the day previous to the current day.

Software Interface

This section describes the published and supported software interface to the PHP functions within the ODD-DIVAS system.

Common Features

The following sections describe the features available to all functions.

Log File

In the discussions below the log file is written to cache/log. Error in interactions with Oracle are flagged.

Debug Settings

Most functions recognize and use a debug setting to allow the user and software engineer to determine what happened in case of an error. The following table describes the possible values of the debug setting.

Table 1. Debug Settings

ValueDescription
0Normal operations
1Low level of debug statements to screen and/or log file
2High level of debug statements to screen and/or log file
-1Execution time information written to the log file

Interface Functions

The following sections describe the available functions, their calling parameters and related information.

Table 2. Interface Function Summary

NameDescription
environmentGenerates an environment data graph and base data page.
flowGenerates a stream data graph and base data page.
fuelGenerates a fuel data graph and base data page.
gageGenerates a stream/tidal gage data graph and base data page.
getDataCountReturns a count value as requested by the input parameter.
o2o2Generates a O2 saturation and O2 volume data graph and base data page.
phscGenerates a water pH and specific conductance data graph and base data page.
precipGenerates a rainfall precipitation data graph and base data page.
pressureGenerates a barometric pressure and barometric pressure trend data graph and base data page.
read_data_type_dbReturns a set of data of a single data type to be retrieved for a given time period, for a given station.
read_datatype_metadataReturns the schema conversion data, if any, for the input data type.
read_network_data_dbReturns the most recent data for a given station in DEOS native units.
read_network_listReturns a list of networks that are known to the system
read_network_metadata_dbReturns the metadata for a given network.
read_station_listReturns a list of stations and which network that station is in.
read_station_metadata_dbReturns the metadata for a given station.
snowGenerates a snow depth and snowfall data graph and base data page.
solar_radiationGenerates a solar radiation data graph and base data page.
temperatureGenerates a temperature data graph and base data page.
waterGenerates a water data graph and base data page.
waveGenerates a wave data graph and base data page.
windGenerates a wind data graph and base data page.
windroseGenerates a wind data graph, in the form of a wind rose, and base data page.

Function environment Interface Description

Purpose

This function generates a graphic image in PNG format and HTML files of data used to generate the graphs. Data types plotted are heat index, wind chill, soil temperature and volumetric water content (VWC). If a data item is not available, its graph is not plotted, if no data is available for any of the input types the text "No Data" is plotted in a white rectangle in the middle of a gray background.

Global Constants Used

This function uses the following ODD-DIVAS global constants. The global constants are

Table 3. Global Constants used by Function environment

NameDescription
gWIDTHWidth in pixels of the generated graph
gHEIGHTHeight in pixels of the generated graph
Argument List

The environment utilizes the following arguments in the following order.

Table 4. Argument List for Function environment

NameTypeValuesDescription
$subdirInputSubdirectory for the output of the generated files, used in cache/$subdir/ 
$hoursInputNumberNot used
$heat_index_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$heat_index_valuesInputArray of data valuesTime index must correspond to value index
$heat_index_unitInputUnit symbol for this data type 
$wind_chill_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$wind_chill_valuesInputArray of data valuesTime index must correspond to value index
$wind_chill_unitInputUnit symbol for this data type 
$soil_temp_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$soil_temp_valuesInputArray of data valuesTime index must correspond to value index
$soil_temp_unitInputUnit symbol for this data type 
$vwc_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$vwc_valuesInputArray of data valuesTime index must correspond to value index
$vwc_unitInputUnit symbol for this data type 
$unitsInputEither 'SI' or 'english' 
$debugInputSee above 
Files Generated

This function generates the following files.

Table 5. Data Files Generated

NameContents
env.pngGraph of data
env.htmWeb page frame containing all data
hi.htmWeb page containing heat index data
st.htmWeb page containing soil temperature data
wc.htmWeb page containing wind chill data
vwc.htmWeb page containing volumetric water content data
Include File Name

To use the environment function, the following PHP statement needs to be used in the file using this function.


include_once ('ofnidb.jnk');
include_once ('environment.php');

Function flow Interface Description

Purpose

This function generates a graphic image in PNG format and HTML files of data used to generate the graphs. Data types plotted are discharge and stream velocity. If a data item is not available, its graph is not plotted, if no data is available for any of the input types the text "No Data" is plotted in a white rectangle in the middle of a gray background.

Global Constants Used

This function uses the following ODD-DIVAS global constants. The global constants are

Table 6. Global Constants used by Function flow

NameDescription
gWIDTHWidth in pixels of the generated graph
gHEIGHTHeight in pixels of the generated graph
Argument List

The flow utilizes the following arguments in the following order.

Table 7. Argument List for Function flow

NameTypeValuesDescription
$subdirInputSubdirectory for the output of the generated files, used in cache/$subdir/ 
$hoursInputNumberNot used
$discharge_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$discharge_valuesInputArray of data valuesTime index must correspond to value index
$discharge_unitInputUnit symbol for this data type 
$stream_velocity_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$stream_velocity_valuesInputArray of data valuesTime index must correspond to value index
$stream_velocity_unitInputUnit symbol for this data type 
$unitsInputEither 'SI' or 'english' 
$debugInputSee above 
Files Generated

This function generates the following files.

Table 8. Data Files Generated

NameContents
flow.pngGraph of data
flow.htmWeb page frame containing all data
dc.htmWeb page containing discharge data
sv.htmWeb page containing stream velocity data
Include File Name

To use the flow function, the following PHP statement needs to be used in the file using this function.


include_once ('ofnidb.jnk');
include_once ('flow.php');

Function fuel Interface Description

Purpose

This function generates a graphic image in PNG format and HTML files of data used to generate the graphs. Data types plotted are fuel temperature and fuel moisture. If a data item is not available, its graph is not plotted, if no data is available for any of the input types the text "No Data" is plotted in a white rectangle in the middle of a gray background.

Global Constants Used

This function uses the following ODD-DIVAS global constants. The global constants are

Table 9. Global Constants used by Function fuel

NameDescription
gWIDTHWidth in pixels of the generated graph
gHEIGHTHeight in pixels of the generated graph
Argument List

The fuel utilizes the following arguments in the following order.

Table 10. Argument List for Function fuel

NameTypeValuesDescription
$subdirInputSubdirectory for the output of the generated files, used in cache/$subdir/ 
$hoursInputNumberNot used
$fuel_temp_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$fuel_temp_valuesInputArray of data valuesTime index must correspond to value index
$fuel_temp_unitInputUnit symbol for this data type 
$fuel_moisture_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$fuel_moisture_valuesInputArray of data valuesTime index must correspond to value index
$fuel_moisture_unitInputUnit symbol for this data type 
$unitsInputEither 'SI' or 'english' 
$debugInputSee above 
Files Generated

This function generates the following files.

Table 11. Data Files Generated

NameContents
fuel.pngGraph of data
fuel.htmWeb page frame containing all data
ft.htmWeb page containing fuel temperature data
fm.htmWeb page containing fuel moisture data
Include File Name

To use the fuel function, the following PHP statement needs to be used in the file using this function.


include_once ('ofnidb.jnk');
include_once ('fuel.php');

Function gage Interface Description

Purpose

This function generates a graphic image in PNG format and HTML files of data used to generate the graphs. Data types plotted are gage height. If a data item is not available, its graph is not plotted, if no data is available for any of the input types the text "No Data" is plotted in a white rectangle in the middle of a gray background.

Global Constants Used

This function uses the following ODD-DIVAS global constants. The global constants are

Table 12. Global Constants used by Function gage

NameDescription
gWIDTHWidth in pixels of the generated graph
gHEIGHTHeight in pixels of the generated graph
Argument List

The gage utilizes the following arguments in the following order.

Table 13. Argument List for Function gage

NameTypeValuesDescription
$subdirInputSubdirectory for the output of the generated files, used in cache/$subdir/ 
$hoursInputNumberNot used
$height_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$height_valuesInputArray of data valuesTime index must correspond to value index
$height_unitInputUnit symbol for this data type 
$bankfullInputNumberBankfull value for this gage
$flood_stageInputNumberFlood stage value for this gage
$critical_levelInputNumberCritical level value for this gage
$unitsInputEither 'SI' or 'english' 
$debugInputSee above 
Files Generated

This function generates the following files.

Table 14. Data Files Generated

NameContents
gage.pngGraph of data
gage.htmWeb page frame containing all data
gh.htmWeb page containing gage height data
Include File Name

To use the gage function, the following PHP statement needs to be used in the file using this function.


include_once ('ofnidb.jnk');
include_once ('gage.php');

Function getDataCount Interface Description

Purpose

This function returns a count of the data items requested by the input parameter.

Global Constants Used

This function uses the following ODD-DIVAS global constants. The global constants are

Table 15. Global Constants used by Function getDataCount

NameDescription
gDBUSERUser-name used to connect to database
gDBPWPassword used to connect to database
gDBName of database
Argument List

The getDataCount utilizes the following arguments in the following order.

Table 16. Argument List for Function getDataCount

NameTypeValuesDescription
$typeInputName of the data count to returnThis value must be one of DATA_COUNT (number of station data measurements), STATION_COUNT (number of in-use stations) or FIELD_COUNT (number of stored gridded fields.)
$debugInputSee above 
Files Generated

This function does not generate any files.

Include File Name

To use the getDataCount function, the following PHP statement needs to be used in the file using this function.


include_once ('odd-divas/ofnidb.jnk');
include_once ('odd-divas/read_data_db.php');

Function o2o2 Interface Description

Purpose

This function generates a graphic image in PNG format and HTML files of data used to generate the graphs. Data types plotted are O2 saturation and O2 volume. If a data item is not available, its graph is not plotted, if no data is available for any of the input types the text "No Data" is plotted in a white rectangle in the middle of a gray background.

Global Constants Used

This function uses the following ODD-DIVAS global constants. The global constants are

Table 17. Global Constants used by Function o2o2

NameDescription
gWIDTHWidth in pixels of the generated graph
gHEIGHTHeight in pixels of the generated graph
Argument List

The o2o2 utilizes the following arguments in the following order.

Table 18. Argument List for Function o2o2

NameTypeValuesDescription
$subdirInputSubdirectory for the output of the generated files, used in cache/$subdir/ 
$hoursInputNumberNot used
$o2_percent_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$o2_percent_valuesInputArray of data valuesTime index must correspond to value index
$o2_percent_unitInputUnit symbol for this data type 
$o2_volume_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$o2_volume_valuesInputArray of data valuesTime index must correspond to value index
$o2_volume_unitInputUnit symbol for this data type 
$unitsInputEither 'SI' or 'english' 
$debugInputSee above 
Files Generated

This function generates the following files.

Table 19. Data Files Generated

NameContents
o2o2.pngGraph of data
o2o2.htmWeb page frame containing all data
op.htmWeb page containing O2 percentage data
ov.htmWeb page containing O2 volume data
Include File Name

To use the o2o2 function, the following PHP statement needs to be used in the file using this function.


include_once ('ofnidb.jnk');
include_once ('o2o2.php');

Function phsc Interface Description

Purpose

This function generates a graphic image in PNG format and HTML files of data used to generate the graphs. Data types plotted are water pH and specific conductance. If a data item is not available, its graph is not plotted, if no data is available for any of the input types the text "No Data" is plotted in a white rectangle in the middle of a gray background.

Global Constants Used

This function uses the following ODD-DIVAS global constants. The global constants are

Table 20. Global Constants used by Function phsc

NameDescription
gWIDTHWidth in pixels of the generated graph
gHEIGHTHeight in pixels of the generated graph
Argument List

The phsc utilizes the following arguments in the following order.

Table 21. Argument List for Function phsc

NameTypeValuesDescription
$subdirInputSubdirectory for the output of the generated files, used in cache/$subdir/ 
$hoursInputNumberNot used
$ph_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$ph_valuesInputArray of data valuesTime index must correspond to value index
$ph_unitInputUnit symbol for this data type 
$sc_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$sc_valuesInputArray of data valuesTime index must correspond to value index
$sc_unitInputUnit symbol for this data type 
$unitsInputEither 'SI' or 'english' 
$debugInputSee above 
Files Generated

This function generates the following files.

Table 22. Data Files Generated

NameContents
phsc.pngGraph of data
phsc.htmWeb page frame containing all data
ph.htmWeb page containing pH data
sc.htmWeb page containing specific conductance data
Include File Name

To use the phsc function, the following PHP statement needs to be used in the file using this function.


include_once ('ofnidb.jnk');
include_once ('phsc.php');

Function precip Interface Description

Purpose

This function generates a graphic image in PNG format and HTML files of data used to generate the graphs. Data types plotted are rainfall. If a data item is not available, its graph is not plotted, if no data is available for any of the input types the text "No Data" is plotted in a white rectangle in the middle of a gray background.

Global Constants Used

This function uses the following ODD-DIVAS global constants. The global constants are

Table 23. Global Constants used by Function precip

NameDescription
gWIDTHWidth in pixels of the generated graph
gHEIGHTHeight in pixels of the generated graph
Argument List

The precip utilizes the following arguments in the following order.

Table 24. Argument List for Function precip

NameTypeValuesDescription
$subdirInputSubdirectory for the output of the generated files, used in cache/$subdir/ 
$hoursInputNumberNot used
$minutesInputNumberTime period for measurements. (Not used.)
$rainfall_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$rainfall_valuesInputArray of data valuesTime index must correspond to value index
$rainfall_unitInputUnit symbol for this data type 
$unitsInputEither 'SI' or 'english' 
$debugInputSee above 
Files Generated

This function generates the following files.

Table 25. Data Files Generated

NameContents
precip.pngGraph of data
rain.htmWeb page frame containing all data
rf.htmWeb page containing rainfall data
Include File Name

To use the precip function, the following PHP statement needs to be used in the file using this function.


include_once ('ofnidb.jnk');
include_once ('precip.php');

Function pressure Interface Description

Purpose

This function generates a graphic image in PNG format and HTML files of data used to generate the graphs. Data types plotted are barometric pressure and barometric pressure trend. If a data item is not available, its graph is not plotted, if no data is available for any of the input types the text "No Data" is plotted in a white rectangle in the middle of a gray background.

Global Constants Used

This function uses the following ODD-DIVAS global constants. The global constants are

Table 26. Global Constants used by Function pressure

NameDescription
gWIDTHWidth in pixels of the generated graph
gHEIGHTHeight in pixels of the generated graph
Argument List

The pressure utilizes the following arguments in the following order.

Table 27. Argument List for Function pressure

NameTypeValuesDescription
$subdirInputSubdirectory for the output of the generated files, used in cache/$subdir/ 
$hoursInputNumberNot used
$pressure_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$pressure_valuesInputArray of data valuesTime index must correspond to value index
$pressure_unitInputUnit symbol for this data type 
$pressure_trend_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$pressure_trend_valuesInputArray of data valuesTime index must correspond to value index
$pressure_trend_unitInputUnit symbol for this data type 
$unitsInputEither 'SI' or 'english' 
$debugInputSee above 
Files Generated

This function generates the following files.

Table 28. Data Files Generated

NameContents
pressure.pngGraph of data
pressure.htmWeb page frame containing all data
bp.htmWeb page containing discharge data
bpt.htmWeb page containing stream velocity data
Include File Name

To use the pressure function, the following PHP statement needs to be used in the file using this function.


include_once ('ofnidb.jnk');
include_once ('pressure.php');

Function read_data_type_db Interface Description

Purpose

This function allows a set of data of a single data type to be retrieved for a given time period, for a given station. The data is returned in the unit schema requested.

Global Constants Used

This function uses the following ODD-DIVAS global constants.

Table 29. Global Constants used by Function read_data_type_db

NameDescription
gDBUSERUser-name used to connect to database
gDBPWPassword used to connect to database
gDBName of database
Argument List

The read_data_type_db utilizes the following arguments in the following order.

Table 30. Argument List for Function read_data_type_db

NameTypeValuesDescription
$startInputTime string as yyyy/mm/dd hh:mm:ss 
$endInputTime string as yyyy/mm/dd hh:mm:ssHas to be earlier than $start
$unitsInputEither 'SI' or 'english' 
$stationInputName of station 
$networkInputName of network 
$debugInputSee above 
$typeInputData type valueSee database/data_types.sql for the available values
$valuesOutputA data array of valuesEach index in the data array corresponds to the same index in the time array
$timeOutputAn array of time strings as yyyy/mm/dd hh:mm:ssIn descending time order and in local time zone
$symbolOutputA stringUnit symbol for this data type
$precisionOutputA number (default 2)Number of significant decimal digits appropriate for this data type.
Include File Name

To use the read_data_type_db function, the following PHP statement needs to be used in the file using this function.


include_once ('ofnidb.jnk');
include_once ('read_data_db.php');

Function read_datatype_metadata Interface Description

Purpose

This function returns the schema conversion data, if any, for the input data type.

Global Constants Used

This function uses the following ODD-DIVAS global constants.

Table 31. Global Constants used by Function read_datatype_metadata

NameDescription
gDBUSERUser-name used to connect to database
gDBPWPassword used to connect to database
gDBName of database
Argument List

The read_datatype_metadata utilizes the following arguments in the following order.

Table 32. Argument List for Function read_datatype_metadata

NameTypeValuesDescription
$data_typeInputNumber 
$unitsInputEither 'SI' or 'english' 
$resultsOutputAn array of data as described below 
$debugOutputSee above 
$handleInput/OutputFile handleA handle as returned by the fopen command. Used for error and debug output.

The following table indicates the fields available in the output $results array described above.

Table 33. Network Station Metadata

No.KeyTypeDescription
1NAMEStringName of data type
2DESCRIPTIONStringUnit type description
3SYMBOLStringUnit symbol
4PREADDITIONNumberSee below
5PRECISIONNumberNumber of significant decimal places.
6CONVERSIONNumberSee below
7POSTNumberSee below
8DTYPENumberData type ID
9FROMUNITNumberSee below
10TOUNITNumberSee below
11STYPENumberSchema type ID
12UTYPENumberUnit type ID
13NNumberValue of row in data listing.

The FROMUNIT and TOUNIT are the unit type ID's of the database and requested schema respectively.

Include File Name

To use the read_datatype_metadata function, the following PHP statement needs to be used in the file using this function.


include_once ('ofnidb.jnk');
include_once ('read_data_db.php');

Function read_network_data_db Interface Description

Purpose

This function returns the most recent data for a given station in DEOS native units.

Global Constants Used

This function uses the following ODD-DIVAS global constants.

Table 34. Global Constants used by Function read_network_data_db

NameDescription
gDBUSERUser-name used to connect to database
gDBPWPassword used to connect to database
gDBName of database
Argument List

The read_network_data_db utilizes the following arguments in the following order.

Table 35. Argument List for Function read_network_data_db

NameTypeValuesDescription
$networkInputName of network 
$resultsOutputArrayAn array of database records containing data described below.
$debugInputSee above 
$handleInput/OutputFile handleA handle as returned by the fopen command. Used for error and debug output.

The following table indicates the fields available in the output $results array described above.

Table 36. Network Station Metadata

No.KeyTypeDescription
1NAMEStringStation name
2CITYString 
3STATEString 
4DATA_TYPENumber 
5VALUENumber 
6ST_IDNumberDatabase key from the station_times table for this data item
7TIMETime string as yyyy/mm/dd hh:mm:ss 
8WATERBODYString 
9BASINString 
10LOCATIONDESCStringLocation description string. Only returns for NDBC and RAWS networks
11NNumberValue of row in data listing.
Include File Name

To use the read_network_data_db function, the following PHP statement needs to be used in the file using this function.


include_once ('ofnidb.jnk');
include_once ('read_data_db.php');

Function read_network_list Interface Description

Purpose

This function returns a list of networks that are known to the system.

Global Constants Used

This function uses the following ODD-DIVAS global constants.

Table 37. Global Constants used by Function read_network_list

NameDescription
gDBUSERUser-name used to connect to database
gDBPWPassword used to connect to database
gDBName of database
Argument List

The read_network_list utilizes the following arguments in the following order.

Table 38. Argument List for Function read_network_list

NameTypeValuesDescription
$networksOutputAn array of network namesNetwork index and station index correspond.
$debugInputSee above 

The data is returned in alphabetical order.

Include File Name

To use the read_network_list function, the following PHP statement needs to be used in the file using this function.


include_once ('ofnidb.jnk');
include_once ('read_data_db.php');

Function read_network_metadata_db Interface Description

Purpose

This function returns the metadata for a given network.

Global Constants Used

This function uses the following ODD-DIVAS global constants.

Table 39. Global Constants used by Function read_network_metadata_db

NameDescription
gDBUSERUser-name used to connect to database
gDBPWPassword used to connect to database
gDBName of database
Argument List

The read_network_metadata_db utilizes the following arguments in the following order.

Table 40. Argument List for Function read_network_metadata_db

NameTypeValuesDescription
$networkInputName of network 
$debugInputSee above 
$typeOutputNameNetwork type
$descriptionOutputString 
$update_freqOutputNumberNetwork update frequency in minutes
$tz_offsetOutputNumberTime zone offset from GMT in hours
$dst_obsOutput0 or 1Whether this station observes daylight savings time
$stale_valOutputValueValue in minutes for the yellow highlight in network status page display
$old_valOutputValueValue in minutes for the orange highlight in network status page display
$very_old_valOutputValueValue in minutes for the red highlight in network status page display

The following values may be missing, the description and the highlight values.

Include File Name

To use the read_network_metadata_db function, the following PHP statement needs to be used in the file using this function.


include_once ('ofnidb.jnk');
include_once ('read_data_db.php');

Function read_station_list Interface Description

Purpose

This function returns a list of stations and which network that station is in.

Global Constants Used

This function uses the following ODD-DIVAS global constants.

Table 41. Global Constants used by Function read_station_list

NameDescription
gDBUSERUser-name used to connect to database
gDBPWPassword used to connect to database
gDBName of database
Argument List

The read_station_list utilizes the following arguments in the following order.

Table 42. Argument List for Function read_station_list

NameTypeValuesDescription
$stationsOutputAn array of station names 
$networksOutputAn array of network namesNetwork index and station index correspond.
$radar_omittedInput0 or 1If 1 indicates that radar station names are to be omitted
$debugInputSee above 

The data is returned sorted by network name and then station name.

Include File Name

To use the read_station_list function, the following PHP statement needs to be used in the file using this function.


include_once ('ofnidb.jnk');
include_once ('read_data_db.php');

Function read_station_metadata_db Interface Description

Purpose

This function returns the metadata for a given station.

Global Constants Used

This function uses the following ODD-DIVAS global constants.

Table 43. Global Constants used by Function read_station_metadata_db

NameDescription
gDBUSERUser-name used to connect to database
gDBPWPassword used to connect to database
gDBName of database
Argument List

The read_station_metadata_db utilizes the following arguments in the following order.

Table 44. Argument List for Function read_station_metadata_db

NameTypeValuesDescription
$station_nameInputName of station 
$display_nameOutputDisplay name of station 
$networkInputName of network 
$debugInputSee above 
$latitudeOutputValueIn decimal degrees
$longitudeOutputValueIn decimal degrees
$elevationOutputValueIn meters
$tz_offsetOutputValueTime zone offset from GMT in hours
$dst_obsOutput0 or 1Whether this station observes daylight savings time
$water_depthOutputValueOcean depth at station in meters
$bankfullOutputValueIn meters
$flood_stageOutputValueIn meters
$critical_levelOutputValueIn meters
$basinOutputName 
$waterbodyOutputName 
$cityOutputName 
$stateOutputName 

All output values except elevation, time zone offset, DST observed, latitude and longitude may be missing.

Include File Name

To use the read_station_metadata_db function, the following PHP statement needs to be used in the file using this function.


include_once ('ofnidb.jnk');
include_once ('read_data_db.php');

Function snow Interface Description

Purpose

This function generates a graphic image in PNG format and HTML files of data used to generate the graphs. Data types plotted are snow depth and snow fall. If a data item is not available, its graph is not plotted, if no data is available for any of the input types the text "No Data" is plotted in a white rectangle in the middle of a gray background.

Global Constants Used

This function uses the following ODD-DIVAS global constants. The global constants are

Table 45. Global Constants used by Function snow

NameDescription
gWIDTHWidth in pixels of the generated graph
gHEIGHTHeight in pixels of the generated graph
Argument List

The snow utilizes the following arguments in the following order.

Table 46. Argument List for Function snow

NameTypeValuesDescription
$subdirInputSubdirectory for the output of the generated files, used in cache/$subdir/ 
$hoursInputNumberNot used.
$minutesInputNumberTime period for measurements. (Not used.)
$snow_depth_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$snow_depth_valuesInputArray of data valuesTime index must correspond to value index
$snow_depth_unitInputUnit symbol for this data type 
$snow_fall_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$snow_fall_valuesInputArray of data valuesTime index must correspond to value index
$snow_fall_unitInputUnit symbol for this data type 
$unitsInputEither 'SI' or 'english' 
$debugInputSee above 
Files Generated

This function generates the following files.

Table 47. Data Files Generated

NameContents
snow.pngGraph of data
snow.htmWeb page frame containing all data
sd.htmWeb page containing snow depth data
sf.htmWeb page containing snowfall
Include File Name

To use the snow function, the following PHP statement needs to be used in the file using this function.


include_once ('ofnidb.jnk');
include_once ('snow.php');

Function solar_radiation Interface Description

Purpose

This function generates a graphic image in PNG format and HTML files of data used to generate the graphs. Data types plotted are solar radiation. If a data item is not available, its graph is not plotted, if no data is available for any of the input types the text "No Data" is plotted in a white rectangle in the middle of a gray background.

Global Constants Used

This function uses the following ODD-DIVAS global constants. The global constants are

Table 48. Global Constants used by Function solar_radiation

NameDescription
gWIDTHWidth in pixels of the generated graph
gHEIGHTHeight in pixels of the generated graph
Argument List

The solar_radiation utilizes the following arguments in the following order.

Table 49. Argument List for Function solar_radiation

NameTypeValuesDescription
$subdirInputSubdirectory for the output of the generated files, used in cache/$subdir/ 
$hoursInputNumberNot used
$solar_rad_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$solar_rad_valuesInputArray of data valuesTime index must correspond to value index
$solar_rad_unitInputUnit symbol for this data type 
$unitsInputEither 'SI' or 'english' 
$debugInputSee above 
Files Generated

This function generates the following files.

Table 50. Data Files Generated

NameContents
solar_rad.pngGraph of data
solar.htmWeb page frame containing all data
sr.htmWeb page containing solar radiation data
Include File Name

To use the solar_radiation function, the following PHP statement needs to be used in the file using this function.


include_once ('ofnidb.jnk');
include_once ('solar_radiation.php');

Function temperature Interface Description

Purpose

This function generates a graphic image in PNG format and HTML files of data used to generate the graphs. Data types plotted are air temperature, dew point temperature and relative humidity. If a data item is not available, its graph is not plotted, if no data is available for any of the input types the text "No Data" is plotted in a white rectangle in the middle of a gray background.

Global Constants Used

This function uses the following ODD-DIVAS global constants. The global constants are

Table 51. Global Constants used by Function temperature

NameDescription
gWIDTHWidth in pixels of the generated graph
gHEIGHTHeight in pixels of the generated graph
Argument List

The temperature utilizes the following arguments in the following order.

Table 52. Argument List for Function temperature

NameTypeValuesDescription
$subdirInputSubdirectory for the output of the generated files, used in cache/$subdir/ 
$hoursInputNumberNot used
$air_temp_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$air_temp_valuesInputArray of data valuesTime index must correspond to value index
$air_temp_unitInputUnit symbol for this data type 
$dew_point_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$dew_point_valuesInputArray of data valuesTime index must correspond to value index
$dew_point_unitInputUnit symbol for this data type 
$rel_hum_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$rel_hum_valuesInputArray of data valuesTime index must correspond to value index
$rel_hum_unitInputUnit symbol for this data type 
$unitsInputEither 'SI' or 'english' 
$debugInputSee above 
Files Generated

This function generates the following files.

Table 53. Data Files Generated

NameContents
temp.pngGraph of data
temp.htmWeb page frame containing all data
at.htmWeb page containing air temperature data
dp.htmWeb page containing dew point temperature data
rh.htmWeb page containing relative humidity data
Include File Name

To use the temperature function, the following PHP statement needs to be used in the file using this function.


include_once ('ofnidb.jnk');
include_once ('temperature.php');

Function water Interface Description

Purpose

This function generates a graphic image in PNG format and HTML files of data used to generate the graphs. Data types plotted are water temperature and turbidity. If a data item is not available, its graph is not plotted, if no data is available for any of the input types the text "No Data" is plotted in a white rectangle in the middle of a gray background.

Global Constants Used

This function uses the following ODD-DIVAS global constants. The global constants are

Table 54. Global Constants used by Function water

NameDescription
gWIDTHWidth in pixels of the generated graph
gHEIGHTHeight in pixels of the generated graph
Argument List

The water utilizes the following arguments in the following order.

Table 55. Argument List for Function water

NameTypeValuesDescription
$subdirInputSubdirectory for the output of the generated files, used in cache/$subdir/ 
$hoursInputNumberNot used
$water_temp_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$water_temp_valuesInputArray of data valuesTime index must correspond to value index
$water_temp_unitInputUnit symbol for this data type 
$turbidity_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$turbidity_valuesInputArray of data valuesTime index must correspond to value index
$turbidity_unitInputUnit symbol for this data type 
$unitsInputEither 'SI' or 'english' 
$debugInputSee above 
Files Generated

This function generates the following files.

Table 56. Data Files Generated

NameContents
water.pngGraph of data
water.htmWeb page frame containing all data
wtp.htmWeb page containing water temperature data
trb.htmWeb page containing turbidity data
Include File Name

To use the water function, the following PHP statement needs to be used in the file using this function.


include_once ('ofnidb.jnk');
include_once ('water.php');

Function wave Interface Description

Purpose

This function generates a graphic image in PNG format and HTML files of data used to generate the graphs. Data types plotted are wave height and dominant wave period. If a data item is not available, its graph is not plotted, if no data is available for any of the input types the text "No Data" is plotted in a white rectangle in the middle of a gray background.

Global Constants Used

This function uses the following ODD-DIVAS global constants. The global constants are

Table 57. Global Constants used by Function wave

NameDescription
gWIDTHWidth in pixels of the generated graph
gHEIGHTHeight in pixels of the generated graph
Argument List

The wave utilizes the following arguments in the following order.

Table 58. Argument List for Function wave

NameTypeValuesDescription
$subdirInputSubdirectory for the output of the generated files, used in cache/$subdir/ 
$hoursInputNumberNot used
$wave_height_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$wave_height_valuesInputArray of data valuesTime index must correspond to value index
$wave_height_unitInputUnit symbol for this data type 
$dom_wave_per_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$dom_wave_per_valuesInputArray of data valuesTime index must correspond to value index
$dom_wave_per_unitInputUnit symbol for this data type 
$unitsInputEither 'SI' or 'english' 
$debugInputSee above 
Files Generated

This function generates the following files.

Table 59. Data Files Generated

NameContents
wave.pngGraph of data
wave.htmWeb page frame containing all data
wh.htmWeb page containing wave height data
dwp.htmWeb page containing dominant wave period data
Include File Name

To use the wave function, the following PHP statement needs to be used in the file using this function.


include_once ('ofnidb.jnk');
include_once ('wave.php');

Function wind Interface Description

Purpose

This function generates a graphic image in PNG format and HTML files of data used to generate the graphs. Data types plotted are wind speed, direction and gust speed. If a data item is not available, its graph is not plotted, if no data is available for any of the input types the text "No Data" is plotted in a white rectangle in the middle of a gray background.

Wind Direction Plot

The wind direction is plotted in the form of a linear plot, rather than a wind rose, if gPRO is zero; wind direction not plotted otherwise.

Global Constants Used

This function uses the following ODD-DIVAS global constants. The global constants are

Table 60. Global Constants used by Function wind

NameDescription
gWIDTHWidth in pixels of the generated graph
gHEIGHTHeight in pixels of the generated graph
gPROIndicates if the professional JpGraph software is installed.
Argument List

The wind utilizes the following arguments in the following order.

Table 61. Argument List for Function wind

NameTypeValuesDescription
$subdirInputSubdirectory for the output of the generated files, used in cache/$subdir/ 
$hoursInputNumberNot used
$minutesInputNumberTime period for measurements
$wind_dir_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$wind_dir_valuesInputArray of data valuesTime index must correspond to value index
$wind_dir_unitInputUnit symbol for this data type 
$wind_speed_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$wind_speed_valuesInputArray of data valuesTime index must correspond to value index
$wind_speed_unitInputUnit symbol for this data type 
$wind_gust_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$wind_gust_valuesInputArray of data valuesTime index must correspond to value index
$wind_gust_unitInputUnit symbol for this data type 
$unitsInputEither 'SI' or 'english' 
$debugInputSee above 
Files Generated

This function generates the following files.

Table 62. Data Files Generated

NameContents
wind.pngGraph of data
wind.htmWeb page frame containing all data
ws.htmWeb page containing wind speed data
wd.htmWeb page containing wind direction data
wg.htmWeb page containing wind gust speed data
Include File Name

To use the wind function, the following PHP statement needs to be used in the file using this function.


include_once ('ofnidb.jnk');
include_once ('wind.php');

Function windrose Interface Description

Purpose

This function generates a graphic image in PNG format and HTML files of data used to generate the graphs. Data types plotted are wind direction and speed in the form of a wind rose. If a data item is not available, its graph is not plotted, if no data is available for any of the input types the text "No Data" is plotted in a white rectangle in the middle of a gray background.

Wind Direction Plot

The wind direction and speed combination is plotted in the form of a wind rose.

Global Constants Used

This function uses the following ODD-DIVAS global constants. The global constants are

Table 63. Global Constants used by Function windrose

NameDescription
gWIDTHWRWidth in pixels of the generated graph
gHEIGHTWRHeight in pixels of the generated graph
Argument List

The windrose utilizes the following arguments in the following order.

Table 64. Argument List for Function windrose

NameTypeValuesDescription
$subdirInputSubdirectory for the output of the generated files, used in cache/$subdir/ 
$hoursInputNumberNot used
$minutesInputNumberTime period for measurements
$wind_dir_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$wind_dir_valuesInputArray of data valuesTime index must correspond to value index
$wind_dir_unitInputUnit symbol for this data type 
$wind_speed_timesInputArray of times as yyyy/mm/dd hh:mm:ss 
$wind_speed_valuesInputArray of data valuesTime index must correspond to value index
$wind_speed_unitInputUnit symbol for this data type 
$unitsInputEither 'SI' or 'english' 
$debugInputSee above 
Files Generated

This function generates the following files.

Table 65. Data Files Generated

NameContents
windrose.pngGraph of data
windrose.htmWeb page frame containing all data
wrs.htmWeb page containing wind speed data
wrd.htmWeb page containing wind direction data
Include File Name

To use the windrose function, the following PHP statement needs to be used in the file using this function.


include_once ('ofnidb.jnk');
include_once ('wind_rose.php');



[1] The retrieval is so limited to prevent timeouts in PHP processing for large datasets or stations reporting more frequently than hourly.