aboutsummaryrefslogtreecommitdiffstats
path: root/python/dpd/Model_Poly.py
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2019-01-09 12:21:21 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2019-01-09 12:21:21 +0100
commit75ba4f064a65ebad77d130f160b9469418e49c9f (patch)
tree85ab6398ae59159eab0acb1501d206f322aa9449 /python/dpd/Model_Poly.py
parent8dd12110d63f89eab62097b391fb909478db3d94 (diff)
downloaddabmod-75ba4f064a65ebad77d130f160b9469418e49c9f.tar.gz
dabmod-75ba4f064a65ebad77d130f160b9469418e49c9f.tar.bz2
dabmod-75ba4f064a65ebad77d130f160b9469418e49c9f.zip
GUI: Add ability to restore previous DPD settings
Diffstat (limited to 'python/dpd/Model_Poly.py')
-rw-r--r--python/dpd/Model_Poly.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/python/dpd/Model_Poly.py b/python/dpd/Model_Poly.py
index 7ab6aa1..ef3fed3 100644
--- a/python/dpd/Model_Poly.py
+++ b/python/dpd/Model_Poly.py
@@ -125,6 +125,11 @@ class Poly:
def get_dpd_data(self):
return "poly", self.coefs_am, self.coefs_pm
+ def set_dpd_data(self, dpddata):
+ if dpddata[0] != "poly" or len(dpddata) != 3:
+ raise ValueError("dpddata is not of 'poly' format")
+ _, self.coefs_am, self.coefs_pm = dpddata
+
def _am_calc_line(self, coefs, min_amp, max_amp):
rx_range = np.linspace(min_amp, max_amp)
tx_est = np.sum(self._am_poly(rx_range) * coefs, axis=1)