示例#1
0
文件: core.py 项目: farmbao/obspy
def isSU(filename):
    """
    Checks whether or not the given file is a Seismic Unix (SU) file.

    :type filename: str
    :param filename: Seismic Unix file to be checked.
    :rtype: bool
    :return: ``True`` if a Seismic Unix file.

    .. note::
        This test is rather shaky because there is no reliable identifier in a
        Seismic Unix file.
    """
    with open(filename, 'rb') as f:
        stat = autodetectEndianAndSanityCheckSU(f)
    if stat is False:
        return False
    else:
        return True
示例#2
0
def isSU(filename):
    """
    Checks whether or not the given file is a Seismic Unix (SU) file.

    :type filename: str
    :param filename: Seismic Unix file to be checked.
    :rtype: bool
    :return: ``True`` if a Seismic Unix file.

    .. note::
        This test is rather shaky because there is no reliable identifier in a
        Seismic Unix file.
    """
    with open(filename, 'rb') as f:
        stat = autodetectEndianAndSanityCheckSU(f)
    if stat is False:
        return False
    else:
        return True