def _default_pad(self, data_type, num_elms):   # @NoSelf
        '''
        The default pad values by CDF data type
        '''
        order = self._convert_option()
        if (data_type == 51 or data_type == 52):
            return str(' '*num_elms)
        if (data_type == 1) or (data_type == 41):
            pad_value = struct.pack(order+'b', -127)
            dt_string = 'i1'
        elif data_type == 2:
            pad_value = struct.pack(order+'h', -32767)
            dt_string = 'i2'
        elif data_type == 4:
            pad_value = struct.pack(order+'i', -2147483647)
            dt_string = 'i4'
        elif (data_type == 8) or (data_type == 33):
            pad_value = struct.pack(order+'q', -9223372036854775807)
            dt_string = 'i8'
        elif data_type == 11:
            pad_value = struct.pack(order+'B', 254)
            dt_string = 'u1'
        elif data_type == 12:
            pad_value = struct.pack(order+'H', 65534)
            dt_string = 'u2'
        elif data_type == 14:
            pad_value = struct.pack(order+'I', 4294967294)
            dt_string = 'u4'
        elif (data_type == 21) or (data_type == 44):
            pad_value = struct.pack(order+'f', -1.0E30)
            dt_string = 'f'
        elif (data_type == 22) or (data_type == 45) or (data_type == 31):
            pad_value = struct.pack(order+'d', -1.0E30)
            dt_string = 'd'
        else:
            # (data_type == 32):
            pad_value = struct.pack(order+'2d', *[-1.0E30, -1.0E30])
            dt_string = 'c16'

        dt = np.dtype(dt_string)
        ret = np.frombuffer(pad_value, dtype=dt, count=1)
        ret.setflags('WRITEABLE')
        return ret
def _default_pad ( self , data_type , num_elms ) : order = self . _convert_option ( ) if ( data_type == 51 or data_type == 52 ) : return str ( ' ' * num_elms ) if ( data_type == 1 ) or ( data_type == 41 ) : pad_value = struct . pack ( order + 'b' , - 127 ) dt_string = 'i1' elif data_type == 2 : pad_value = struct . pack ( order + 'h' , - 32767 ) dt_string = 'i2' elif data_type == 4 : pad_value = struct . pack ( order + 'i' , - 2147483647 ) dt_string = 'i4' elif ( data_type == 8 ) or ( data_type == 33 ) : pad_value = struct . pack ( order + 'q' , - 9223372036854775807 ) dt_string = 'i8' elif data_type == 11 : pad_value = struct . pack ( order + 'B' , 254 ) dt_string = 'u1' elif data_type == 12 : pad_value = struct . pack ( order + 'H' , 65534 ) dt_string = 'u2' elif data_type == 14 : pad_value = struct . pack ( order + 'I' , 4294967294 ) dt_string = 'u4' elif ( data_type == 21 ) or ( data_type == 44 ) : pad_value = struct . pack ( order + 'f' , - 1.0E30 ) dt_string = 'f' elif ( data_type == 22 ) or ( data_type == 45 ) or ( data_type == 31 ) : pad_value = struct . pack ( order + 'd' , - 1.0E30 ) dt_string = 'd' else : pad_value = struct . pack ( order + '2d' , * [ - 1.0E30 , - 1.0E30 ] ) dt_string = 'c16' dt = np . dtype ( dt_string ) ret = np . frombuffer ( pad_value , dtype = dt , count = 1 ) ret . setflags ( 'WRITEABLE' ) return ret
The default pad values by CDF data type