Attempt to determine the slope at the OUTLET

def calculateOutletSlope(self):
        """
        Attempt to determine the slope at the OUTLET
        """
        try:
            mask_grid = self.getGrid()
            elevation_grid = self.getGrid(use_mask=False)

            outrow = int(self.getCard("OUTROW").value)-1
            outcol = int(self.getCard("OUTCOL").value)-1
            cell_size = float(self.getCard("GRIDSIZE").value)

            min_row = max(0, outrow-1)
            max_row = min(mask_grid.x_size, outrow+2)
            min_col = max(0, outcol-1)
            max_col = min(mask_grid.y_size, outcol+2)

            mask_array = mask_grid.np_array()
            mask_array[outrow, outcol] = 0
            mask_array = mask_array[min_row:max_row, min_col:max_col]
            mask_array = (mask_array==0)

            elevation_array = elevation_grid.np_array()
            original_elevation = elevation_array[outrow, outcol]
            elevation_array = elevation_array[min_row:max_row, min_col:max_col]

            slope_calc_array = (elevation_array-original_elevation)/cell_size
            #NOTE: Ignoring distance to cells at angles. Assuming to small to matter
            mask_array[slope_calc_array<=0] = True

            slope_mask_array = np.ma.array(slope_calc_array, mask=mask_array)
            outslope = slope_mask_array.mean()
            if outslope is np.ma.masked or outslope < 0.001:
                outslope = 0.001

        except ValueError:
            outslope = 0.001

        self.setCard("OUTSLOPE", str(outslope))