Giter Site home page Giter Site logo

ouranosinc / raven Goto Github PK

View Code? Open in Web Editor NEW
37.0 10.0 12.0 84.36 MB

WPS services related to hydrological modeling

Home Page: https://pavics-raven.readthedocs.io

License: MIT License

Makefile 5.09% Python 94.33% Dockerfile 0.58%
hydrology wps pavics gis birdhouse

raven's Introduction

Raven : Hydrological modeling and analytics

Documentation Status Build status GitHub license Join the chat at https://gitter.im/bird-house/birdhouse FOSSA DOI
Raven (the bird)
Raven offers processes related to hydrological modeling, and in particular, the Raven hydrological modelling framework.

Raven is an open source server project offering data collection and preparation, as well as geoprocessing and catchment delineation through the Web Processing Service (WPS) standard. Raven processes can be embedded in a graphical user interface or accessed directly from a programming environment. From Python, birdy WPSClient provides a user-friendly python interface to Raven's WPS processes for geospatial processing.

The properties of custom watersheds can be extracted from a Digital Elevation Model and a land-use database.

Raven can be compiled and installed, or simply deployed using docker. A hosted version is available at https://pavics.ouranos.ca/twitcher/ows/proxy/raven.

Documentation

Learn more about Raven in its official documentation at https://pavics-raven.readthedocs.io.

Submit bug reports, questions and feature requests at https://github.com/Ouranosinc/raven/issues

Contributing

You can find information about contributing in our Developer Guide.

Please use bumpversion to release a new version.

License

Free software: MIT license

Credits

This project was funded by the CANARIE research software program.

Hydrological models are based on the Raven modeling framework.

This package was created with Cookiecutter and the bird-house/cookiecutter-birdhouse project template.

raven's People

Contributors

cjauvin avatar dependabot[bot] avatar fossabot avatar huard avatar julemai avatar lalondma avatar mayetea avatar pre-commit-ci[bot] avatar richardarsenault avatar tlvu avatar zeitsperre avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

raven's Issues

WPS for goodness of fit metrics (2)

Spotpy provides a series of metrics:

  • Bias
  • PBias
  • Nash-Sutcliff (NSE)
  • logarithmic Nash-Sutcliff (logNSE)
  • logarithmic probability (logp)
  • Correlation Coefficient (r)
  • Coefficient of Determination (r^2)
  • Mean Squared Error (MSE)
  • Root Mean Squared Error (RMSE)
  • Mean Absolute Error (MAE)
  • Relative Root Mean Squared Error (RRMSE)
  • Agreement Index (AI)
  • Covariance, Decomposed MSE (dMSE)
  • Kling-Gupta Efficiency (KGE).

Optimize travis build

Description

I think the Travis build would go faster with only one call to conda update. We could add a full_install to the Makefile and use that in the travis config. In this repo, another build of Python is downloaded due to the tests and docs dependencies.

Watershed delineation WPS (8)

This issue will probably need to be split in smaller chunks:

  • Select delineation algorithm (Richard could provide more info on this)
  • Add algo to PAVICS services (CRIM)
  • Host a reference set of polygons to use as benchmark (ETS please provide reference dataset)
  • Find a way to test the service automatically (return performance metric, eg ref)
  • Support for WFS input (multiple inputs)

Gather uses of Compute Canada at ETS and U Waterloo

While we are engaging with Compute Canada, it would be a good idea to get experience from ETS and U Waterloo on how they use or expect to use tools and services on CC.

Prepare short interviews on major uses of the teams, covering major aspects to be delivered in the CANARIE project.

WPS service/frontend widget for hydrological series visualization (8)

Processes such as raven, raven-hmets, etc return an hydrograph output reference to a netCDF file. Clicking "visualize" on this file should open the time series widget and display the time series generated by the model. For basic simulations, there is only one time series. For more complex simulations there will be multiple simulations along time across the params or basins dimensions. Ideally we would be able to display those as well, but it can be done during the maintenance year.

WPS client generator

From Statement of Work. Script automatically generates client library from WPS description, Code to automatically generate client libraries (eg python) from WPS description.

WPS to extract watershed properties from DEM and land use layer (8)

We absolutely need:

  • Area
  • Lat, lon coordinates of watershed centroid
  • Mean elevation

Return as LiteralOutput ? A JSON dictionary ?

Implement WPS to analyze the DEM and return multiple properties (area, slope, etc).

Also hard-code land-use file and extract additional information (open other ticket).

Make start fails on new install

Description

After make install (successful), make start gives the following error:

Starting application ...
Traceback (most recent call last):
File "/home/ets/anaconda3/envs/raven/bin/raven", line 11, in
load_entry_point('raven', 'console_scripts', 'raven')()
File "/home/ets/anaconda3/envs/raven/lib/python3.6/site-packages/pkg_resources/init.py", line 487, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/home/ets/anaconda3/envs/raven/lib/python3.6/site-packages/pkg_resources/init.py", line 2728, in load_entry_point
return ep.load()
File "/home/ets/anaconda3/envs/raven/lib/python3.6/site-packages/pkg_resources/init.py", line 2346, in load
return self.resolve()
File "/home/ets/anaconda3/envs/raven/lib/python3.6/site-packages/pkg_resources/init.py", line 2352, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
ModuleNotFoundError: No module named 'raven.cli'; 'raven' is not a package
Makefile:105: recipe for target 'start' failed
make: [start] Error 1 (ignored)

Environment

  • Raven version used, if any:
  • Python version, if any: Python 3.6
  • Operating System: Linux Mint 18.X

Steps to Reproduce

git init (in new folder)
git clone [...]
make install
make start

Paste the command(s) you ran and the output.

See above

Additional Information

Links to other issues or sources.

CF-Compliance of hydrographs.nc output

Description

The netCDF output created by Raven has a dimension called nbasins but no matching coordinates.
From the netCDF docs:

A coordinate variable is a one-dimensional variable with the same name as a dimension, which names the coordinate values of the dimension. It must not have any missing data (for example, no _FillValue or missing_value attributes) and must be strictly monotonic (values increasing or decreasing). A two-dimensional variable of type char is a string-valued coordinate variable if it has the same name as its first dimension, e.g.: char time( time, time_len); all of its strings must be unique. A variable's coordinate system is the set of coordinate variables used by the variable. Coordinates that refer to physical space are called spatial coordinates, ones that refer to physical time are called time coordinates, ones that refer to either physical space or time are called spatio-temporal coordinates.

  • Make coordinate variables for every dimension possible (except for string length dimensions).
  • Give each coordinate variable at least unit and long_name attributes to document its meaning.
  • Use an existing netCDF Convention for your coordinate variables, especially to identify spatio-temporal coordinates.
  • Use shared dimensions to indicate that two variables use the same coordinates along that dimension. If two variables' dimensions are not related, create separate dimensions for them, even if they happen to have the same length.

So for example there could be a variable called nbasins storing the Raven basin index. It would probably make sense to rename nbasins to just basin or basin_id, but I guess that would break backward compatibility for users and it's not a big deal.

Here are other CF-compliance issues that were raised by CF-checker:

CHECKING NetCDF FILE: /group_workspaces/jasmin4/ceda_wps/production/cache/uploads/Hydrographs.nc
=====================
Using CF Checker Version 3.0.5
Checking against CF Version CF-1.6
Using Standard Name Table Version 61 (2018-11-13T11:55:45Z)
Using Area Type Table Version 9 (04 July 2018)

WARN: (2.6.1): No 'Conventions' attribute present

------------------
Checking variable: time
------------------
WARN: (3): No standard_name or long_name attribute specified

------------------
Checking variable: precip
------------------

------------------
Checking variable: basin_name
------------------
INFO: attribute cf_role is being used in a non-standard way
WARN: (2.2): Could not get typecode of variable.  Variable types supported are: char, byte, short, int, float, real, double
ERROR: (9.5): Invalid value for cf_role attribute

------------------
Checking variable: q_sim
------------------

