fit a function to some data relating rain to arbitrary levels