Visualization of hydrological futures data from the Southeast CASC.
Read a project description here. Read a paper (Regan and others, 2018) about the Precipitation-Runoff Modeling System (PRMS) here. The source data can be found here.
According to the Regan paper above, the PRMS uses the original geospatial fabric of the National Hydrologic Model (Vigel & Bock, 2014; found here) and NOT the updated v1.1 geospatial fabric (Santiago et al, 2020; found here).
-
This codebase uses the
snap-geo
conda environment, details found here. -
Use
download.ipynb
if you want to download a copy of the data (requires install of sciencebasepy intosnap-geo
). Be warned, there are problems with downloading the data via thesciencebasepy
API, and therefore some of this process is manual point-and-click tedium. For testing, it's recommended to just access the data from this directory instead:/import/beegfs/CMIP6/jdpaul3/hydroviz_data
-
Use the
eda.ipynb
notebook to familiarize yourself with the dataset structure. -
To coerce the data into a netCDF format, run the following command to submit an
sbatch
script. Change the script locations to match your repo location, and change the--output_dir
argument to save the netCDF files to a different location and avoid overwriting previous outputs. The script should only take ~5 minutes to run once compute resources are allocated.
python run_build_nc.py --data_dir /beegfs/CMIP6/jdpaul3/hydroviz_data/stats --gis_dir /beegfs/CMIP6/jdpaul3/hydroviz_data/gis --output_dir /beegfs/CMIP6/jdpaul3/hydroviz_data/nc --conda_init_script /beegfs/CMIP6/jdpaul3/hydroviz/conda_init.sh --conda_env_name snap-geo --build_nc_script /beegfs/CMIP6/jdpaul3/hydroviz/build_nc.py
-
Use the
qc.ipynb
notebook to compare values in the netCDFs to source values. -
Run the
xwalk.ipynb
notebook to crosswalk stream segment IDs and watershed IDs from the project geospatial data (Segments_subset.shp
andHRU_subset.shp
) to the GNIS name attributes in the NHM geospatial fabric. This notebook exports new shapefiles with the added GNIS common names for hosting in GeoServer (gs.earthmaps.io).
The native projection of the project data is ESRI:102039 (NAD 1983 USGS Contiguous USA Albers). This EPSG code is not recognized by GeoServer, where we want to host the vector data. However, EPSG:5070 (NAD83 / Conus Albers) is equivalent and is recognized by GeoServer. This codebase uses EPSG:5070.
from pyproj import CRS
crs1 = CRS("ESRI:102039")
crs2 = CRS("EPSG:5070")
print(crs1.to_proj4())
print(crs2.to_proj4())
print(crs1 == crs2)
+proj=aea +lat_0=23 +lon_0=-96 +lat_1=29.5 +lat_2=45.5 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs +type=crs
+proj=aea +lat_0=23 +lon_0=-96 +lat_1=29.5 +lat_2=45.5 +x_0=0 +y_0=0 +datum=NAD83 +units=m +no_defs +type=crs
True