sampling.py
def decide_clas_value(self, clas_value, nearest_detect_value):
        """
        convert clas_value to EF scale according to its own value and nearest_detect_value value
        :param clas_value:
        :param nearest_detect_value:
        :return: EF scale
        """
        # detection: 0(no data), 1(no damage), 2(EF0), 3(EF1), 4(EF2), 5(EF3)
        # classification: 0(no data), 1(no damage), 2(light damage), 3(severe damage)
        # nearest_detect_value in [1,5]
        if clas_value == 1:
            if nearest_detect_value < 2:
                return (1 + nearest_detect_value)/2.0
            else:
                return 1.5
        elif clas_value == 2:
            if nearest_detect_value < 1.5:
                return 1.5
            elif nearest_detect_value < 2.5:
                return (2 + nearest_detect_value)/2.0
            elif nearest_detect_value < 4:
                return (3 + nearest_detect_value)/2.0
            else:
                return 3.5
        elif clas_value == 3:
            if nearest_detect_value < 3:
                return 3.5
            elif nearest_detect_value < 4.5:
                return (4 + nearest_detect_value)/2.0
            else:
                return (5 + nearest_detect_value)/2.0
        else:
            print('error!!')
            return -1

        convert clas_value to EF scale according to its own value and nearest_detect_value value
        :param clas_value:
        :param nearest_detect_value:
        :return: EF scale
        
convert clas_value to EF scale according to its own value and nearest_detect_value value
convert clas_value to EF scale according to its own value and nearest_detect_value value
def decide_clas_value(self, clas_value, nearest_detect_value):
        if clas_value == 1:
            if nearest_detect_value < 2:
                return (1 + nearest_detect_value)/2.0
            else:
                return 1.5
        elif clas_value == 2:
            if nearest_detect_value < 1.5:
                return 1.5
            elif nearest_detect_value < 2.5:
                return (2 + nearest_detect_value)/2.0
            elif nearest_detect_value < 4:
                return (3 + nearest_detect_value)/2.0
            else:
                return 3.5
        elif clas_value == 3:
            if nearest_detect_value < 3:
                return 3.5
            elif nearest_detect_value < 4.5:
                return (4 + nearest_detect_value)/2.0
            else:
                return (5 + nearest_detect_value)/2.0
        else:
            print('error!!')
            return -1
def decide_clas_value ( self , clas_value , nearest_detect_value ) : if clas_value == 1 : if nearest_detect_value < 2 : return ( 1 + nearest_detect_value ) / 2.0 else : return 1.5 elif clas_value == 2 : if nearest_detect_value < 1.5 : return 1.5 elif nearest_detect_value < 2.5 : return ( 2 + nearest_detect_value ) / 2.0 elif nearest_detect_value < 4 : return ( 3 + nearest_detect_value ) / 2.0 else : return 3.5 elif clas_value == 3 : if nearest_detect_value < 3 : return 3.5 elif nearest_detect_value < 4.5 : return ( 4 + nearest_detect_value ) / 2.0 else : return ( 5 + nearest_detect_value ) / 2.0 else : print ( 'error!!' ) return - 1
convert clas_value to EF scale according to its own value and nearest_detect_value value
convert clas_value to EF scale according to its own value and nearest_detect_value value
"""
        convert clas_value to EF scale according to its own value and nearest_detect_value value
        :param clas_value:
        :param nearest_detect_value:
        :return: EF scale
        """ # detection: 0(no data), 1(no damage), 2(EF0), 3(EF1), 4(EF2), 5(EF3) # classification: 0(no data), 1(no damage), 2(light damage), 3(severe damage) # nearest_detect_value in [1,5]
None
self
clas_value
None
nearest_detect_value
None