Skip to content

Latest commit

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

hydroJSON

Synopsis

A JSON based standard for interchanging hydro, meteorological and environmental data. The main goal of this standard is to have a common way of interchanging and using HydroMet data via web services. Given the ease with importing JSON formatted objects programmatically, this standard has use cases in modeling as well.

Examples

Retrieve 7 days of flow from a dam

/getjson?query=["dwr flow"]&backward=7d

Format time to be seconds past the epoch for use in client side plotting

/getjson?query=["dwr flow"]&backward=7d&time_format=%s

List all available timeseries names for a given site:

/getjson?tscatalog=["GCL"]

All available sites/Stations with metadata:

/getjson?catalog=[]

Motivation

the purpose of hydroJSON is to standardize the interchange of timeseries data and metadata in a more modern, browser/mobile friendly format.

Installation

API Reference

Timeseries Query

{
"timeseries" : [["tsid1","units1","interval1"], ["tsid2","units2","interval2"], ["tsid3","units3","interval3"]],
"startdt":"ISO-8601",
"enddt":"ISO-8601",
"forward":"ISO-8601", //referenced from startdt, or datetime.now() if nothing specified
"back": "ISO-8601", //referenced from enddt, or datetime.now() if nothing specified
"query" : {"Stations":["BON","12340000","BIGI"], "Parameters":["Flow","03065","QD"]}
}
getjson?timeseries=[["CHJ Q","cfs","Daily"], ["CHJ.Flow.Inst.1Day.0.CBT-REV","kcfs"], ["12437990 00060","cfs"]]

General Abstract Query

General abstract queries allow the end user to provide keywords. The service will return hydroJSON timeseries objects with the data they want.

getjson?query=["CHJ Daily Avg Flow"]

Catalog Query

getjson?catalog=["CHJ Daily Avg Flow"]

Most Recent Value Query

getjson?mostrecent=[["12437990", "cfs"]]


Database Structure

SiteCatalog

NameTypeDescription
siteidstringidentifier for the site example: LakeMead
descriptionstringdescription for this site location
statestringstate code i.e. ID = Idaho
latitudestringlatitude of site
longitudestringlongitude of site
elevationstringelevation of the site (in units of vertical datum description)
timezonestringfull name example: US/Pacific
installstringdate site was installed
horizontal_datumstringdatum description for lat/long. Example: (WGS84)
vertical_datumstringdescription of vertical datum for the site. example(NGVD29)
verticalfloataccuracy accuracy of elevation
elevation_methodstringmethod used to determine elevation
tz_offsetstringoptional hours -08:00
active_flagstringsite is currently being used T/F default T if blank
responsibilitystringmaintenance responsibility
agency_regionstringgrouping by organization regions
typestringEX: agrimet, stream, reservoir, weather, canal, diversion, snotel

SeriesCatalog

NameTypeDescription
idintegerPrimary key
parentidintegerSiteDataTypeID of containing folder
isfolderintegerWhen true this row represents a folder not a series
sortorderintegerSort order within a folder for user interface
iconnamestringUse to render an icon based on the source of data
namestringDisplay Name and name for equations referencing this Series/row
siteidstringReference to site/location information
unitsstringUnits of measurement such as: feet,cfs, or acre-feet
timeintervalstringOne of : (Instant, Daily, Monthly)
parameterstringDescription for data such as: daily average flow
tablenamestringUnique database table name for this Series/row
providerstringName of a class derived from Reclamation.TimeSeries.Series (or Series)
connectionstringstringProvider specific connection information such as a path to an excel file, sheet name, or specific parameter code
expressionstringEquation expression for computed series
notesstringUser notes
enabledintegerUsed to active or deactive calculations and presentation of data

TableName

Refers to the TableName column in SeriesCatalog

NameType
datetimedatetime
valuefloat
flagstring

Database Description

--

Tests

TBD

Contributors

  • Gunnar Leffler
  • Karl Tarbet
  • Art Armour
  • Mike Stanfill
  • Mike Nielson
  • Jeremy Kellett
  • Dave Coyle

About

A JSON based standard for interchanging hydro, meteorological and environmental data.

Resources

Stars

8 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages