def new(self, name, data=None, type=None, recVary=True, dimVarys=None, dims=None, n_elements=None, compress=None, compress_param=None):
    "\n        Create a new zVariable in this CDF\n\n        .. note::\n            Either ``data`` or ``type`` must be specified. If type is not\n            specified, it is guessed from ``data``.\n\n        Parameters\n        ==========\n        name : str\n            name of the new variable\n\n        Other Parameters\n        ================\n        data\n            data to store in the new variable. If this has a an ``attrs``\n            attribute (e.g., :class:`~spacepy.datamodel.dmarray`), it\n            will be used to populate attributes of the new variable.\n        type : ctypes.c_long\n            CDF type of the variable, from :mod:`~pycdf.const`.\n            See section 2.5 of the CDF user's guide for more information on\n            CDF data types.\n        recVary : boolean\n            record variance of the variable (default True)\n        dimVarys : list of boolean\n            dimension variance of each dimension, default True for all\n            dimensions.\n        dims : list of int\n            size of each dimension of this variable, default zero-dimensional.\n            Note this is the dimensionality as defined by CDF, i.e., for\n            record-varying variables it excludes the leading record dimension.\n            See :py:class:`Var`.\n        n_elements : int\n            number of elements, should be 1 except for CDF_CHAR,\n            for which it's the length of the string.\n        compress : ctypes.c_long\n            Compression to apply to this variable, default None.\n            See :py:meth:`Var.compress`.\n        compress_param : ctypes.c_long\n            Compression parameter if compression used; reasonable default\n            is chosen. See :py:meth:`Var.compress`.\n\n        Returns\n        =======\n        out : :py:class:`Var`\n            the newly-created zVariable\n\n        Raises\n        ======\n        ValueError : if neither data nor sufficient typing information\n                     is provided.\n\n        Notes\n        =====\n        Any given data may be representable by a range of CDF types; if\n        the type is not specified, pycdf will guess which\n        the CDF types which can represent this data. This breaks down to:\n\n            #. If input data is a numpy array, match the type of that array\n            #. Proper kind (numerical, string, time)\n            #. Proper range (stores highest and lowest number provided)\n            #. Sufficient resolution (EPOCH16 required if datetime has\n               microseconds or below.)\n\n        If more than one value satisfies the requirements, types are returned\n        in preferred order:\n\n            #. Type that matches precision of data first, then\n            #. integer type before float type, then\n            #. Smallest type first, then\n            #. signed type first, then\n            #. specifically-named (CDF_BYTE) vs. generically named (CDF_INT1)\n\n        So for example, EPOCH_16 is preferred over EPOCH if ``data`` specifies\n        below the millisecond level (rule 1), but otherwise EPOCH is preferred\n        (rule 2).\n\n        For floats, four-byte is preferred unless eight-byte is required:\n\n            #. absolute values between 0 and 3e-39\n            #. absolute values greater than 1.7e38\n\n        This will switch to an eight-byte double in some cases where four bytes\n        would be sufficient for IEEE 754 encoding, but where DEC formats would\n        require eight.\n        "
    if ((type in (const.CDF_EPOCH16, const.CDF_INT8, const.CDF_TIME_TT2000)) and self.backward):
        raise ValueError('Cannot use EPOCH16, INT8, or TIME_TT2000 in backward-compatible CDF')
    if ((not lib.supports_int8) and (type in (const.CDF_INT8, const.CDF_TIME_TT2000))):
        raise ValueError('INT8 and TIME_TT2000 require CDF library 3.4.0')
    if (data is None):
        if (type is None):
            raise ValueError('Must provide either data or a CDF type.')
        if (dims is None):
            dims = []
        if (n_elements is None):
            n_elements = 1
    else:
        (guess_dims, guess_types, guess_elements) = _Hyperslice.types(data)
        if (dims is None):
            if recVary:
                if (guess_dims == ()):
                    raise ValueError('Record-varying data cannot be scalar. Specify NRV with CDF.new() or put data in array.')
                dims = guess_dims[1:]
            else:
                dims = guess_dims
        if (type is None):
            type = guess_types[0]
            if ((type == const.CDF_EPOCH16.value) and self.backward):
                type = const.CDF_EPOCH
        if (n_elements is None):
            n_elements = guess_elements
    if (dimVarys is None):
        dimVarys = [True for i in dims]
    recVary = (const.VARY if recVary else const.NOVARY)
    dimVarys = [(const.VARY if dimVary else const.NOVARY) for dimVary in dimVarys]
    if (not hasattr(type, 'value')):
        type = ctypes.c_long(type)
    if ((type.value == const.CDF_INT8.value) and (not lib.supports_int8)):
        raise ValueError('64-bit integer support require CDF library 3.4.0')
    if ((type.value in (const.CDF_EPOCH16.value, const.CDF_INT8.value, const.CDF_TIME_TT2000.value)) and self.backward):
        raise ValueError('Data requires EPOCH16, INT8, or TIME_TT2000; incompatible with backward-compatible CDF')
    new_var = Var(self, name, type, n_elements, dims, recVary, dimVarys)
    if (compress != None):
        new_var.compress(compress, compress_param)
    if (data is not None):
        new_var[...] = data
        if hasattr(data, 'attrs'):
            new_var.attrs.clone(data.attrs)
    return new_var
