ramancontrol.py 1.65 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
# -*- coding: utf-8 -*-
"""
GEPARD - Gepard-Enabled PARticle Detection
Copyright (C) 2018  Lars Bittrich and Josef Brandt, Leibniz-Institut für 
Polymerforschung Dresden e. V. <bittrich-lars@ipfdd.de>    

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program, see COPYING.  
If not, see <https://www.gnu.org/licenses/>.
"""
import os
22
import configparser
23

24
__all__ = ["RamanControl", "defaultPath", "simulatedRaman"]
25

26 27 28 29 30

config = configparser.ConfigParser()
config.read('gepard.cfg')

interface = "SIMULATED_RAMAN_CONTROL"
31 32
defaultPath = os.path.split(__file__)[0]

33 34 35 36 37 38 39 40 41 42 43 44 45
try: 
    defaultPath = config["Defaults"]["file_path"]
except KeyError:
    pass

try:
    interface = config["Interface"]["raman_interface"]
except KeyError:
    pass

if interface == "SIMULATED_RAMAN_CONTROL":
    from simulatedraman import SimulatedRaman
    RamanControl = SimulatedRaman
46 47
    print("WARNING: using only simulated raman control!")
    simulatedRaman = True
48 49 50 51 52 53 54 55
elif interface == "SIMULATED_RAMAN_CONTROL":
    from WITecCOM import WITecCOM
    RamanControl = WITecCOM
    simulatedRaman = False
elif interface == "RENISHAW_CONTROL":
    raise NotImplementedError
    simulatedRaman = False