------------------
Checking variable: q_obs
------------------

------------------
Checking variable: q_in
------------------

ERRORS detected: 1
WARNINGS given: 3
INFORMATION messages: 1

User-friendly WPS using selected watershed (4)

Description

Create a WPS with minimal user inputs:

  • Name of observation product (Livneh, NRCan, DEH data)
  • Click on basin outlet to identify watershed (largest possible)
  • If params are given, fine, if not, automatic calibration
  • Assume Canopex or USGS for streamflow obs
  • Fetch watershed properties from other WPS_watershed_meta
  • Set initial conditions (explicitly or defaults)
  • Set start and end date explicitly

Support for MATLAB geometries?

Description

I hadn't considered this before but will the shape formats that RAVEN needs to support include geometry files encoded in the .mat format? I'm not at all familiar with MATLAB data files and I can't seem to find any documented support for handling .mat inputs. Is this a requisite feature?

JupyterLab instance

Install and configure JupyterLab to work with PAVICS user accounts and get access to stored data.

Authentication wish-list:

  • JupyterLab and PAVICS share the same credential system, so that logging in one allows user to switch to other without reentering credentials.
  • Access to JupyterLab is granted to users through Magpie interface (as another service).

WPS for generic Raven framework (8)

Launch Raven using as input the config file describing a user-defined model structure.
Think about how the service will handle data inputs, since they depend on the model structure.

Configuring Raven GDAL and Rasterio

I hoping to finalize the Raven GIS class methods in the coming weeks but I'm currently blocked on an issue.

In order to more easily perform raster masking using vectors (extracting points within the contour and setting outside pixels to NaN's) most of the literature suggests that Rasterio would be a robust library to perform this. Unfortunately, Rasterio and native GDAL don't work well together; they can't easily be installed alongside each other even with Anaconda.

My question here would be what seems like a more worthwhile goal: adding some spaghetti code methods cobbled together that seem to do an okay job for now, or configuring Rasterio to to work in its own environment (hopefully its own bird) to remove a lot of boilerplate code and leverage their functionalities. Questions of time, resources, and priorities come to mind.

In the mean time, I'll be looking around for other options (system calls to bash libraries that can more or less do this). Hopefully I can find something that isn't too resource-heavy.

Thoughts?

User interface for watershed delineation service (4)

User story

User wants to run an hydrological model on a catchment. To do that, she needs information about that catchment. She goes to the PAVICS UI and in Maps Control, selects "Watershed delineation". She then clicks on the map, which calls the shape-selection process from raven, passing a longitude, latitude tuple. With a double-click, option collect-upstream is set to True. The process returns a geojson object with the watershed outline, which is then displayed on the map. Hovering on the selected region displays a panel with watershed properties. The name property can be edited by the user. These properties are provided by the watershed-properties process in raven as a json file. These properties, as well as the lats and lons, can be used as inputs to raven-gr4j-cemaneige and regionalization processes. They can also be saved in the user workspace.

  • Add Watershed delineation to Map Controls widget
  • Call shape-selection on click, passing lat, lon from click event. Store geojson output and watershed id.
  • - [ ] Call shape-selection on double-click, passing lat, lon from click event and collect-upstream=True. Store geojson output and list of watershed ids.
  • Call watershed-properties on click, passing ids of watersheds. Store json dictionary of properties.
  • On hover over the selected region, display panel showing the json property dictionary, with the name property being editable.
  • Mechanism to pass the properties and lat, long to the process launcher.
  • Add DEM from Geoserver to the list of basemaps.
  • Store the geojson and properties in the user workspace.

Raven progress file

Description

An option in Raven (and Ostrich) to create an output file storing the progress % from 0 to 100 and the estimated number of seconds until the process completion. If these could be saved in a json file, e.g. something like:

{
	"% progress": 65,
	"seconds remaining": 123
}

It doesn't have to be super accurate, especially for short jobs, just give a rough idea.

On our end, we'd be able to read this file once in a while during execution to tell the user how far along is the simulation.

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.