Ejemplo n.º 1
0
    def get_run_off_matrix(self):
        '''
        
        to retrieve the user's defined input for the runoff matrix
        '''

        run_off_matrix = np.empty((3, 3))

        try:
            # first row
            run_off_matrix[0, 0] = float(self.lineEdit_13.text())
            run_off_matrix[0, 1] = float(self.lineEdit_12.text())
            run_off_matrix[0, 2] = float(self.lineEdit_3.text())

            #second row
            run_off_matrix[1, 0] = float(self.lineEdit_14.text())
            run_off_matrix[1, 1] = float(self.lineEdit_15.text())
            run_off_matrix[1, 2] = float(self.lineEdit_16.text())

            #third row
            run_off_matrix[2, 0] = float(self.lineEdit_17.text())
            run_off_matrix[2, 1] = float(self.lineEdit_18.text())
            run_off_matrix[2, 2] = float(self.lineEdit_19.text())

        except Exception:
            raise InvalidInputs('Invalid Inputs')
        else:
            return run_off_matrix
Ejemplo n.º 2
0
    def get_max_root_depth(self):
        '''
        
        to retrieve the user's defined input for the maximum root depth
        '''

        try:
            max_root_depth = float(self.maxRootDepth.text())
        except Exception:
            raise InvalidInputs('Invalid Inputs')
        else:
            return max_root_depth
Ejemplo n.º 3
0
    def get_soil_parameters(self):
        '''
        
        to retrieve the user's defined input for the soil parameters
        '''

        soil_params = {}
        try:
            soil_params['FC'] = float(self.fpInput.text())
            soil_params['WP'] = float(self.wpInput.text())
        except Exception:
            raise InvalidInputs('Invalid Inputs')
        else:
            return soil_params
Ejemplo n.º 4
0
    def get_crop_coefficient(self):
        '''
        
        to retrieve the user's defined input for the crop coefficient
        '''

        crop_coefficient = {}
        try:
            crop_coefficient['initial'] = float(self.cropCoeff_Initial.text())
            crop_coefficient['middle'] = float(self.cropCoeff_Middle.text())
            crop_coefficient['end'] = float(self.cropCoeff_End.text())
            crop_coefficient['bs'] = float(self.cropCoeff_bs.text())
        except Exception:
            raise InvalidInputs('Invalid Inputs')
        else:
            return crop_coefficient
Ejemplo n.º 5
0
    def get_crop_duration(self):
        '''
        
        to retrieve the user's defined input for the duration of crops
        '''

        crop_duration = {}
        try:
            crop_duration['initial'] = float(self.cropDuration_Init.text())
            crop_duration['development'] = float(self.cropDuration_Dev.text())
            crop_duration['middle'] = float(self.cropDuration_Mid.text())
            crop_duration['late'] = float(self.cropDuration_Late.text())
        except Exception:
            raise InvalidInputs('Invalid Inputs')
        else:
            return crop_duration
Ejemplo n.º 6
0
    def get_crop_stages(self):
        '''
        
        to retrieve the user's defined input for the crop stages
        '''

        crop_stages = {}
        try:
            crop_stages['planting'] = float(self.cropStages_Planting.text())
            crop_stages['development'] = float(
                self.cropStages_Development.text())
            crop_stages['middle'] = float(self.cropStages_Middle.text())
            crop_stages['late'] = float(self.cropStages_Late.text())
            crop_stages['harvest'] = float(self.cropStages_Harvest.text())
        except Exception:
            raise InvalidInputs('Invalid Inputs')
        else:
            return crop_stages
Ejemplo n.º 7
0
    def get_model_constant_params(self):
        '''
        
        to retrieve the user's defined input for the constant parameters
        '''

        model_constant_params = {}
        try:
            model_constant_params['Ze'] = float(self.ze.text())
            model_constant_params['depletion_factor'] = float(
                self.depletionFactor.text())
            model_constant_params['initial_smd'] = float(
                self.initial_smd.text())
            model_constant_params['nss_fraction'] = float(
                self.nss_fraction.text())
        except Exception:
            raise InvalidInputs('Invalid Inputs')
        else:
            return model_constant_params