def METHOD_NAME(self, filename):
    """
    open file, read a few lines to determine if it is an ossm file
    or a shio file
    """
    fh = open(filename, encoding='utf-8')
    lines = [fh.readline() for i in range(4)]
    if len(lines[1]) == 0:  # should not be needed with Universal newlines, or on py3
        # look for \r for lines instead of \n
        lines = lines[0].split('\r', 4)
    if len(lines[1]) == 0:
        # if this is still 0, then throw an error!
        raise ValueError('This does not appear to be a valid file format '
                         'that can be read by OSSM or Shio to get '
                         'tide information')
    # look for following keywords to determine if it is a Shio or OSSM file
    shio_file = ['[StationInfo]', 'Type=', 'Name=', 'Latitude=']
    if all([shio_file[i] == (lines[i])[:len(shio_file[i])]
            for i in range(4)]):
        return CyShioTime(filename)
    elif len(lines[3].split(',')) == 7:
        # maybe log / display a warning that v=0 for tide file and will be
        # ignored
        # if float((lines[3].split(',')[-1]) != 0.0:
        return CyTimeseries(filename, file_format=tsformat('uv'))
    else:
        raise ValueError('This does not appear to be a valid file format '
                         'that can be read by OSSM or Shio to get '
                         'tide information')