GithubHelp home page GithubHelp logo

lovechang1986 / gridpp Goto Github PK

View Code? Open in Web Editor NEW

This project forked from metno/gridpp

0.0 0.0 0.0 3 MB

Software to post-process gridded weather forecasts

License: GNU Lesser General Public License v3.0

C++ 78.93% C 7.39% CMake 1.89% SWIG 1.66% Python 10.12% Vim Script 0.01% Shell 0.01%

gridpp's Introduction

Gridded post-processor

"Latest release" C/C++ CI

Gridpp a is post-processing tool for gridded weather forecasts. It consists of a library of commonly-used methods and a command-line tool that applies these methods to forecast fields in NetCDF files.

Gridpp is written in C++ but offers python bindings to the functions in the library. The tool is used at MET Norway to produce operational weather forecasts for Yr (https://www.yr.no).

Gridpp is currently under active development and the current version is a prototype for testing. Feedback is welcome, either by using the issue tracker in Github, or by contacting Thomas Nipen ([email protected]).

Documentation

For information on how to use gridpp, check out the wiki at https://github.com/metno/gridpp/wiki. The API reference is found at https://metno.github.io/gridpp/.

Features

  • Methods for downscaling a forecast from a coarse grid to a fine grid
  • Methods for calibrating a downscaled grid, such as quantile mapping
  • Computationally efficient neighbourhood methods to compute neighbourhood min, mean, max, and any quantile.
  • Data assimilation using optimal interpolation (OI) to merge observations and gridded forecasts (deterministic or ensemble)
  • Efficient data structures for nearest location lookup in a vector or grid of locations
  • Command-line client with support for Netcdf files with flexibility in how variables and dimensions are configured

Example

The following computes a moving neighbourhood mean with a half-width of 7 gridpoints (i.e. 15x15 neighbourhood)

import gridpp
import numpy as np
import scipy.ndimage.filters
noise = np.random.randn(200, 300)
input = scipy.ndimage.filters.gaussian_filter(noise, sigma=5)
halfwidth = 7
output = gridpp.neighbourhood(input, halfwidth, gridpp.Mean)

Example

Required dependencies

On Ubuntu Bionic, these can be installed like this:

sudo apt-get update
sudo apt-get install libboost-all-dev
sudo apt-get install libarmadillo6 libarmadillo-dev

Installing the python bindings from pip

The easiest is to install the latest release of the package using pip. Provided you have installed the dependencies listed above, you can install the most recent release of the python package as follows:

pip3 install gridpp --user

To check that the installation worked, run the following in python3:

import gridpp
print(gridpp.version())

Full gridpp installation from source

  1. Either download the source code from the latest release, unzip the file and navigate into the extracted folder; or clone the repo from github.

  2. Install extra requirements

These are only required when installing from source

sudo apt install swig cmake
  1. Set up cmake installation
mkdir build
cd build
cmake ..
  1. Install the C++ library
sudo make install

This will install the library in /usr/local/lib/libgridpp.so and the gridpp command-line client in /usr/local/bin/gridpp. To specify a custom installation path, use the following in step 3:

cmake .. -DCMAKE_INSTALL_PREFIX=<custom path>
  1. Install the python bindings
make install-python-user

This installs the python bindings in ~/local/lib/python3.6/site-packages/gridpp.py. To install the python bindings system-wide, use sudo make install-python instead.

  1. Install the R bindings
make build-r

Currently, the R package is not installed centrally, but instead is placed in swig/R/gridpp.R in the build directory.

gridpp client installation from source

  1. Extra dependencies The gridpp commando-line client requires the following extra dependencies:

On Ubuntu Bionic, these can be installed like this:

sudo apt-get install libgsl0-dev libblas-dev
sudo apt-get install netcdf-bin libnetcdf-dev
  1. Install the client
make gridpp-client

Copyright and license

Copyright © 2014-2021 Norwegian Meteorological Institute. Gridpp is licensed under the GNU LEsser General Public License (LGPL). See LICENSE file.

Contact

E-mail: Thomas Nipen ([email protected])

gridpp's People

Contributors

cskarby avatar e-benoit avatar jmnipen avatar joewkr avatar khintz avatar knedlsepp avatar mpejcoch avatar tnipen avatar

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.