C++

evalhyd-cpp is a C++ library to evaluate deterministic and probabilistic streamflow predictions.

Getting started

Brief usage overview

Deterministic evaluation
#include <xtensor/xtensor.hpp>
#include <xtensor/xio.hpp>
#include <evalhyd/evald.hpp>

xt::xtensor<double, 2> obs =
    {{4.7, 4.3, 5.5, 2.7}};
xt::xtensor<double, 2> prd =
    {{5.3, 4.2, 5.7, 2.3}};

auto res =
    evalhyd::evald(obs, prd, {"NSE"});

std::cout << res[0] << std::endl;
// {{{ 0.862981}}}
Probabilistic evaluation
#include <xtensor/xtensor.hpp>
#include <xtensor/xio.hpp>
#include <evalhyd/evalp.hpp>

xt::xtensor<double, 2> obs =
    {{4.7, 4.3, 5.5, 2.7, 4.1}};
xt::xtensor<double, 4> prd =
    {{{{5.3, 4.2, 5.7, 2.3, 3.1},
       {4.3, 4.2, 4.7, 4.3, 3.3},
       {5.3, 5.2, 5.7, 2.3, 3.9}}}};
xt::xtensor<double, 2> thr = {{4., 5.}};

auto res =
    evalhyd::evalp(obs, prd, {"BS"},
                   thr, "high");

std::cout << res[0] << std::endl;
// {{{{{ 0.222222,  0.133333}}}}}