def __init__(self, filename = "", sid_params = {}, force_read_timestamp = False):
        """Two ways to create a SIDfile:
        1) A file already exists and you want to read it: use 'filename'
        2) A new empty file needs to be created: use 'sid_params'
            to indicate the parameters of the file's header.
            The dictionary retrieved from a config file can be used.
            Usually this means you need to write that file after data collection.

        Note: only one or the other parameter should be given. If both are given
        then 'filename' is taken and 'sid_params' is ignored.
        """
        self.version = "1.4 20150801"
        self.filename = filename
        self.sid_params = sid_params    # dictionary of all header pairs
        self.is_extended = False
        self.timestamp_format = SidFile._TIMESTAMP_STANDARD

        if filename:
            # Read all lines in a buffer used by 'read_data' and 'read_header'
            try:
                with open(self.filename, "rt") as fin:
                    self.lines = fin.readlines()
            except __HOLE__ as why:
                print("Error reading", filename)
                print(str(why))
                exit(1)

            self.read_header()
            self.read_timestamp_format()
            self.control_header()
            self.read_data(force_read_timestamp)

        elif self.sid_params:
            # create zeroes numpy arrays to receive data
            self.control_header()
            self.clear_buffer()
    ##
    ##  Read a SID File and control header's consistency
    ##
dataset/ETHPy150Open ericgibert/supersid/supersid/sidfile.py/SidFile.__init__