Skip to main content

Subset National Water Model (NWM) NetCDF Ver1.1

Project description

# Subset National Water Model (NWM) NetCDF

National Water Model (NWM) Ver1.1 has been in production since UTC time 12PM May 8, 2017

Details about changes in v1.1:

NWM's daily output is about 430GB worth of NetCDF files that contain meteorological and hydrologic data/forecasts covers the whole U.S.
This python library enables users to subset NWM Ver1.1 NetCDF using a polygon that represents a region of interest, which can significantly reduce data storage size and speed up regional data access.

More about NWM:

## Version naming convention:
"1.1.5", where "1.1" means NWM Ver1.1 and "5" is the version of this library.

## Workflow:
user-provided polygon --> Spatial Query module* --> stream comids & reservoir comids & grid cell indices (forcing & land & terrain) -->
Subset module --> Merge module --> regional NetCDF files

*: Spatial Query is optional if user directly provides stream comids & reservoir comids & grid cells indices

## Usage
See in source

The copy of the resulting NetCDF files of TwoMileCreek watershed can be found at

The watershed poylgon shapefiel is at /

## What's new in 1.1.6 ?

1) Remove previously added "time" dimension in "reference_time" variable as it was a violation of CF convention on "coordinate variable"";
But this change causes missing "reference_time" value in merged netcdfs as it only stores the value from the first file;

2) Fix bug in "time_bounds" variable;

3) Add "pyspatialite" as a optional dependency in spatial query. Will try loading pysqlite2 by default, if failed, try loading pyspatialite lib.
Note: Installation of pyspatialite needs several manual steps on linux, but it is so far a good way for CentOS. On Ubuntu and Windows, user should install pysqlite2 + mod_spatialite binary;

## What's new in 1.1.5 ?

1) Add two new flags, one for 2D grid file (forcing/land/terrain) and one for 1D file (channel/reservoir), to specify whether to keep original dimension size unchanged in resulting outputs.

1-1) If True, the sizes of dimension 'x' and 'y' for 2D grid resulting file and 'feature_id' for 1D resulting file will be same as their originals;
Variables outside subsetting domain will be set to corresponding Missing Data Values.

1-2) If False, the size of above dimension will be shrunk to cover subsetting domain.

Note: keep original dimension unchanged will slightly increase output size for both 1D and 2D files and significantly slow down subsetting process for 1D file.

2) Add python dependencies to file.

## What's new in 1.1.4 ?

Use a new approach to perform spatial query on grid cell indices against forcing, land and terrain files;
Further improve spatial query speed on grid cells;
Further address partially covered grids caused by projection distortion;
Deprecate Tiff supporting files. Now the only necessary supporting file is the sqlite/spatialite geodatabase for stream, reservoir and HUCs;
Remove GDAL; Add pyproj and numpy to dependency list;

## What's new in 1.1.3 ?
1) Support subsetting more files:

1-1) "tm01" and "tm02" of each time stamp in analysis_assim model configuration

1-2) the "terrain" files in all model configurations

2) speed up spatial query on grid files (forcing, land and terrain) using GDAL and further reduce size of supporting files

3) add GDAL as a new dependency

## What's new in 1.1.2 and 1.1.1?

First two releases

## Environment and Dependencies:
Preliminary functional testings passed with Python 2.7.12 x64 on Windows 7 x64 and Ubuntu 16.04 x64.

### Spatial Query module:

1) fiona >= 1.7.5 @

2) shapely >= 1.5.17 @

3) pysqlite >= 2.8.3 with mod_spatialite extension @ and

4) numpy >= 1.12.1 @

5) pyproj >= @

6) spatial query supporting files (1.1.4) @

### Subset & Merge module

1) NetCDF utilities >= 4.4 (shell commands) @

2) NCO >= 4.6.3 (shell commands) @

3) numpy >= 1.12.1 @

4) netCDF4 >= 1.2.7 python wrapper for NetCDF4 @

5) sed (shell command): Linux systems include this command by default. This lib contains a GNU sed binary for Windows

Implementation inspired by:

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for subset-nwm-netcdf, version 1.1.6
Filename, size File type Python version Upload date Hashes
Filename, size subset_nwm_netcdf-1.1.6.tar.gz (1.1 MB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page