convert D8 flow direction code from one algorithm to another.
        Args:
            in_file: input raster file path
            out_file: output raster file path
            in_alg: available algorithms are in FlowModelConst.d8_dirs. "taudem" is the default
            out_alg: same as in_alg. "arcgis" is the default
            datatype: default is None and use the datatype of the in_file

def convert_code(in_file, out_file, in_alg='taudem', out_alg='arcgis', datatype=None):
        """
        convert D8 flow direction code from one algorithm to another.
        Args:
            in_file: input raster file path
            out_file: output raster file path
            in_alg: available algorithms are in FlowModelConst.d8_dirs. "taudem" is the default
            out_alg: same as in_alg. "arcgis" is the default
            datatype: default is None and use the datatype of the in_file
        """
        FileClass.check_file_exists(in_file)
        in_alg = in_alg.lower()
        out_alg = out_alg.lower()
        if in_alg not in FlowModelConst.d8_dirs or out_alg not in FlowModelConst.d8_dirs:
            raise RuntimeError('The input algorithm name should one of %s' %
                               ', '.join(list(FlowModelConst.d8_dirs.keys())))
        convert_dict = dict()
        in_code = FlowModelConst.d8_dirs.get(in_alg)
        out_code = FlowModelConst.d8_dirs.get(out_alg)
        assert len(in_code) == len(out_code)
        for i, tmp_in_code in enumerate(in_code):
            convert_dict[tmp_in_code] = out_code[i]
        if datatype is not None and datatype in GDALDataType:
            RasterUtilClass.raster_reclassify(in_file, convert_dict, out_file, datatype)
        else:
            RasterUtilClass.raster_reclassify(in_file, convert_dict, out_file)