diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-12-29 08:42:10 +0100 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2017-12-29 08:42:10 +0100 |
commit | 1a3ae6085967be4cd76cabb2a630a04464f38748 (patch) | |
tree | 84db83ae4b82abcc292c8d33d7b20503f8d3a37f /dpd/main.py | |
parent | bc25ed90fb34398f9fd3066b7237d1306628b16f (diff) | |
download | dabmod-1a3ae6085967be4cd76cabb2a630a04464f38748.tar.gz dabmod-1a3ae6085967be4cd76cabb2a630a04464f38748.tar.bz2 dabmod-1a3ae6085967be4cd76cabb2a630a04464f38748.zip |
DPDCE: Add reset option
Diffstat (limited to 'dpd/main.py')
-rwxr-xr-x | dpd/main.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/dpd/main.py b/dpd/main.py index 24daa5a..3ca0d35 100755 --- a/dpd/main.py +++ b/dpd/main.py @@ -11,6 +11,7 @@ This engine calculates and updates the parameter of the digital predistortion module of ODR-DabMod.""" +import sys import datetime import os import argparse @@ -62,6 +63,8 @@ parser.add_argument('--plot', action="store_true") parser.add_argument('--name', default="", type=str, help='Name of the logging directory') +parser.add_argument('-r', '--reset', action="store_true", + help='Reset the DPD settings to the defaults.') cli_args = parser.parse_args() @@ -101,7 +104,7 @@ console.setFormatter(formatter) # add the handler to the root logger logging.getLogger('').addHandler(console) -logging.info(cli_args) +logging.info("DPDCE starting up with options: {}".format(cli_args)) import numpy as np import traceback @@ -129,6 +132,8 @@ if cli_args.lut: model = Lut(c) else: model = Poly(c) + +# Models have the default settings on startup adapt.set_predistorter(model.get_dpd_data()) adapt.set_digital_gain(digital_gain) @@ -170,6 +175,10 @@ elif dpddata[0] == "lut": else: logging.error("Unknown dpd data format {}".format(dpddata[0])) +if cli_args.reset: + logging.info("DPD Settings were reset to default values.") + sys.exit(0) + tx_agc = TX_Agc(adapt, c) # Automatic Gain Control |