Distributed snow modeling for water resources
Project description
Spatial Modeling for Resources Framework
Spatial Modeling for Resources Framework (SMRF) was developed by Dr. Scott Havens at the USDA Agricultural Research Service (ARS) in Boise, ID. SMRF was designed to increase the flexibility of taking measured weather data and distributing the point measurements across a watershed. SMRF was developed to be used as an operational or research framework, where ease of use, efficiency, and ability to run in near real time are high priorities.
Read the full documentation for SMRF including up to date installation instructions.
Installation
python3 -m pip install smrf-dev
To install SMRF locally on Linux of MacOSX, first clone the repository and build into a virtual environment. This requires gcc <= 9.0
. The general steps are as follows and will test the SMRF installation by running the tests.
Clone from the repository
git clone https://github.com/USDA-ARS-NWRC/smrf.git
And install the requirements, SMRF and run the tests.
python3 -m pip install -r requirements_dev.txt
python3 setup.py install
To optionally verify the installation, run the unit tests
python3 -m unittest -v
For Windows, the install method is using Docker.
System dependencies
If using SMRF with gridded weather data from GRIB files, you will need the system dependancy for eccodes
which is a GRIB file reader.
Topo setup
The topo provides SMRF with the following static layers:
- Digital elevation model
- Vegetation type
- Vegetation height
- Vegetation extinction coefficient
- Vegetation optical transmissivity
- Basin mask (optional)
All these layers are stored in a netCDF file, typically referred to the topo.nc
file.
While the topo.nc
file can be generated manually, a great option is to use basin_setup which creates a topo file that is compatible with SMRF and AWSM.
Input data
Input meterological data for SMRF requires the following variables:
- Air temperature
- Vapor pressure
- Precipitation
- Wind speed and direction
- Cloud factor (percentage between 0 and 1 of incoming solar obstructed by clouds)
The data can be supplied through the following formats:
- CSV files
- MySQL database
- Weather Research and Forecasting (WRF) outputs
- High Resolution Rapid Refresh (HRRR)
- Generic netCDF
Running SMRF
There are two ways to run SMRF, first is through the run_smrf
command or through the SMRF API. If SMRF is being used as input to a snow or hydrology model, we recommend to use run_smrf
as it will generate all the input required. See the full documentation for more details.
run_smrf <config_file>
Docker
SMRF is also built into a docker image to make it easy to install on any operating system. The docker images are built automatically from the Github repository and include the latest code base or stable release images.
The SMRF docker image has a folder meant to mount data inside the docker image at /data
.
docker run -v <path to data>:/data usdaarsnwrc/smrf run_smrf <path to config>
The <path to data>
should be the path to where the configuration file, data and topo are on the host machine. This will also be the location to where the SMRF output will go.
NOTE: The paths in the configuration file must be adjusted for being inside the docker image. For example, in the command above the path to the config will be inside the docker image. This would be /data/config.ini
and not the path on the host machine.
In a way that ARS uses this, we keep the config, topo and data on one location as the files are fairly small. The output then is put in another location as it file size can be much larger. To facilitate this, mount the input and output data separately and modify the configuration paths.
docker run -v <input>:/data/input -v <output>:/data/output usdaarsnwrc/smrf run_smrf <path to config>
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for smrf_dev-0.11.3-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44332216776fc3f4d188fe20c6faea13943e6611480c8a1be1ab5655fb130620 |
|
MD5 | 6c809f8688710bfa2a4ce41750d350d5 |
|
BLAKE2b-256 | c7b676d35ac247cc35a7c9cf85f0f3f281e49509d3f51732581cc795601e6528 |
Hashes for smrf_dev-0.11.3-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dbef04790519c37a621fc796bb3a3131fd4b0888de8436e48407fc549d301ce4 |
|
MD5 | 26ec3cc585935f1c94afc9dd5c461fb4 |
|
BLAKE2b-256 | 9fe7046765588ba89a259fb7a824f528fa4d2756bf65e47cd669ef2a265a4dec |
Hashes for smrf_dev-0.11.3-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 44045829e91f12175fb9238c0f103c5d7879526e13fc747502d50ac7f6e40aa9 |
|
MD5 | f88f58aac425db8bbfb018267f6219a4 |
|
BLAKE2b-256 | 91d8b64344b2af900fdc2058d2260fc4acd1025b3cc70c7d9a9d82eb224256c4 |
Hashes for smrf_dev-0.11.3-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0367a1e66ac18f6b85074a6580ce1f329be690a6a646b3c2965bce6da132c150 |
|
MD5 | 97d8e36c8b547d203018ea8897a00e46 |
|
BLAKE2b-256 | a1c525da9d0c2f541c903646f9a606d21d64fb3f7565e86173e1c47785976e86 |
Hashes for smrf_dev-0.11.3-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5e09849da08367d03fbcf8d2cb22f5001681138750a5ad12c4196e570243b3e |
|
MD5 | 341dbeff815c36a8f2923b72b6b029f8 |
|
BLAKE2b-256 | 97b8c4a86aad7661f7abe0d411a390bcca4a5690a1e71e249e76c9070074c665 |
Hashes for smrf_dev-0.11.3-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 83533d07421f9a8c91de8a3f0b29f20725af71ac0404faf24a8eff147a10e397 |
|
MD5 | 1e339498dc608a33b18e88c14f5d8291 |
|
BLAKE2b-256 | 12713377ac8a7d5257c46e7f301b71d3c5d7544f1b1ad481a8c98cc28902146d |