(ray)
return data_type_str
Return the SigMF datatype string for the datatype of `ray`.
Return the SigMF datatype string for the datatype of `ray`.
Return the SigMF datatype string for the datatype of ray .
def get_data_type_str(ray):
    """
    Return the SigMF datatype string for the datatype of `ray`.
    """
    if not isinstance(ray, np.ndarray):
        raise error.SigMFError('Argument must be a numpy array')
    atype = ray.dtype
    if atype.kind not in ('u','i','f','c'):
        raise error.SigMFError('Unsupported data type:', atype)

    data_type_str = ''
    if atype.kind == 'c':
        data_type_str += 'cf'
    elif atype.kind == 'f':
        data_type_str += 'f'
    elif atype.kind in ('u','i'):
        data_type_str += atype.kind
    data_type_str += str(atype.itemsize * 8)  # units is bits
    data_type_str += get_endian_str(ray)
    return data_type_str
def get_data_type_str ( ray ) : if not isinstance ( ray , np . ndarray ) : raise error . SigMFError ( 'Argument must be a numpy array' ) atype = ray . dtype if atype . kind not in ( 'u' , 'i' , 'f' , 'c' ) : raise error . SigMFError ( 'Unsupported data type:' , atype ) data_type_str = '' if atype . kind == 'c' : data_type_str += 'cf' elif atype . kind == 'f' : data_type_str += 'f' elif atype . kind in ( 'u' , 'i' ) : data_type_str += atype . kind data_type_str += str ( atype . itemsize * 8 ) # units is bits data_type_str += get_endian_str ( ray ) return data_type_str