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.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fb4cf80405694e5f6c5f2c2807969c80cf9eee6bc2155cfffb1f07a7d04752d |
|
MD5 | 450902d3717cff9d54f403593071bc6c |
|
BLAKE2b-256 | 97264f131dc33dde28089eee001af09dae75b481802383a88791e90d77c3b792 |
Hashes for smrf_dev-0.11.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 62fe2a1655cd0564f133efb000a6bc30ad163dd789a73db355bd29634fa4e5f6 |
|
MD5 | cfd7611b191e3076c340d127905a082f |
|
BLAKE2b-256 | e19db9316885388234cad3d0dbb0140a6e15bf47cb62a248888835ef82eb93b7 |
Hashes for smrf_dev-0.11.0-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 26216ff28e526a54b7897d7c00f4f746c218850949a678866e1cb7f5b61352dd |
|
MD5 | e2495061160cf394f8cdb63090d3085c |
|
BLAKE2b-256 | 9f30d89a8c040858438b98271d32a7b3cb7024ae22d47208a6167698a6aad07a |
Hashes for smrf_dev-0.11.0-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13e374834882c844df1c9e5674c1e12cc33bed13aaf347b6347bd67b65166d4d |
|
MD5 | 46e164bfb42e39f5fc990c3feb58aa55 |
|
BLAKE2b-256 | 9aa23a916fc13f82c69da688a93a1d1bd249dbb247aa49941fc9286545e0d012 |
Hashes for smrf_dev-0.11.0-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3a823ebeab14cc1d63a95b300836f03fd52bb42314588adc1dbe5e78e3b077f9 |
|
MD5 | 6dc36acf78b0584d7597a6282c842e73 |
|
BLAKE2b-256 | 798ac9a93a69d74625579c4392a24d1720434282b4e06e30973c119ef69dac06 |
Hashes for smrf_dev-0.11.0-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 98c3ac4a3209a6fb6ef52f3cd57e4a3e4ee880ff7a9aaec7977d5a25807ba462 |
|
MD5 | a610d44ab2fafbd9115b3b8726e9e325 |
|
BLAKE2b-256 | 95868ec2e99af739b839603eb959becc883c7d46b4d200580ab03f88e6a3f8bc |