Skip to main content

Titanlib

"Latest release" C/C++ CI

Titanlib is a library of automatic quality control routines for weather observations. It emphases spatial checks and is suitable for use with dense observation networks, such as citizen weather observations. It is written in C++ and has bindings for python and R. The library consists of a set of functions that perform tests on data.

Titanlib 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 (thomasn@met.no).

Example of titanlib

Documentation

For more information on how to use Titanlib, check out the wiki at https://github.com/metno/titanlib/wiki.

Features

  • A wide variety of spatial checks, such as spatial consistency test, buddy check, isolation check.
  • Plausability tests such as range check and climatology check.
  • A graphical interface for tuning the parameters of the checks
  • Fast C++ implementation for efficient processing of large observation datasets

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 libgsl-dev libblas-dev
sudo apt-get install libproj-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 titanlib --user

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

import titanlib
print(titanlib.version())

Full 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/libtitanlib.so.

  1. Install the python bindings
make install-python-user

This installs the python bindings in ~/local/lib/python3.6/site-packages/titanlib.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 extras/SWIG/R/titanlib.R in the build directory.

Python example

Here is an example using the buddy check, which has the following function signature:

buddy_check(lats, lons, elevs, values, radius, num_min, threshold, max_elev_diff, elev_gradient, min_std, num_iterations)

The test reveals that the last observation (-111) is likely faulty:

import titanlib
flags = titanlib.buddy_check([60,60.1,60.2],[10,10,10],[0,0,0],[0, 1, -111], [50000],[2],2,200,0,1,2)
print(flags)

R example

Run the following code in R from the build directory, or if you want to run from any other directory, just put in the proper paths for rtitanlib and titanlib.R

dyn.load(paste("extras/SWIG/R/titanlib", .Platform$dynlib.ext, sep=""))
source("extras/SWIG/R/titanlib.R")
cacheMetaData(1)

sct(c(60,60.1,60.2), c(10,10,10), c(0,0,0), c(0,1,-111),50000,2,2,100,0,1,2)

Copyright and license

Copyright © 2019-2020 Norwegian Meteorological Institute. Titanlib is licensed under The GNU Lesser General Public License (LGPL). See LICENSE file.

Contact

E-mail: Thomas Nipen (thomasn@met.no)

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

titanlib-0.2.1.tar.gz (118.9 kB view details)

Uploaded Source

File details

Details for the file titanlib-0.2.1.tar.gz.

File metadata

  • Download URL: titanlib-0.2.1.tar.gz
  • Upload date:
  • Size: 118.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/2.0.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.36.1 CPython/3.6.9

File hashes

Hashes for titanlib-0.2.1.tar.gz
Algorithm Hash digest
SHA256 1ce442f54346f2ba224a2f214497ab7cd5084b6020d95b282d62f73f18d109b2
MD5 c2700e975e78697fcf3839b0bc583cf8
BLAKE2b-256 6d83f115c50a059a17078954a01d76f57b000ab922ed8cc34f572afdaa20169f

See more details on using hashes here.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page