Each SNODAS cell within the study area is assigned a unique Cell_ID value.
Each SNODAS cell is attributed with an elevation zone value (elev_zone) and a list of AOI's IDs (stationTriplet) it falls within.
All SNODAS SWE cell data are imported and stored as a record in a daily table.
The database schema is shown below.
SQL Query Example
SELECT snodascellzone.elev_zone, AVG(snodascellzone.mean_elev_ft) AS mean_elev_ft, -- Optional output AVG(snodas_swe_01012023.swe) AS mean_swe, count(snodascellzone.elev_zone) AS snodas_cellcount -- Optional outputFROM snodascellzone INNER JOIN snodascellaoi ON snodascellzone.cell_id = snodascellaoi.cell_id INNER JOIN snodas_swe_01012023 ON snodascellzone.cell_id = snodas_swe_01012023.cell_id WHERE stationtriplet = '08358400:NM:USGS' GROUP BY snodascellzone.elev_zone;PSQL Data Output Example
Benchmark and Database Optimization
Baselines performance:
It took about 10 seconds to query the stats for '06330000:MT:USGS', the largest AOI in the lower 48 states.
Most AOIs need only less than 2 seconds to get the stats.
DB Optimization
Output format spec
Implementation: PostgreSQL Python connector (see https://www.postgresqltutorial.com/postgresql-python/)
Use a server-side AOI boundary to report the summary statistics (mean, max, mix, etc) of SWE of the managed rasters. The server-side AOI boundary will come from the eBAGIS AOI database. The return values are cached on a server database table for subsequent retrieval. If the exact same query is requested at a later date, the output will be pulled from the database so we don't have to recalculate.
Use a client-side shapefile (or featureclass) to perform tasks specified in #1 above. The return values are displayed on the screen but not cached
Use a client-side point location (x, y) (or server-side, e.g., the pourpoint of an AOI) to report the pixel values. The return values are displayed on the screen but not cached
Example interface (NWCC Interactive Map); interface (Colorado SNODAS SWE App)
Key functions:
AOI query
Arbitrary shape query
Point query
Time series report of the 3 query modes (output .csv files)
Summary variables:
Mosaic dataset details (obsolete information)
Contains temperature and precipitation data
30 year average for 1970-2000 and 1980-2010
Time intervals: daily, monthly, annual, 30-year average
User to supply date range
Sample queries:
Average min temp for the 1st quarter (Jan 1 through Mar 31) using monthly (or daily) data from 1990 through 2010
Range (i.e., max - min) and standard deviation of the min temp for January 1 using daily data from 1978 through 2008
Rank of this precipitation amount (e.g., 10 inches) based on the annual (or summer) precipitation data from 1970 through 2000 (the result will be a number, e.g., 15, that is, 10 inches is the 15th highest precipitation record based on 1970 - 2000 records.)