From patchwork Wed Jul 13 09:21:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 16617 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 019F0BD1F1 for ; Wed, 13 Jul 2022 09:22:27 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 64E2363315; Wed, 13 Jul 2022 11:22:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1657704146; bh=y8goIwdID46N1e76oA4FSBS0Xh6vcW1N9CXrLBOoAGY=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=vNwKH6LUWCzn0urcJ/ciSbzvSYnGgHoTG7t9daJg1utImacGW/GEhfK0mgMtawN4U r71kVt5yCLft55oClMZMSR549qVjeL5qtfqJop6S239qn28xywfzo9s/+xrKB7I9cP J00J+4QTMwP6ExK00KGsVfFZOZOf1+ph1+MHQD6wUjzqHim/XXNWcTxgWMKrU/KIOO lf//KkF9OvUuKtwq5CH5+16pMn2WW8fuv8syzkDxS2mere9xgIyntyARoFUPcbBvd+ kWw3zmMOHcHrfrEtmYRjiF7qfFv6yF3GQf994WVNkD1B2u0ayVvKfYI/bpI37ZBjHd 3rTXjv/jayu4Q== Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id B7BA863319 for ; Wed, 13 Jul 2022 11:22:20 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="dIYinefV"; dkim-atps=neutral Received: by mail-wr1-x429.google.com with SMTP id a5so14601502wrx.12 for ; Wed, 13 Jul 2022 02:22:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TOodaolQR4gfp39MRCnIiMq7MOlHAiUC2bOadxeqkuY=; b=dIYinefVbBUow+3lr2dXFph+W5w6yO9mL+ZM9In6pT6MiBGNwRHEVg58LbN93+GKR1 eZtu/IcIP+gulAThjDpAeaawjD2LNCIa/RUEtxrpukU3H3kStcH4a4LlePfV69K3nNXo qco51zLYT0JJm+4a32JBrz7/MmHlVASnlCN2fZUiaVGJuKS2GQuPoBRRVevicLIujJbm Uc9xDyo724HC1GJmKo2BoHNfoFdQHUZ6H9Ws5NjyclWhro0htV3MObJ0JwcPUX8zC+7u rmI62lVtP7rgifZ+QSEbdHwZV7jfkMV86hTnjb0XyQeoJprfI4g+3H3+KURMQLigAGIq ORtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TOodaolQR4gfp39MRCnIiMq7MOlHAiUC2bOadxeqkuY=; b=OzSOFmtR7nnAKtdjfqpnRkQtr49Hrs0RHOrKUFeCLwi7eroqYBIoXt8CBsVVkNhhD1 9JjssnBWp+I8ulFpDq9Xo/DiUMV6k5WT5f8BzQOs+VD0uEsKARDXUc0+qg79siu6OEFA ZDlm74sJJgCY0qtmikIdwGMZ88ITvoMUzGaUxLXLyq4acdPCkORE/9iEgsCesBBjOGCY /khJLEkTVedxFXrqGpaubYaGq/NvY15yhO5Fdz712iB4y9YPFD3A7+Fy4+LCNg8Ay3gm 8GPmzaonqLFIG1sbqs8afD+HqF/LMlFCjQv0BHfamdMZGdMtnmttFHX24QFZAPmTD7uT Y30Q== X-Gm-Message-State: AJIora9UEEyzYGbvs5RdJKR09JG3WrUcV/VChsahksnkn1CRWghv+8oW rAA/k8yXoIxB3CUIa1dMcQbWTQNKyMkNuA== X-Google-Smtp-Source: AGRyM1stmKVO2fUZQwcyQcNBA7L4bcXlksrTdSN3eNOfj20AZCzFrJ3ygeIZP1YpKobleSPs/OgdQg== X-Received: by 2002:a5d:588d:0:b0:21d:a5cf:c6f with SMTP id n13-20020a5d588d000000b0021da5cf0c6fmr2373771wrf.716.1657704140114; Wed, 13 Jul 2022 02:22:20 -0700 (PDT) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id bd20-20020a05600c1f1400b0039747cf8354sm1514778wmb.39.2022.07.13.02.22.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Jul 2022 02:22:19 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Wed, 13 Jul 2022 10:21:58 +0100 Message-Id: <20220713092159.9014-8-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220713092159.9014-1-naush@raspberrypi.com> References: <20220713092159.9014-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 7/8] utils: raspberrypi: ctt: Output version 2.0 format tuning files X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Use the tuning file conversion script to output the new tuning file format from the CTT. Signed-off-by: Naushir Patuck --- utils/raspberrypi/ctt/ctt.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/utils/raspberrypi/ctt/ctt.py b/utils/raspberrypi/ctt/ctt.py index 15064634c67f..0d91ada15afa 100755 --- a/utils/raspberrypi/ctt/ctt.py +++ b/utils/raspberrypi/ctt/ctt.py @@ -15,7 +15,7 @@ from ctt_alsc import * from ctt_lux import * from ctt_noise import * from ctt_geq import * -from ctt_pretty_print_json import * +from convert_tuning import convert_v2 import random import json import re @@ -511,13 +511,12 @@ class Camera: """ def write_json(self): """ - Write json dictionary to file + Write json dictionary to file using our version 2 format """ - jstring = json.dumps(self.json, sort_keys=False) - """ - make it pretty :) - """ - pretty_print_json(jstring, self.jf) + out_json = convert_v2(self.json) + + with open(self.jf, 'w') as f: + f.write(out_json) """ add a new section to the log file