Cellular automata algorithms for drainage network extraction and rainfall data assimilation