summaryrefslogtreecommitdiff
path: root/bin/analyze-log.py
diff options
context:
space:
mode:
Diffstat (limited to 'bin/analyze-log.py')
-rwxr-xr-xbin/analyze-log.py22
1 files changed, 16 insertions, 6 deletions
diff --git a/bin/analyze-log.py b/bin/analyze-log.py
index 901fb0f..50b5648 100755
--- a/bin/analyze-log.py
+++ b/bin/analyze-log.py
@@ -46,6 +46,11 @@ def main():
"--export-model", metavar="FILE", type=str, help="Export JSON model to FILE"
)
parser.add_argument(
+ "--export-model-with-lut",
+ action="store_true",
+ help="Include LUT in model export",
+ )
+ parser.add_argument(
"logfiles",
nargs="+",
type=str,
@@ -286,8 +291,8 @@ def main():
dfatool.cli.print_model_complexity(model)
if args.export_model:
- print(f"Exportding model to {args.export_model}")
- json_model = model.to_json()
+ print(f"Exporting model to {args.export_model}")
+ json_model = model.to_json(with_by_param=args.export_model_with_lut)
with open(args.export_model, "w") as f:
json.dump(
json_model, f, indent=2, sort_keys=True, cls=dfatool.utils.NpEncoder
@@ -296,7 +301,7 @@ def main():
if args.export_dot:
dfatool.cli.export_dot(model, args.export_dot)
- if args.export_dref:
+ if args.export_dref or args.export_pseudo_dref:
dref = model.to_dref(
static_quality,
lut_quality,
@@ -316,9 +321,14 @@ def main():
mutual_information[param]
)
- dfatool.cli.export_dataref(
- args.export_dref, dref, precision=args.dref_precision
- )
+ if args.export_pseudo_dref:
+ dfatool.cli.export_pseudo_dref(
+ args.export_pseudo_dref, dref, precision=args.dref_precision
+ )
+ if args.export_dref:
+ dfatool.cli.export_dataref(
+ args.export_dref, dref, precision=args.dref_precision
+ )
if args.export_json:
with open(args.export_json, "w") as f: