# Path: utility/constants.py
# class Constants:
#     def __init__(self):
#         try:
#             import imas
#             self.__setup_imas_constants_db()
#         except ImportError:
#             self.__setup_standalone_constants_db()
# 
#     def __setup_standalone_constants_db(self):
#         self.charge_electron = c.elementary_charge
#         self.speed_of_light = c.speed_of_light
#         self.Boltzmann = c.Boltzmann
# 
#     def __setup_imas_constants_db(self):
#         pass


import numpy
import pandas
import utility.getdata as ut
import math
from utility.constants import Constants
from numpy.random import RandomState
from lxml import etree


class SynthSignals:
    def __init__(self, frequency=1e6, synthetic_signals=None, data_path='signals/test.txt'):
        if isinstance(frequency, float):
            self.frequency = frequency
        else:
            raise TypeError('Expected data type for <frequency> is <int>.')
        self._check_synthetic_signals(synthetic_signals, data_path)

    def _check_synthetic_signals(self, synthetic_signals, path):
        if synthetic_signals is None:
            self._load_synthetic_signals(path)
        elif isinstance(synthetic_signals, pandas.DataFrame) or isinstance(synthetic_signals, pandas.Series):
            self.signals = synthetic_signals
        else:
            raise TypeError('The expected data type for <synthetic signals> is <pandas.DataFrame or pandas.Series>')

    def _load_synthetic_signals(self, path):
        self.signals = ut.GetData(data_path_name=path, data_format="array").data


class Noise(RandomState):
    def __init__(self, seed=None):
        RandomState.__init__(self, seed)

# Path: utility/constants.py
# class Constants:
#     def __init__(self):
#         try:
#             import imas
#             self.__setup_imas_constants_db()
#         except ImportError:
#             self.__setup_standalone_constants_db()
# 
#     def __setup_standalone_constants_db(self):
#         self.charge_electron = c.elementary_charge
#         self.speed_of_light = c.speed_of_light
#         self.Boltzmann = c.Boltzmann
# 
#     def __setup_imas_constants_db(self):
#         pass


# Path: observation/noise.py
import numpy
import pandas
import utility.getdata as ut
import math
from utility.constants import Constants
from numpy.random import RandomState
from lxml import etree



class SynthSignals:
    def __init__(self, frequency=1e6, synthetic_signals=None, data_path='signals/test.txt'):
        if isinstance(frequency, float):
            self.frequency = frequency
        else:
            raise TypeError('Expected data type for <frequency> is <int>.')
        self._check_synthetic_signals(synthetic_signals, data_path)

    def _check_synthetic_signals(self, synthetic_signals, path):
        if synthetic_signals is None:
            self._load_synthetic_signals(path)
        elif isinstance(synthetic_signals, pandas.DataFrame) or isinstance(synthetic_signals, pandas.Series):
            self.signals = synthetic_signals
        else:
            raise TypeError('The expected data type for <synthetic signals> is <pandas.DataFrame or pandas.Series>')

    def _load_synthetic_signals(self, path):
        self.signals = ut.GetData(data_path_name=path, data_format="array").data


class Noise(RandomState):
    def __init__(self, seed=None):
        RandomState.__init__(self, seed)

        self.constants = Constants()