Create a new zVariable in this CDF

.. note::
    Either ``data`` or ``type`` must be specified. If type is not
    specified, it is guessed from ``data``.

Parameters
==========
name : str
    name of the new variable

Other Parameters
================
data
    data to store in the new variable. If this has a an ``attrs``
    attribute (e.g., :class:`~spacepy.datamodel.dmarray`), it
    will be used to populate attributes of the new variable.
type : ctypes.c_long
    CDF type of the variable, from :mod:`~pycdf.const`.
    See section 2.5 of the CDF user's guide for more information on
    CDF data types.
recVary : boolean
    record variance of the variable (default True)
dimVarys : list of boolean
    dimension variance of each dimension, default True for all
    dimensions.
dims : list of int
    size of each dimension of this variable, default zero-dimensional.
    Note this is the dimensionality as defined by CDF, i.e., for
    record-varying variables it excludes the leading record dimension.
    See :py:class:`Var`.
n_elements : int
    number of elements, should be 1 except for CDF_CHAR,
    for which it's the length of the string.
compress : ctypes.c_long
    Compression to apply to this variable, default None.
    See :py:meth:`Var.compress`.
compress_param : ctypes.c_long
    Compression parameter if compression used; reasonable default
    is chosen. See :py:meth:`Var.compress`.

Returns
=======
out : :py:class:`Var`
    the newly-created zVariable

Raises
======
ValueError : if neither data nor sufficient typing information
             is provided.

Notes
=====
Any given data may be representable by a range of CDF types; if
the type is not specified, pycdf will guess which
the CDF types which can represent this data. This breaks down to:

    #. If input data is a numpy array, match the type of that array
    #. Proper kind (numerical, string, time)
    #. Proper range (stores highest and lowest number provided)
    #. Sufficient resolution (EPOCH16 required if datetime has
       microseconds or below.)

If more than one value satisfies the requirements, types are returned
in preferred order:

    #. Type that matches precision of data first, then
    #. integer type before float type, then
    #. Smallest type first, then
    #. signed type first, then
    #. specifically-named (CDF_BYTE) vs. generically named (CDF_INT1)

So for example, EPOCH_16 is preferred over EPOCH if ``data`` specifies
below the millisecond level (rule 1), but otherwise EPOCH is preferred
(rule 2).

For floats, four-byte is preferred unless eight-byte is required:

    #. absolute values between 0 and 3e-39
    #. absolute values greater than 1.7e38

