Giter VIP home page Giter VIP logo

svatools's Introduction

Introduction to svatools

svatools

Project Status: Active - The project has reached a stable, usable state and is being actively developed. License: MIT

The goal of svatools is to help with the SWAT+ model input data preparation. There are mostly functions, which were developed for the implementation of modeling tasks in the OPTAIN project. These tools are intended to fill the gaps in the SWAT+ workflow along side the main tools developed by Christoph Schuerz. Therefore, we highly recommend trying and using these tools:

  • SWATfarmR - R tool for preparing management schedules for SWAT model;
  • SWATplusR - R tool for sensitivity analyse, model calibration and validation;
  • SWATbuildR1 - R tool for building SWAT+ setups;
  • SWATdoctR2 - A collection of functions in R and routines for SWAT model calibration and model diagnostics.

Detailed information about packages, workflow steps, input data, SWAT+ parameters, model calibration, validation, etc., could be found in the SWAT+ modeling protocol.

Installation

You can install the development version of svatools from GitHub with:

# install.packages("devtools")
devtools::install_github("biopsichas/svatools")
# euptf2 package is needed and used for soil parameter functions
devtools::install_github("tkdweber/euptf2")

Data

All the data required to run and test package is installed with package in extdata folder. Exact location on computer could be found running lines below. Please run it on your system to get it for you.

library(svatools)
temp_path <- system.file("extdata", package = "svatools")
print(temp_path)
#> [1] "C:/Users/laptop/AppData/Local/R/win-library/4.2/svatools/extdata"

Templates

In order to use svatools package functions with your data you should prepare your data to be inline with templates we have provided in extdata folder. Such are:

  • calibration_data.xlsx - template for loading calibration (water flow and water quality variables) data.
  • weather_data.xlsx - template for loading weather variables.
  • soil_lookup.xlsx - example of loading soil parameters dataset.
  • GIS/ - folder with GIS layers needed to run some functions.
  • CORDEX-BC/ - folder with example climate data.

Data prepared according to templates can be directly loaded into R and all the functions applied as described.

Footnotes

  1. Currently requires access to OPTAIN https://git.ufz.de/optain

  2. Currently requires access to OPTAIN https://git.ufz.de/optain

svatools's People

Contributors

biopsichas avatar kateretz avatar michstrauch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

michstrauch

svatools's Issues

get_atmo_dep() error -- Monthly and Daily

get_atmo_dep() works for annual values, yet throws an error if t_ext is set to "month"

catchment_boundary_path <- paste0(buildr_path, "basin.shp")

 atm_dep_df_monthly <- svatools::get_atmo_dep(
+   catchment_boundary_path,
+   t_ext = "month",
+   start_year = 2016,
+   end_year = 2019
+ )
[1] "Working on year 2016"
Error in apply(var.get.nc(r, "DDEP_OXN_m2Grid")[ilon, ilat, ] * 4.4268/100,  : 
  'MARGIN' does not match dim(X)

The same error applies for "day"

Something wrong with the coordinate reference system of the catchment boundary maybe? Its using EPSG:25832

Also just a small side note, in the documentation, it states that t_ext can be set to "hour", yet the function does not support it!

Error: "Wrong t_ext!!! Should be one of these strings: 'year', 'month' or 'day'."

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.