# Path: pyteltools/slf/util.py



from copy import deepcopy
from . import Serafin
from .util import logger
import datetime
        self.start_time = None

        self.selected_vars = []
        self.selected_vars_names = {}
        self.selected_time_indices = []
        self.equations = []
        self.us_equation = None
        self.to_single = False

        self.operator = None
        self.metadata = {}
        # * select single layer: 'layer_selection': an integer
        # * vertical aggregation: 'vertical_operator': 'Min', 'Max' or 'Mean'

    def read(self):
        try:
            with Serafin.Read(self.filename, self.language) as input_stream:
                input_stream.read_header()
                input_stream.get_time()

                self.header = input_stream.header.copy()
                self.time = input_stream.time[:]
        except PermissionError:
            raise Serafin.SerafinRequestError('Permission denied (Is the file opened by another application?).')

        if self.header.date is not None:
            try:
                year, month, day, hour, minute, second = self.header.date
                self.start_time = datetime.datetime(year, month, day, hour, minute, second)
            except ValueError:

# Path: pyteltools/slf/util.py



# Path: pyteltools/slf/datatypes.py
from copy import deepcopy
from . import Serafin
from .util import logger
import datetime

        self.start_time = None

        self.selected_vars = []
        self.selected_vars_names = {}
        self.selected_time_indices = []
        self.equations = []
        self.us_equation = None
        self.to_single = False

        self.operator = None
        self.metadata = {}
        # * select single layer: 'layer_selection': an integer
        # * vertical aggregation: 'vertical_operator': 'Min', 'Max' or 'Mean'

    def read(self):
        try:
            with Serafin.Read(self.filename, self.language) as input_stream:
                input_stream.read_header()
                input_stream.get_time()

                self.header = input_stream.header.copy()
                self.time = input_stream.time[:]
        except PermissionError:
            raise Serafin.SerafinRequestError('Permission denied (Is the file opened by another application?).')

        if self.header.date is not None:
            try:
                year, month, day, hour, minute, second = self.header.date
                self.start_time = datetime.datetime(year, month, day, hour, minute, second)
            except ValueError:

                logger.warning('Date seems invalid, replaced by default date.')