This will switch to an eight-byte double in some cases where four bytes
would be sufficient for IEEE 754 encoding, but where DEC formats would
require eight.
def new(self, name, data=None, type=None, recVary=True, dimVarys=None, dims=None, n_elements=None, compress=None, compress_param=None):
    "\n        Create a new zVariable in this CDF\n\n        .. note::\n            Either ``data`` or ``type`` must be specified. If type is not\n            specified, it is guessed from ``data``.\n\n        Parameters\n        ==========\n        name : str\n            name of the new variable\n\n        Other Parameters\n        ================\n        data\n            data to store in the new variable. If this has a an ``attrs``\n            attribute (e.g., :class:`~spacepy.datamodel.dmarray`), it\n            will be used to populate attributes of the new variable.\n        type : ctypes.c_long\n            CDF type of the variable, from :mod:`~pycdf.const`.\n            See section 2.5 of the CDF user's guide for more information on\n            CDF data types.\n        recVary : boolean\n            record variance of the variable (default True)\n        dimVarys : list of boolean\n            dimension variance of each dimension, default True for all\n            dimensions.\n        dims : list of int\n            size of each dimension of this variable, default zero-dimensional.\n            Note this is the dimensionality as defined by CDF, i.e., for\n            record-varying variables it excludes the leading record dimension.\n            See :py:class:`Var`.\n        n_elements : int\n            number of elements, should be 1 except for CDF_CHAR,\n            for which it's the length of the string.\n        compress : ctypes.c_long\n            Compression to apply to this variable, default None.\n            See :py:meth:`Var.compress`.\n        compress_param : ctypes.c_long\n            Compression parameter if compression used; reasonable default\n            is chosen. See :py:meth:`Var.compress`.\n\n        Returns\n        =======\n        out : :py:class:`Var`\n            the newly-created zVariable\n\n        Raises\n        ======\n        ValueError : if neither data nor sufficient typing information\n                     is provided.\n\n        Notes\n        =====\n        Any given data may be representable by a range of CDF types; if\n        the type is not specified, pycdf will guess which\n        the CDF types which can represent this data. This breaks down to:\n\n            #. If input data is a numpy array, match the type of that array\n            #. Proper kind (numerical, string, time)\n            #. Proper range (stores highest and lowest number provided)\n            #. Sufficient resolution (EPOCH16 required if datetime has\n               microseconds or below.)\n\n        If more than one value satisfies the requirements, types are returned\n        in preferred order:\n\n            #. Type that matches precision of data first, then\n            #. integer type before float type, then\n            #. Smallest type first, then\n            #. signed type first, then\n            #. specifically-named (CDF_BYTE) vs. generically named (CDF_INT1)\n\n        So for example, EPOCH_16 is preferred over EPOCH if ``data`` specifies\n        below the millisecond level (rule 1), but otherwise EPOCH is preferred\n        (rule 2).\n\n        For floats, four-byte is preferred unless eight-byte is required:\n\n            #. absolute values between 0 and 3e-39\n            #. absolute values greater than 1.7e38\n\n        This will switch to an eight-byte double in some cases where four bytes\n        would be sufficient for IEEE 754 encoding, but where DEC formats would\n        require eight.\n        "
    if ((type in (const.CDF_EPOCH16, const.CDF_INT8, const.CDF_TIME_TT2000)) and self.backward):
        raise ValueError('Cannot use EPOCH16, INT8, or TIME_TT2000 in backward-compatible CDF')
    if ((not lib.supports_int8) and (type in (const.CDF_INT8, const.CDF_TIME_TT2000))):
        raise ValueError('INT8 and TIME_TT2000 require CDF library 3.4.0')
    if (data is None):
        if (type is None):
            raise ValueError('Must provide either data or a CDF type.')
        if (dims is None):
            dims = []
        if (n_elements is None):
            n_elements = 1
    else:
        (guess_dims, guess_types, guess_elements) = _Hyperslice.types(data)
        if (dims is None):
            if recVary:
                if (guess_dims == ()):
                    raise ValueError('Record-varying data cannot be scalar. Specify NRV with CDF.new() or put data in array.')
                dims = guess_dims[1:]
            else:
                dims = guess_dims
        if (type is None):
            type = guess_types[0]
            if ((type == const.CDF_EPOCH16.value) and self.backward):
                type = const.CDF_EPOCH
        if (n_elements is None):
            n_elements = guess_elements
    if (dimVarys is None):
        dimVarys = [True for i in dims]
    recVary = (const.VARY if recVary else const.NOVARY)
    dimVarys = [(const.VARY if dimVary else const.NOVARY) for dimVary in dimVarys]
    if (not hasattr(type, 'value')):
        type = ctypes.c_long(type)
    if ((type.value == const.CDF_INT8.value) and (not lib.supports_int8)):
        raise ValueError('64-bit integer support require CDF library 3.4.0')
    if ((type.value in (const.CDF_EPOCH16.value, const.CDF_INT8.value, const.CDF_TIME_TT2000.value)) and self.backward):
        raise ValueError('Data requires EPOCH16, INT8, or TIME_TT2000; incompatible with backward-compatible CDF')
    new_var = Var(self, name, type, n_elements, dims, recVary, dimVarys)
    if (compress != None):
        new_var.compress(compress, compress_param)
    if (data is not None):
        new_var[...] = data
        if hasattr(data, 'attrs'):
            new_var.attrs.clone(data.attrs)
    return new_var