@staticmethod
def _datatype_size(datatype, numElms):
    """
        Gets datatype size

        Parameters:
            datatype : int
                CDF variable data type
            numElms : int
                number of elements

        Returns:
            numBytes : int
                The number of bytes for the data
        """
    sizes = {(1): 1, (2): 2, (4): 4, (8): 8, (11): 1, (12): 2, (14): 4, (21
        ): 4, (22): 8, (31): 8, (32): 16, (33): 8, (41): 1, (44): 4, (45): 
        8, (51): 1, (52): 1}
    try:
        if isinstance(datatype, int):
            if datatype == 51 or datatype == 52:
                return numElms
            else:
                return sizes[datatype]
        else:
            datatype = datatype.upper()
            if (datatype == 'CDF_INT1' or datatype == 'CDF_UINT1' or 
                datatype == 'CDF_BYTE'):
                return 1
            elif datatype == 'CDF_INT2' or datatype == 'CDF_UINT2':
                return 2
            elif datatype == 'CDF_INT4' or datatype == 'CDF_UINT4':
                return 4
            elif datatype == 'CDF_INT8' or datatype == 'CDF_TIME_TT2000':
                return 8
            elif datatype == 'CDF_REAL4' or datatype == 'CDF_FLOAT':
                return 4
            elif datatype == 'CDF_REAL8' or datatype == 'CDF_DOUBLE' or datatype == 'CDF_EPOCH':
                return 8
            elif datatype == 'CDF_EPOCH16':
                return 16
            elif datatype == 'CDF_CHAR' or datatype == 'CDF_UCHAR':
                return numElms
            else:
                return -1
    except Exception:
        return -1
