<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def dinfContributingArea(self, contributing_area_grid, flow_dir_grid, outlet_shapefile=None, weight_grid=None, edge_contamination=False, ):
 """ Calculates contributing area with Dinf method. """

        log("PROCESS: DinfContributingArea")

        # Construct the taudem command line.
        cmd = [os.path.join(self.taudem_exe_path, 'areadinf'),
               '-ang', flow_dir_grid,
               '-sca', contributing_area_grid,
               ]

        if outlet_shapefile:
            cmd += ['-o', outlet_shapefile]
        if weight_grid:
            cmd += ['-wg', weight_grid]
        if not edge_contamination:
            cmd = cmd + ['-nc']

        self._run_mpi_cmd(cmd)

        # create projection file
        self._add_prj_file(flow_dir_grid,
                           contributing_area_grid)