def dinfFlowDirection(self,
                          flow_dir_grid,
                          slope_grid,
                          pit_filled_elevation_grid=None):
        """
        Calculates flow direction with Dinf method
        """
        log("PROCESS: DinfFlowDirection")
        if pit_filled_elevation_grid:
            self.pit_filled_elevation_grid = pit_filled_elevation_grid

        # Construct the taudem command line.
        cmd = [os.path.join(self.taudem_exe_path, 'dinfflowdir'),
               '-fel', self.pit_filled_elevation_grid,
               '-ang', flow_dir_grid,
               '-slp', slope_grid,
               ]

        self._run_mpi_cmd(cmd)

        # create projection files
        self._add_prj_file(self.pit_filled_elevation_grid,
                           flow_dir_grid)
        self._add_prj_file(self.pit_filled_elevation_grid,
                           slope_grid)
Calculates flow direction with Dinf method