From patchwork Thu Jul 14 15:24:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 16634 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 BC1E1BD1F1 for ; Thu, 14 Jul 2022 15:24:28 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 61DF063314; Thu, 14 Jul 2022 17:24:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1657812268; 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=ffpQ64GCNHNxwHiH22i8N7j62+5xhXxOB+xaUurDwt0FKdyX9JMMqAPKVJossTwO9 KXbrZ0lngsAkG4evWHAvYtJZt1v7ot5zq+5a810Ijs7zKau0H4tHKpPvZ232ubliM3 mjhzwmup4JFySi+KbeGVDgUB68mXheg4SY/Inp8I59IYn0VnVdtSn7zuFCNktDgU8F PZrxfkohZWmBqPcLNtHHlxENVElgSh3Gug51XiWz3W8Xc5eKoxquJGzeuv76q+5XW2 tUig4NKDgsOEKYa0wKuTaRIrUznECvRJU8ilts0j40E1TlpWZ+1/zY8KuP0Zn4KY30 t2caR/yBt4V6A== Received: from mail-wm1-x334.google.com (mail-wm1-x334.google.com [IPv6:2a00:1450:4864:20::334]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 53C2B63324 for ; Thu, 14 Jul 2022 17:24:23 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="X3x2JW5U"; dkim-atps=neutral Received: by mail-wm1-x334.google.com with SMTP id h14-20020a1ccc0e000000b0039eff745c53so1413138wmb.5 for ; Thu, 14 Jul 2022 08:24:23 -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=X3x2JW5UCtWCf1qpsTvp0OMLiUcDhTr45OkDrzcFf/iPOtZK0TW9iIXYz0h2TDbNky ewTPYzkQrFc/JDbo9BRHVubEYcm3Lg1zwzt0y6fIAUJQjbtGpJp/L/WDymUCpgAraIqC 7i02xQNaKO/Xy9JoQOjVU0Yc3eg12ooEJdkCgNCivsMNeMkDggjgRqHKE8taS7Kz5MVo RafaqDVd5EwBeIvw8+UvbjBaP9PoPkMIBgtGRuh1qcVQpwlUNwwX1myOcnG/9KodgMf2 vbRft7SxP9To3oDNNOjqKxoDfnSJjZZIw2wSG1/fO3jO4efTV425WxtIo2z7PmxXRqw3 fSPA== 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=KhYqhHBi2XhN2zPEEwfvrrh3LBv+3jpSzyiQqzUzPyMFOBqgEVYQoXf5raMLFxR17C /DQuV/v0JpWCYGdZR31IHQE3YAOFpCyt9366V4JzhaWDVyvjedazl3r9WDfHAcAS2Y82 dgI9MNIqcSmM5KpiH+yXm+9SgvIIx8bMApJ8+ksTfMHsm9ilvr2DajXessPGDSbuc5Mt 7LyE63UXq04EM+E1euUTrA5FfpJKq84phcRNsj69HKeOG3fnT3SH12vWPYwmXOWCgk0/ wQXO8kAuX+Epp5Mk1bkWhlRNRyaESodSdd+svj4CgMCJnRJqG32JoQ6hPdUPMK/sFYO4 K30Q== X-Gm-Message-State: AJIora9ILO9sIJ4fJJX5eng5PDXgnzxWLbl4ELZoIIjqGMeFXmLFmoic ktwjZ5nmNCuqmzP4bOJAe6fwMF6jj9KW7g== X-Google-Smtp-Source: AGRyM1st4ZMI2PRxadNFFUVXeIAQc/BHUwe+2RUYoUQ9ajze2XTT8aY/o1YzF+XmWjnRLBNvlnZxuQ== X-Received: by 2002:a05:600c:49a2:b0:3a2:e614:a14a with SMTP id h34-20020a05600c49a200b003a2e614a14amr16283459wmp.5.1657812262811; Thu, 14 Jul 2022 08:24:22 -0700 (PDT) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id h14-20020a1ccc0e000000b003a2e7c13a3asm2322476wmb.42.2022.07.14.08.24.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Jul 2022 08:24:21 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Thu, 14 Jul 2022 16:24:08 +0100 Message-Id: <20220714152409.9780-8-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220714152409.9780-1-naush@raspberrypi.com> References: <20220714152409.9780-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 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