diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..e440c92 --- /dev/null +++ b/LICENSE @@ -0,0 +1,24 @@ + +Copyright (c) 2014, 2015, Markus Rosenstihl, Condensed Matter Physics Institute, Technische Universität Darmstadt +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, +are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright notice, this +list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, +this list of conditions and the following disclaimer in the documentation and/or +other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR +ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/data/Container.py b/data/Container.py index 6db4396..71eb450 100644 --- a/data/Container.py +++ b/data/Container.py @@ -3,7 +3,7 @@ from PyQt4.QtGui import QColor import numpy as np -from libmath import yafflib +from libmath import yafflib, functions from libmath.BDSlib import id_to_color from container_base import BaseContainer @@ -13,7 +13,7 @@ import gui.container_widgets __author__ = 'markusro' - +# FIXME: why are the functions implemented again? Better to use function_library!! class Conductivity(BaseContainer): def __init__( self, plt_imag=None, plt_real=None, limits=None ): super(Conductivity, self).__init__(plt_real=plt_real, plt_imag=plt_imag, limits=limits) @@ -23,13 +23,16 @@ class Conductivity(BaseContainer): self.id_string = "cond" self.param_number = 3 + def function(self, p ,x): + return functions.cond_cmplx(p,x) + + # def function( self, p, x ): + # om = 2*np.pi*x + # sgma, isgma, n = p + # cond = sgma/(om**n)+isgma/(1j*om**n) # Jonscher (Universal Dielectric Response: e",e' prop sigma/omega**n + # cplx = np.array([cond.real, -cond.imag]) + # return cplx - def function( self, p, x ): - om = 2*np.pi*x - sgma, isgma, n = p - cond = sgma/(om**n)+isgma/(1j*om**n) # Jonscher (Universal Dielectric Response: e",e' prop sigma/omega**n - cplx = np.array([cond.real, -cond.imag]) - return cplx class PowerComplex(BaseContainer): diff --git a/data/container_base.py b/data/container_base.py index a2d1e87..304a39b 100644 --- a/data/container_base.py +++ b/data/container_base.py @@ -11,6 +11,8 @@ class BaseContainer(QObject): """ This class provides placeholders (or default) methods for "container" objects. These objects are basically the different fit elements for dielectric spectroscopy. + Specific containers are implemented in the container.py module. + """ # TODO generalize the base class so that we can use plugins (self-contained fit functions) changedData = pyqtSignal() diff --git a/data/data.py b/data/data.py index eeac5d7..19fc3b7 100644 --- a/data/data.py +++ b/data/data.py @@ -7,7 +7,7 @@ class Daten(QObject): data_changed_signal = pyqtSignal(list, list, list) def __init__(self, x=None, y_real=None, y_imag=None): - super(Daten, self).__init__(None) + super(Daten, self).__init__() self._data = (x, y_real, y_imag) def get_data(self): diff --git a/gui/graphs.py b/gui/graphs.py index 17fccf5..b8382b0 100644 --- a/gui/graphs.py +++ b/gui/graphs.py @@ -2,7 +2,7 @@ from PyQt4.QtCore import pyqtSignal from PyQt4.QtGui import QColor from data.data import Daten -from libmath.function_library import ModelFunction +from libmath.functions import ModelFunction __author__ = 'markusro' diff --git a/libmath/function_library.py b/libmath/functions.py similarity index 100% rename from libmath/function_library.py rename to libmath/functions.py diff --git a/qds.py b/qds.py index cd61625..146dff3 100755 --- a/qds.py +++ b/qds.py @@ -348,6 +348,7 @@ class AppWindow(QMainWindow): #TODO: need interface/method for adding function blocks, this is too repetitive + #TODO: start parameters have to be factored out for the above def addYaff( self, pos ): _yaff = YAFF(plt_real=self.ui.pgPlotWidget_real, plt_imag=self.ui.pgPlotWidget_imag,