def __init__(self, libpath=None, library=None):
    "Load the CDF C library.\n\n        Searches for the library in the order:\n            1. Appropriately-named file in CDF_LIB\n            2. Appropriately-named file in CDF_BASE\n            3. Standard library search path\n        @raise CDFError: BAD_DATA_TYPE if can't map types properly\n        "
    if (not ('CDF_TMP' in os.environ)):
        os.environ['CDF_TMP'] = tempfile.gettempdir()
    if (not library):
        if (not libpath):
            (self.libpath, self._library) = self._find_lib()
            if (self._library is None):
                raise Exception('Cannot load CDF C library; checked {0}. Try \'os.environ["CDF_LIB"] = library_directory\' before import.'.format(', '.join(self.libpath)))
        else:
            self._library = ctypes.CDLL(libpath)
            self.libpath = libpath
    else:
        self._library = library
        self.libpath = libpath
    self._library.CDFlib.restype = ctypes.c_long
    self._library.EPOCHbreakdown.restype = ctypes.c_long
    self._library.computeEPOCH.restype = ctypes.c_double
    self._library.computeEPOCH.argtypes = ([ctypes.c_long] * 7)
    self._library.computeEPOCH16.restype = ctypes.c_double
    self._library.computeEPOCH16.argtypes = (([ctypes.c_long] * 10) + [ctypes.POINTER((ctypes.c_double * 2))])
    if hasattr(self._library, 'CDFsetFileBackward'):
        self._library.CDFsetFileBackward.restype = None
        self._library.CDFsetFileBackward.argtypes = [ctypes.c_long]
    if ((not hasattr(self._library, 'computeTT2000')) and hasattr(self._library, 'CDF_TT2000_from_UTC_parts')):
        self._library.computeTT2000 = self._library.CDF_TT2000_from_UTC_parts
    if hasattr(self._library, 'computeTT2000'):
        self._library.computeTT2000.restype = ctypes.c_longlong
        self._library.computeTT2000.argtypes = ([ctypes.c_double] * 9)
    if ((not hasattr(self._library, 'breakdownTT2000')) and hasattr(self._library, 'CDF_TT2000_to_UTC_parts')):
        self._library.breakdownTT2000 = self._library.CDF_TT2000_to_UTC_parts
    if hasattr(self._library, 'breakdownTT2000'):
        self._library.breakdownTT2000.restype = None
        self._library.breakdownTT2000.argtypes = ([ctypes.c_longlong] + ([ctypes.POINTER(ctypes.c_double)] * 9))
    if hasattr(self._library, 'CDF_TT2000_to_UTC_EPOCH'):
        self._library.CDF_TT2000_to_UTC_EPOCH.restype = ctypes.c_double
        self._library.CDF_TT2000_to_UTC_EPOCH.argtypes = [ctypes.c_longlong]
    if hasattr(self._library, 'CDF_TT2000_from_UTC_EPOCH'):
        self._library.CDF_TT2000_from_UTC_EPOCH.restype = ctypes.c_longlong
        self._library.CDF_TT2000_from_UTC_EPOCH.argtypes = [ctypes.c_double]
    if hasattr(self._library, 'CDF_TT2000_to_UTC_EPOCH16'):
        self._library.CDF_TT2000_to_UTC_EPOCH16.restype = ctypes.c_double
        self._library.CDF_TT2000_to_UTC_EPOCH16.argtypes = [ctypes.c_longlong, ctypes.POINTER((ctypes.c_double * 2))]
    if hasattr(self._library, 'CDF_TT2000_from_UTC_EPOCH16'):
        self._library.CDF_TT2000_from_UTC_EPOCH16.restype = ctypes.c_longlong
        self._library.CDF_TT2000_from_UTC_EPOCH16.argtypes = [ctypes.POINTER((ctypes.c_double * 2))]
    ver = ctypes.c_long(0)
    rel = ctypes.c_long(0)
    inc = ctypes.c_long(0)
    sub = ctypes.c_char(b' ')
    self.call(const.GET_, const.LIB_VERSION_, ctypes.byref(ver), const.GET_, const.LIB_RELEASE_, ctypes.byref(rel), const.GET_, const.LIB_INCREMENT_, ctypes.byref(inc), const.GET_, const.LIB_subINCREMENT_, ctypes.byref(sub))
    ver = ver.value
    rel = rel.value
    inc = inc.value
    sub = sub.value
    self.version = (ver, rel, inc, sub)
    self._del_middle_rec_bug = ((ver < 3) or ((ver == 3) and ((rel < 4) or ((rel == 4) and (inc < 1)))))
    self.supports_int8 = ((ver > 3) or ((ver == 3) and (rel >= 4)))
    self.cdftypenames = {const.CDF_BYTE.value: 'CDF_BYTE', const.CDF_CHAR.value: 'CDF_CHAR', const.CDF_INT1.value: 'CDF_INT1', const.CDF_UCHAR.value: 'CDF_UCHAR', const.CDF_UINT1.value: 'CDF_UINT1', const.CDF_INT2.value: 'CDF_INT2', const.CDF_UINT2.value: 'CDF_UINT2', const.CDF_INT4.value: 'CDF_INT4', const.CDF_UINT4.value: 'CDF_UINT4', const.CDF_INT8.value: 'CDF_INT8', const.CDF_FLOAT.value: 'CDF_FLOAT', const.CDF_REAL4.value: 'CDF_REAL4', const.CDF_DOUBLE.value: 'CDF_DOUBLE', const.CDF_REAL8.value: 'CDF_REAL8', const.CDF_EPOCH.value: 'CDF_EPOCH', const.CDF_EPOCH16.value: 'CDF_EPOCH16', const.CDF_TIME_TT2000.value: 'CDF_TIME_TT2000'}
    self.numpytypedict = {const.CDF_BYTE.value: numpy.int8, const.CDF_CHAR.value: numpy.int8, const.CDF_INT1.value: numpy.int8, const.CDF_UCHAR.value: numpy.uint8, const.CDF_UINT1.value: numpy.uint8, const.CDF_INT2.value: numpy.int16, const.CDF_UINT2.value: numpy.uint16, const.CDF_INT4.value: numpy.int32, const.CDF_UINT4.value: numpy.uint32, const.CDF_INT8.value: numpy.int64, const.CDF_FLOAT.value: numpy.float32, const.CDF_REAL4.value: numpy.float32, const.CDF_DOUBLE.value: numpy.float64, const.CDF_REAL8.value: numpy.float64, const.CDF_EPOCH.value: numpy.float64, const.CDF_EPOCH16.value: numpy.dtype((numpy.float64, 2)), const.CDF_TIME_TT2000.value: numpy.int64}
    self.timetypes = [const.CDF_EPOCH.value, const.CDF_EPOCH16.value, const.CDF_TIME_TT2000.value]
    if (not self.supports_int8):
        del self.cdftypenames[const.CDF_INT8.value]
        del self.numpytypedict[const.CDF_INT8.value]
        del self.cdftypenames[const.CDF_TIME_TT2000.value]
        del self.numpytypedict[const.CDF_TIME_TT2000.value]
    elif (sys.platform.startswith('linux') and os.uname()[4].startswith('arm') and hasattr(self._library, 'computeTT2000') and (self._library.computeTT2000(2010, 1, 1, 0, 0, 0, 0, 0, 0) != 315576066184000000)):
        if (ctypes.sizeof(ctypes.c_longlong) != ctypes.sizeof(ctypes.c_double)):
            warnings.warn('ARM with unknown type sizes; TT2000 functions will not work.')
        else:
            self._library.computeTT2000.argtypes = ([ctypes.c_longlong] * 9)
            c_ll_p = ctypes.POINTER(ctypes.c_longlong)
            if (self._library.computeTT2000(ctypes.cast(ctypes.pointer(ctypes.c_double(2010)), c_ll_p).contents, ctypes.cast(ctypes.pointer(ctypes.c_double(1)), c_ll_p).contents, ctypes.cast(ctypes.pointer(ctypes.c_double(1)), c_ll_p).contents, ctypes.cast(ctypes.pointer(ctypes.c_double(0)), c_ll_p).contents, ctypes.cast(ctypes.pointer(ctypes.c_double(0)), c_ll_p).contents, ctypes.cast(ctypes.pointer(ctypes.c_double(0)), c_ll_p).contents, ctypes.cast(ctypes.pointer(ctypes.c_double(0)), c_ll_p).contents, ctypes.cast(ctypes.pointer(ctypes.c_double(0)), c_ll_p).contents, ctypes.cast(ctypes.pointer(ctypes.c_double(0)), c_ll_p).contents) != 315576066184000000):
                warnings.warn('ARM with unknown calling convention; TT2000 functions will not work.')
            self.datetime_to_tt2000 = self._datetime_to_tt2000_typepunned
    v_epoch16_to_datetime = numpy.frompyfunc(self.epoch16_to_datetime, 2, 1)
    self.v_epoch16_to_datetime = (lambda x: v_epoch16_to_datetime(x[(..., 0)], x[(..., 1)]))
    self.v_epoch_to_datetime = numpy.frompyfunc(self.epoch_to_datetime, 1, 1)
    self.v_tt2000_to_datetime = numpy.frompyfunc(self.tt2000_to_datetime, 1, 1)
    self.v_datetime_to_epoch = numpy.vectorize(self.datetime_to_epoch, otypes=[numpy.float64])
    v_datetime_to_epoch16 = numpy.frompyfunc(self.datetime_to_epoch16, 1, 2)

    def _v_datetime_to_epoch16(x):
        retval = numpy.require(v_datetime_to_epoch16(x), dtype=numpy.float64)
        if (len(retval.shape) > 1):
            return numpy.rollaxis(numpy.rollaxis(retval, 0, (- 1)), (- 1), (- 2))
        else:
            return retval
    self.v_datetime_to_epoch16 = _v_datetime_to_epoch16
    self.v_datetime_to_tt2000 = numpy.vectorize(self.datetime_to_tt2000, otypes=[numpy.int64])
    self.v_epoch_to_tt2000 = numpy.vectorize(self.epoch_to_tt2000, otypes=[numpy.int64])
    self.v_tt2000_to_epoch = numpy.vectorize(self.tt2000_to_epoch, otypes=[numpy.float64])
    v_epoch16_to_tt2000 = numpy.frompyfunc(self.epoch16_to_tt2000, 2, 1)
    self.v_epoch16_to_tt2000 = (lambda x: v_epoch16_to_tt2000(x[(..., 0)], x[(..., 1)]))
    v_tt2000_to_epoch16 = numpy.frompyfunc(self.tt2000_to_epoch16, 1, 2)

    def _v_tt2000_to_epoch16(x):
        retval = numpy.require(v_tt2000_to_epoch16(x), dtype=numpy.float64)
        if (len(retval.shape) > 1):
            return numpy.rollaxis(numpy.rollaxis(retval, 0, (- 1)), (- 1), (- 2))
        else:
            return retval
    self.v_tt2000_to_epoch16 = _v_tt2000_to_epoch16
    if (not self.supports_int8):
        self.datetime_to_tt2000 = self._bad_tt2000
        self.tt2000_to_datetime = self._bad_tt2000
        self.v_datetime_to_tt2000 = self._bad_tt2000
        self.v_tt2000_to_datetime = self._bad_tt2000
        self.epoch_to_tt2000 = self._bad_tt2000
        self.v_epoch_to_tt2000 = self._bad_tt2000
        self.tt2000_to_epoch = self._bad_tt2000
        self.v_tt2000_to_epoch = self._bad_tt2000
        self.epoch_16_to_tt2000 = self._bad_tt2000
        self.v_epoch16_to_tt2000 = self._bad_tt2000
        self.tt2000_to_epoch16 = self._bad_tt2000
        self.v_tt2000_to_epoch16 = self._bad_tt2000
    self.set_backward(True)
