The Grids Python Tool for Querying Spatiotemporal Multidimensional Water Data
Abstract
:1. Introduction
1.1. Background
1.2. New File Formats and Conventions
1.3. GIS Software
1.4. Web Services
1.5. Proposed Solution
- It should be interoperable across existing multidimensional data file formats and appropriate web service technologies rather than create more variability;
- It should be free and open source, simple to use, and well documented to promote ease of access and distribution;
- It should be able to extract time series from gridded datasets at various spatial geometries including at a minimum: points, bounding boxes, and polygon shapes; and
- It should work in common scientific computing environments such as personal computers, cloud computers, and applicable web apps and services.
2. Materials and Methods
2.1. Conceptually Handling N-dimensional Data
2.2. Development Environment
2.3. Software Workflow
- Programmatically “open” the file for reading.
- Read and interpret the file metadata including the names of the variables, the names and order of dimensions, and identifying which dimensions correspond to spatial and temporal axes.
- Read the values of the coordinate variable for each dimension used by the variable of interest.
- Identify the cells of the arrays corresponding to the area of interest by comparing the spatial, temporal, or other coordinate values to the user-specified coordinates.
- Read the values of interest from the file in the identified cells.
- Read the time values corresponding to the extracted variable values.
- Format the extracted data into a tabular structure.
- Programmatically “close” the file.
2.4. Connecting to Data Sources
2.5. Extracting Values by Comparing to Coordinate Values
2.6. Querying Higher Dimensional Data
2.7. Extracting Values within Boundaries Using Masks
3. Results
3.1. Validation of Time Series Results
3.2. Speed Performance on Local Datasets
3.3. Speed Performance on Remote Data
3.4. GLDAS Web App Case Study
3.5. WMO Web App Case Study
4. Discussion
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Dieulin, C.; Mahé, G.; Paturel, J.-E.; Ejjiyar, S.; Tramblay, Y.; Rouché, N.; EL Mansouri, B. A New 60-Year 1940/1999 Monthly-Gridded Rainfall Data Set for Africa. Water 2019, 11, 387. [Google Scholar] [CrossRef] [Green Version]
- Asadi, H.; Shahedi, K.; Jarihani, B.; Sidle, R.C. Rainfall-Runoff Modelling Using Hydrological Connectivity Index and Artificial Neural Network Approach. Water 2019, 11, 212. [Google Scholar] [CrossRef] [Green Version]
- Langevin, C.D.; Hughes, J.D.; Banta, E.R.; Niswonger, R.G.; Panday, S.; Provost, A.M. Documentation for the MODFLOW 6 Groundwater Flow Model; Techniques and Methods; U.S. Geological Survey: Reston, VI, USA, 2017; p. 197.
- Lai, Y.G. SRH-2D User’s Manual: Sediment Transport and Mobile-Bed Modeling; U.S. Bureau of Reclamation: Washington, DC, USA, 2020; p. 179.
- Alcantara, M.A.S.; Kesler, C.; Stealey, M.J.; Nelson, E.J.; Ames, D.P.; Jones, N.L. Cyberinfrastructure and Web Apps for Managing and Disseminating the National Water Model. JAWRA J. Am. Water Resour. Assoc. 2018, 54, 859–871. [Google Scholar] [CrossRef]
- NOAA Big Data Program | National Oceanic and Atmospheric Administration. Available online: https://www.noaa.gov/organization/information-technology/big-data-program (accessed on 14 October 2020).
- Rochio, L.E.P.; Connot, P.; Young, S.; Rasmayer, K.; Owen, L.; Bouchard, M.; Barnes, C. Landsat Benefiting Society for Fifty Years; USGS: Reston, VA, USA, 2018.
- Horsburgh, J.S.; Aufdenkampe, A.K.; Mayorga, E.; Lehnert, K.A.; Hsu, L.; Song, L.; Jones, A.S.; Damiano, S.G.; Tarboton, D.G.; Valentine, D.; et al. Observations Data Model 2: A Community Information Model for Spatially Discrete Earth Observations. Environ. Model. Softw. 2016, 79, 55–74. [Google Scholar] [CrossRef] [Green Version]
- Bustamante, G.R.; Nelson, E.J.; Ames, D.P.; Williams, G.P.; Jones, N.L.; Boldrini, E.; Chernov, I.; Sanchez Lozano, J.L. Water Data Explorer: An Open-Source Web Application and Python Library for Water Resources Data Discovery. Water 2021, 13, 1850. [Google Scholar] [CrossRef]
- Ames, D.P.; Horsburgh, J.S.; Cao, Y.; Kadlec, J.; Whiteaker, T.; Valentine, D. HydroDesktop: Web Services-Based Software for Hydrologic Data Discovery, Download, Visualization, and Analysis. Environ. Model. Softw. 2012, 37, 146–156. [Google Scholar] [CrossRef]
- Boldrini, E.; Mazzetti, P.; Nativi, S.; Santoro, M.; Papeschi, F.; Roncella, R.; Olivieri, M.; Bordini, F.; Pecora, S. WMO Hydrological Observing System (WHOS) Broker: Implementation Progress and Outcomes; oral; 2020. [Google Scholar]
- OGC GeoTIFF Standard 2019. Available online: https://www.ogc.org/standards/geotiff (accessed on 14 October 2020).
- Shea, D. GRIB | NCAR—Climate Data Guide. Available online: https://climatedataguide.ucar.edu/climate-data-tools-and-analysis/grib (accessed on 9 February 2021).
- Rew, R.; Davis, G. NetCDF: An Interface for Scientific Data Access. IEEE Comput. Graph. Appl. 1990, 10, 76–82. [Google Scholar] [CrossRef]
- The HDF Group HDF User Guide; The HDF Group: Champaign, IL, USA, 2017.
- Eaton, B.; Gregory, J.; Drach, B.; Taylor, K.; Hankin, S.; Blower, J.; Caron, J.; Signell, R.; Bentley, P.; Rappa, G.; et al. NetCDF Climate and Forecast (CF) Metadata Conventions 1.8. 2018. Available online: http://cfconventions.org/Data/cf-conventions/cf-conventions-1.8/cf-conventions.html (accessed on 20 May 2021).
- Balsamo, G.; Beljaars, A.; Scipal, K.; Viterbo, P.; van den Hurk, B.; Hirschi, M.; Betts, A.K. A Revised Hydrology for the ECMWF Model: Verification from Field Site to Terrestrial Water Storage and Impact in the Integrated Forecast System. J. Hydrometeorol. 2009, 10, 623–643. [Google Scholar] [CrossRef]
- Rodell, M. GLDAS Noah Land Surface Model L4 3 Hourly 0.25 x 0.25 Degree, Version 2.1 2016. Available online: https://disc.gsfc.nasa.gov/datasets/GLDAS_NOAH025_3H_2.1/summary (accessed on 9 February 2021).
- Information (NCEI), N.C. for E. Global Forecast System (GFS) [0.5 Deg.]. Available online: https://data.nodc.noaa.gov/cgi-bin/iso?id=gov.noaa.ncdc:C00634;view=iso (accessed on 14 October 2020).
- Brown, P.G. Overview of SciDB: Large Scale Array Storage, Processing and Analysis. In Proceedings of the 2010 ACM SIGMOD International Conference on Management of Data, Detroit, MI, USA, 24–28 July 2011; Association for Computing Machinery: New York, NY, USA, 2010; pp. 963–968. [Google Scholar]
- GDAL/OGR Contributors. GDAL/OGR Geospatial Data Abstraction Software Library; Open Source Geospatial Foundation: Beaverton, OR, USA, 2021. [Google Scholar]
- PROJ Contributors. PROJ Coordinate Transformation Software Library; Open Source Geospatial Foundation: Beaverton, OR, USA, 2021. [Google Scholar]
- Cornillon, P.; Gallagher, J.; Sgouros, T. OPeNDAP: Accessing Data in a Distributed, Heterogeneous Environment. Data Sci. J. 2003, 2, 164–174. [Google Scholar] [CrossRef] [Green Version]
- Fielding, R.T. Architectural Styles and the Design of the Network-Based Software Architectures. Ph.D. Thesis, Univeristy of California, Irvine, CA, USA, 2000. [Google Scholar]
- Gerlach, R.; Nativi, S.; Schmullius, C.; Mazetti, P. Exploring Earth Observation Time Series Data on the Web - Implementation of a Processing Service for Web-Based Analysis. AGU Fall Meet. Abstr. 2008, 2008, IN21A-1047–1047. [Google Scholar]
- Gorelick, N.; Hancher, M.; Dixon, M.; Ilyushchenko, S.; Thau, D.; Moore, R. Google Earth Engine: Planetary-Scale Geospatial Analysis for Everyone. Remote Sens. Environ. 2017, 202, 18–27. [Google Scholar] [CrossRef]
- Hoyer, S.; Hamman, J. Xarray: N-D Labeled Arrays and Datasets in Python. J. Open Res. Softw. 2017, 5, 10. [Google Scholar] [CrossRef] [Green Version]
- Müller, S.; Schüler, L. GeoStat-Framework/GSTools: V1.3.2 “Pure Pink”; Zenodo. Available online: https://github.com/GeoStat-Framework/GSTools (accessed on 4 May 2021).
- UCAR NetCDF Subset Service; UCAR. 2014. Available online: https://www.unidata.ucar.edu/software/tds/current/reference/NetcdfSubsetServiceReference.html (accessed on 4 May 2021).
- McKinney Pandas: A Foundational Python Library for Data Analysis and Statistics | R (Programming Language) | Database Index. Available online: https://www.scribd.com/document/71048089/pandas-a-Foundational-Python-Library-for-Data-Analysis-and-Statistics (accessed on 17 May 2020).
- cfgrib Contributors Cfgrib; ECMWF. 2020. Available online: https://github.com/ecmwf/cfgrib/ (accessed on 4 May 2021).
- Rasterio Contributors. Rasterio; Mapbox. 2021. Available online: https://rasterio.readthedocs.io/en/latest/ (accessed on 4 May 2021).
- Rew, R.; Davis, G.; Emmerson, S.; Cormack, C.; Caron, J.; Pincus, R.; Hartnett, E.; Heimbigner, D.; Lynton, A.; Fisher, W. Unidata NetCDF; UCAR/NCAR-Unidata: Boulder, CO, USA, 1989. [Google Scholar]
- UCAR Hierarchical Data Format. Available online: https://www.ncl.ucar.edu/Applications/HDF.shtml (accessed on 27 August 2020).
- Caron, J. On the Suitability of BUFR and GRIB for Archiving Data; UCAR/NCAR-Unidata: Boulder, CO, USA, 2011. [Google Scholar] [CrossRef]
- van der Walt, S.; Colbert, S.C.; Varoquaux, G. The NumPy Array: A Structure for Efficient Numerical Computation. Comput. Sci. Eng. 2011, 13, 22–30. [Google Scholar] [CrossRef] [Green Version]
- Evans, S.; Williams, G.P.; Jones, N.L.; Ames, D.P.; Nelson, E.J. Exploiting Earth Observation Data to Impute Groundwater Level Measurements with an Extreme Learning Machine. Remote Sens. 2020, 12, 2044. [Google Scholar] [CrossRef]
- Evans, S.W.; Jones, N.L.; Williams, G.P.; Ames, D.P.; Nelson, E.J. Groundwater Level Mapping Tool: An Open Source Web Application for Assessing Groundwater Sustainability. Environ. Model. Softw. 2020, 131, 104782. [Google Scholar] [CrossRef]
- Purdy, A.J.; David, C.H.; Sikder, M.S.; Reager, J.T.; Chandanpurkar, H.A.; Jones, N.L.; Matin, M.A. An Open-Source Tool to Facilitate the Processing of GRACE Observations and GLDAS Outputs: An Evaluation in Bangladesh. Front. Environ. Sci. 2019, 7. [Google Scholar] [CrossRef]
- McStraw, T. An Open-Source Web-Application for Regional Analysis of GRACE Groundwater Data and Engaging Stakeholders in Groundwater Management. Ph.D. Thesis, Brigham Young University, Provo, UT, USA, 2020. [Google Scholar]
- Office of Weather Prediction National Water Model Web App. Available online: https://water.noaa.gov/map (accessed on 4 May 2021).
- Plotly Technologies Inc. Collaborative Data Science; Plotly Technologies: Montréal, QC, Canada, 2015; Available online: https://plotly.com/ (accessed on 4 May 2021).
- Caron, J.; Davis, E.; Hermida, M.; Heimbigner, D.; Arms, S.; Ward-Garrison, C.; May, R.; Lansing, M.; Kambic, R.; Johnson, H. Unidata THREDDS Data Server; UCAR/NCAR-Unidata: Boulder, CO, USA, 1997. [Google Scholar]
- Swain, N.R.; Christensen, S.D.; Snow, A.D.; Dolder, H.; Espinoza-Dávalos, G.; Goharian, E.; Jones, N.L.; Nelson, E.J.; Ames, D.P.; Burian, S.J. A New Open Source Platform for Lowering the Barrier for Environmental Web App Development. Environ. Model. Softw. 2016, 85, 11–26. [Google Scholar] [CrossRef] [Green Version]
- Snow, A.D.; Christensen, S.D.; Swain, N.R.; Nelson, E.J.; Ames, D.P.; Jones, N.L.; Ding, D.; Noman, N.S.; David, C.H.; Pappenberger, F.; et al. A High-Resolution National-Scale Hydrologic Forecast System from a Global Ensemble Land Surface Model. JAWRA J. Am. Water Resour. Assoc. 2016, 52, 950–964. [Google Scholar] [CrossRef] [PubMed] [Green Version]
- Hales, R. Grids; Zenodo. 2021. Available online: https://github.com/rileyhales/grids (accessed on 4 May 2021).
- Hales, R. GLDAS Data Tool; Zenodo. 2020. Available online: https://github.com/rileyhales/gldas (accessed on 4 May 2021).
- Jones, E.; Hales, R.; Khattar, R. Met Data Explorer; Zenodo. 2021. Available online: https://github.com/BYU-Hydroinformatics/Met-Data-Explorer (accessed on 4 May 2021).
Evaluation Criteria | |||||||
---|---|---|---|---|---|---|---|
Downloads | File Formats | Any Dataset | Scripting | Comp. Envs. | Cost | ||
Possible solutions | New FileFormats | Yes | Convert Data | Varies | High | Yes | Open Source |
GIS/ Scripts | Yes | Mixed, Limited | Yes | Varies | Varies | Varies | |
Web Services | No | Mixed, Limited | No | Varies | No | Varies | |
Desired Solution | No | Full | Yes | Low | Yes | Open Source |
Supported Multidimensional File Formats | |||||
---|---|---|---|---|---|
NetCDF4 | GRIB | HDF | GeoTIFF | ||
Python Package | NetCDF4 | X | |||
Cfgrib | X | ||||
H5py | X | ||||
Rasterio | X | ||||
Xarray | X | X | X | ||
Pygrib | X |
Dataset | Dimensions | File Format |
---|---|---|
NWM | 2—time, stream number | NetCDF |
GLDAS | 3—time, latitude, longitude | NetCDF |
GFS | 4—time, elevation, latitude, longitude | GRIB |
Query Type | Point | Bounding Box | Shape | Stats |
---|---|---|---|---|
Time per file (seconds) | 1.146 | 1.136 | 1.135 | 1.087 |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2021 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).
Share and Cite
Hales, R.C.; Nelson, E.J.; Williams, G.P.; Jones, N.; Ames, D.P.; Jones, J.E. The Grids Python Tool for Querying Spatiotemporal Multidimensional Water Data. Water 2021, 13, 2066. https://doi.org/10.3390/w13152066
Hales RC, Nelson EJ, Williams GP, Jones N, Ames DP, Jones JE. The Grids Python Tool for Querying Spatiotemporal Multidimensional Water Data. Water. 2021; 13(15):2066. https://doi.org/10.3390/w13152066
Chicago/Turabian StyleHales, Riley Chad, Everett James Nelson, Gustavious P. Williams, Norman Jones, Daniel P. Ames, and J. Enoch Jones. 2021. "The Grids Python Tool for Querying Spatiotemporal Multidimensional Water Data" Water 13, no. 15: 2066. https://doi.org/10.3390/w13152066
APA StyleHales, R. C., Nelson, E. J., Williams, G. P., Jones, N., Ames, D. P., & Jones, J. E. (2021). The Grids Python Tool for Querying Spatiotemporal Multidimensional Water Data. Water, 13(15), 2066. https://doi.org/10.3390/w13152066