Load the CDF C library.

Searches for the library in the order:
    1. Appropriately-named file in CDF_LIB
    2. Appropriately-named file in CDF_BASE
    3. Standard library search path
@raise CDFError: BAD_DATA_TYPE if can't map types properly
def __init__(self, libpath=None, library=None):
    "Load the CDF C library.\n\n        Searches for the library in the order:\n            1. Appropriately-named file in CDF_LIB\n            2. Appropriately-named file in CDF_BASE\n            3. Standard library search path\n        @raise CDFError: BAD_DATA_TYPE if can't map types properly\n        "
    if (not ('CDF_TMP' in os.environ)):
        os.environ['CDF_TMP'] = tempfile.gettempdir()
    if (not library):
        if (not libpath):
            (self.libpath, self._library) = self._find_lib()
            if (self._library is None):
                raise Exception('Cannot load CDF C library; checked {0}. Try \'os.environ["CDF_LIB"] = library_directory\' before import.'.format(', '.join(self.libpath)))
        else:
            self._library = ctypes.CDLL(libpath)
            self.libpath = libpath
    else:
        self._library = library
        self.libpath = libpath
    self._library.CDFlib.restype = ctypes.c_long
    self._library.EPOCHbreakdown.restype = ctypes.c_long
    self._library.computeEPOCH.restype = ctypes.c_double
    self._library.computeEPOCH.argtypes = ([ctypes.c_long] * 7)
    self._library.computeEPOCH16.restype = ctypes.c_double
    self._library.computeEPOCH16.argtypes = (([ctypes.c_long] * 10) + [ctypes.POINTER((ctypes.c_double * 2))])
    if hasattr(self._library, 'CDFsetFileBackward'):
        self._library.CDFsetFileBackward.restype = None
        self._library.CDFsetFileBackward.argtypes = [ctypes.c_long]
    if ((not hasattr(self._library, 'computeTT2000')) and hasattr(self._library, 'CDF_TT2000_from_UTC_parts')):
        self._library.computeTT2000 = self._library.CDF_TT2000_from_UTC_parts
    if hasattr(self._library, 'computeTT2000'):
        self._library.computeTT2000.restype = ctypes.c_longlong
        self._library.computeTT2000.argtypes = ([ctypes.c_double] * 9)
    if ((not hasattr(self._library, 'breakdownTT2000')) and hasattr(self._library, 'CDF_TT2000_to_UTC_parts')):
        self._library.breakdownTT2000 = self._library.CDF_TT2000_to_UTC_parts
    if hasattr(self._library, 'breakdownTT2000'):
        self._library.breakdownTT2000.restype = None
        self._library.breakdownTT2000.argtypes = ([ctypes.c_longlong] + ([ctypes.POINTER(ctypes.c_double)] * 9))
    if hasattr(self._library, 'CDF_TT2000_to_UTC_EPOCH'):
        self._library.CDF_TT2000_to_UTC_EPOCH.restype = ctypes.c_double
        self._library.CDF_TT2000_to_UTC_EPOCH.argtypes = [ctypes.c_longlong]
    if hasattr(self._library, 'CDF_TT2000_from_UTC_EPOCH'):
        self._library.CDF_TT2000_from_UTC_EPOCH.restype = ctypes.c_longlong
        self._library.CDF_TT2000_from_UTC_EPOCH.argtypes = [ctypes.c_double]
    if hasattr(self._library, 'CDF_TT2000_to_UTC_EPOCH16'):
        self._library.CDF_TT2000_to_UTC_EPOCH16.restype = ctypes.c_double
        self._library.CDF_TT2000_to_UTC_EPOCH16.argtypes = [ctypes.c_longlong, ctypes.POINTER((ctypes.c_double * 2))]
    if hasattr(self._library, 'CDF_TT2000_from_UTC_EPOCH16'):
        self._library.CDF_TT2000_from_UTC_EPOCH16.restype = ctypes.c_longlong
        self._library.CDF_TT2000_from_UTC_EPOCH16.argtypes = [ctypes.POINTER((ctypes.c_double * 2))]
    ver = ctypes.c_long(0)
    rel = ctypes.c_long(0)
    inc = ctypes.c_long(0)
    sub = ctypes.c_char(b' ')
    self.call(const.GET_, const.LIB_VERSION_, ctypes.byref(ver), const.GET_, const.LIB_RELEASE_, ctypes.byref(rel), const.GET_, const.LIB_INCREMENT_, ctypes.byref(inc), const.GET_, const.LIB_subINCREMENT_, ctypes.byref(sub))
    ver = ver.value
    rel = rel.value
    inc = inc.value
    sub = sub.value
    self.version = (ver, rel, inc, sub)
    self._del_middle_rec_bug = ((ver < 3) or ((ver == 3) and ((rel < 4) or ((rel == 4) and (inc < 1)))))
    self.supports_int8 = ((ver > 3) or ((ver == 3) and (rel >= 4)))
    self.cdftypenames = {const.CDF_BYTE.value: 'CDF_BYTE', const.CDF_CHAR.value: 'CDF_CHAR', const.CDF_INT1.value: 'CDF_INT1', const.CDF_UCHAR.value: 'CDF_UCHAR', const.CDF_UINT1.value: 'CDF_UINT1', const.CDF_INT2.value: 'CDF_INT2', const.CDF_UINT2.value: 'CDF_UINT2', const.CDF_INT4.value: 'CDF_INT4', const.CDF_UINT4.value: 'CDF_UINT4', const.CDF_INT8.value: 'CDF_INT8', const.CDF_FLOAT.value: 'CDF_FLOAT', const.CDF_REAL4.value: 'CDF_REAL4', const.CDF_DOUBLE.value: 'CDF_DOUBLE', const.CDF_REAL8.value: 'CDF_REAL8', const.CDF_EPOCH.value: 'CDF_EPOCH', const.CDF_EPOCH16.value: 'CDF_EPOCH16', const.CDF_TIME_TT2000.value: 'CDF_TIME_TT2000'}
    self.numpytypedict = {const.CDF_BYTE.value: numpy.int8, const.CDF_CHAR.value: numpy.int8, const.CDF_INT1.value: numpy.int8, const.CDF_UCHAR.value: numpy.uint8, const.CDF_UINT1.value: numpy.uint8, const.CDF_INT2.value: numpy.int16, const.CDF_UINT2.value: numpy.uint16, const.CDF_INT4.value: numpy.int32, const.CDF_UINT4.value: numpy.uint32, const.CDF_INT8.value: numpy.int64, const.CDF_FLOAT.value: numpy.float32, const.CDF_REAL4.value: numpy.float32, const.CDF_DOUBLE.value: numpy.float64, const.CDF_REAL8.value: numpy.float64, const.CDF_EPOCH.value: numpy.float64, const.CDF_EPOCH16.value: numpy.dtype((numpy.float64, 2)), const.CDF_TIME_TT2000.value: numpy.int64}
    self.timetypes = [const.CDF_EPOCH.value, const.CDF_EPOCH16.value, const.CDF_TIME_TT2000.value]
    if (not self.supports_int8):
        del self.cdftypenames[const.CDF_INT8.value]
        del self.numpytypedict[const.CDF_INT8.value]
        del self.cdftypenames[const.CDF_TIME_TT2000.value]
        del self.numpytypedict[const.CDF_TIME_TT2000.value]
    elif (sys.platform.startswith('linux') and os.uname()[4].startswith('arm') and hasattr(self._library, 'computeTT2000') and (self._library.computeTT2000(2010, 1, 1, 0, 0, 0, 0, 0, 0) != 315576066184000000)):
        if (ctypes.sizeof(ctypes.c_longlong) != ctypes.sizeof(ctypes.c_double)):
            warnings.warn('ARM with unknown type sizes; TT2000 functions will not work.')
        else:
            self._library.computeTT2000.argtypes = ([ctypes.c_longlong] * 9)
            c_ll_p = ctypes.POINTER(ctypes.c_longlong)
            if (self._library.computeTT2000(ctypes.cast(ctypes.pointer(ctypes.c_double(2010)), c_ll_p).contents, ctypes.cast(ctypes.pointer(ctypes.c_double(1)), c_ll_p).contents, ctypes.cast(ctypes.pointer(ctypes.c_double(1)), c_ll_p).contents, ctypes.cast(ctypes.pointer(ctypes.c_double(0)), c_ll_p).contents, ctypes.cast(ctypes.pointer(ctypes.c_double(0)), c_ll_p).contents, ctypes.cast(ctypes.pointer(ctypes.c_double(0)), c_ll_p).contents, ctypes.cast(ctypes.pointer(ctypes.c_double(0)), c_ll_p).contents, ctypes.cast(ctypes.pointer(ctypes.c_double(0)), c_ll_p).contents, ctypes.cast(ctypes.pointer(ctypes.c_double(0)), c_ll_p).contents) != 315576066184000000):
                warnings.warn('ARM with unknown calling convention; TT2000 functions will not work.')
            self.datetime_to_tt2000 = self._datetime_to_tt2000_typepunned
    v_epoch16_to_datetime = numpy.frompyfunc(self.epoch16_to_datetime, 2, 1)
    self.v_epoch16_to_datetime = (lambda x: v_epoch16_to_datetime(x[(..., 0)], x[(..., 1)]))
    self.v_epoch_to_datetime = numpy.frompyfunc(self.epoch_to_datetime, 1, 1)
    self.v_tt2000_to_datetime = numpy.frompyfunc(self.tt2000_to_datetime, 1, 1)
    self.v_datetime_to_epoch = numpy.vectorize(self.datetime_to_epoch, otypes=[numpy.float64])
    v_datetime_to_epoch16 = numpy.frompyfunc(self.datetime_to_epoch16, 1, 2)

    def _v_datetime_to_epoch16(x):
        retval = numpy.require(v_datetime_to_epoch16(x), dtype=numpy.float64)
        if (len(retval.shape) > 1):
            return numpy.rollaxis(numpy.rollaxis(retval, 0, (- 1)), (- 1), (- 2))
        else:
            return retval
    self.v_datetime_to_epoch16 = _v_datetime_to_epoch16
    self.v_datetime_to_tt2000 = numpy.vectorize(self.datetime_to_tt2000, otypes=[numpy.int64])
    self.v_epoch_to_tt2000 = numpy.vectorize(self.epoch_to_tt2000, otypes=[numpy.int64])
    self.v_tt2000_to_epoch = numpy.vectorize(self.tt2000_to_epoch, otypes=[numpy.float64])
    v_epoch16_to_tt2000 = numpy.frompyfunc(self.epoch16_to_tt2000, 2, 1)
    self.v_epoch16_to_tt2000 = (lambda x: v_epoch16_to_tt2000(x[(..., 0)], x[(..., 1)]))
    v_tt2000_to_epoch16 = numpy.frompyfunc(self.tt2000_to_epoch16, 1, 2)

    def _v_tt2000_to_epoch16(x):
        retval = numpy.require(v_tt2000_to_epoch16(x), dtype=numpy.float64)
        if (len(retval.shape) > 1):
            return numpy.rollaxis(numpy.rollaxis(retval, 0, (- 1)), (- 1), (- 2))
        else:
            return retval
    self.v_tt2000_to_epoch16 = _v_tt2000_to_epoch16
    if (not self.supports_int8):
        self.datetime_to_tt2000 = self._bad_tt2000
        self.tt2000_to_datetime = self._bad_tt2000
        self.v_datetime_to_tt2000 = self._bad_tt2000
        self.v_tt2000_to_datetime = self._bad_tt2000
        self.epoch_to_tt2000 = self._bad_tt2000
        self.v_epoch_to_tt2000 = self._bad_tt2000
        self.tt2000_to_epoch = self._bad_tt2000
        self.v_tt2000_to_epoch = self._bad_tt2000
        self.epoch_16_to_tt2000 = self._bad_tt2000
        self.v_epoch16_to_tt2000 = self._bad_tt2000
        self.tt2000_to_epoch16 = self._bad_tt2000
        self.v_tt2000_to_epoch16 = self._bad_tt2000
    self.set_backward(True)