Show a patch.

GET /api/patches/20217/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 20217,
    "url": "https://patchwork.libcamera.org/api/patches/20217/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/20217/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20240606101512.375178-4-david.plowman@raspberrypi.com>",
    "date": "2024-06-06T10:15:09",
    "name": "[3/6] utils: raspberrypi: ctt: Changed CTT handling of VC4 and PiSP",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "cba6516a4a6dd6eaa92e5d93f3a0e445e736ba4a",
    "submitter": {
        "id": 42,
        "url": "https://patchwork.libcamera.org/api/people/42/?format=api",
        "name": "David Plowman",
        "email": "david.plowman@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/20217/mbox/",
    "series": [
        {
            "id": 4367,
            "url": "https://patchwork.libcamera.org/api/series/4367/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4367",
            "date": "2024-06-06T10:15:06",
            "name": "Raspberry Pi Camera Tuning Tool updates",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/4367/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/20217/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/20217/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>",
        "X-Original-To": "parsemail@patchwork.libcamera.org",
        "Delivered-To": "parsemail@patchwork.libcamera.org",
        "Received": [
            "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 27E7AC3292\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu,  6 Jun 2024 10:15:40 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BF5686545C;\n\tThu,  6 Jun 2024 12:15:38 +0200 (CEST)",
            "from mail-ej1-x633.google.com (mail-ej1-x633.google.com\n\t[IPv6:2a00:1450:4864:20::633])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CE2F465459\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu,  6 Jun 2024 12:15:31 +0200 (CEST)",
            "by mail-ej1-x633.google.com with SMTP id\n\ta640c23a62f3a-a6265d3ba8fso66156166b.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 06 Jun 2024 03:15:31 -0700 (PDT)",
            "from pi5-davidp.pitowers.org\n\t([2001:4d4e:300:1f:c732:5d0a:406b:ae46])\n\tby smtp.gmail.com with ESMTPSA id\n\ta640c23a62f3a-a6c805c59a2sm75809866b.50.2024.06.06.03.15.30\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 06 Jun 2024 03:15:30 -0700 (PDT)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"ZyZ9UXk0\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1717668931; x=1718273731;\n\tdarn=lists.libcamera.org; \n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=YT/0a30myRtwZY+6s62GqXPjSHD/laXp1qrzJp9sYzs=;\n\tb=ZyZ9UXk0CvgJthTZrxOVFyIL1toJZHeI+UDibpqasCZo7j84H2ygeXXkH8wbPbz+mu\n\tBahlyw5xtQL5Xpqaizr9K6CBS7WNfr5aXjuHpse5bRo4yDDNClmIeElamV62aVbc/hU8\n\tdIhqoTdprc9/b75vr6cIdS3CkDwY8ARZ2B0/NLtWZ04xaug9f3aeVI5q3XGL59vL5DAC\n\tOQaHvjI4ek6yEtKuVZkcIkfEiZLSoxlH755su6EYCKcRcTYSJsYaL1XLCuGejYU/8I15\n\t+Vs98Geyb1Zfw5V+jUFnPLxDM+T3cF1bAoxtoHIh9Kf+3t8ZgpWRmlBL8TzEJDxvXIvh\n\tozgw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1717668931; x=1718273731;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=YT/0a30myRtwZY+6s62GqXPjSHD/laXp1qrzJp9sYzs=;\n\tb=U748zleFPxT79XgFX1h5zT6eowWuSBAb0/Cfp88YkH5borLkrHssWuvTUbYcVHsJX0\n\tRcxRYUeta6W8JNwD8EiGP972H74fqSeNZdq06sqVGS4/2dUzODxY869qz23jGF6KhGv/\n\tUgcm+VeSaVPWdDEbffcizSlKJf3BATpTZrPV+bHKgcdk9sNKcxnGs85UQFUJvFHMwFTQ\n\tmw5FUhUDip/Vnc8+bMPiOCgqbhA46pWCBpotZ6qsmjflgN/7mANygxMPAT1CWqcnb8uH\n\titx04r6rKetmKj38CfRCTjJYdvCssfF8QD7QdNCRb81kAmllS0tUQrGxXwwOQAdbJSHf\n\ts1yg==",
        "X-Gm-Message-State": "AOJu0YzJTdNecL0O1kZ7pHpXSC7ExImZy4T58O6uy1JeDRcs9retcg4p\n\tfkmh6WVm6P1R+mbJ2yYhHjJBYT7mCfqJ6lc/0ZSeZaZjvmTnfgMZrFaXOr5aVApKUSUHP3Joebb\n\tC",
        "X-Google-Smtp-Source": "AGHT+IHpUCV3ePiCOo2EvKbksE+ajGp1iwGGgSWhFi0MaxpdgBDa9axKXMnXon6HtR1nAVyJDZ/8Fw==",
        "X-Received": "by 2002:a17:906:8302:b0:a66:7b79:3572 with SMTP id\n\ta640c23a62f3a-a699f362134mr312554266b.15.1717668930907; \n\tThu, 06 Jun 2024 03:15:30 -0700 (PDT)",
        "From": "David Plowman <david.plowman@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Cc": "Ben Benson <benbenson2004@gmail.com>,\n\tBen Benson <ben.benson@raspberrypi.com>,\n\tNaushir Patuck <naush@raspberrypi.com>",
        "Subject": "[PATCH 3/6] utils: raspberrypi: ctt: Changed CTT handling of VC4 and\n\tPiSP",
        "Date": "Thu,  6 Jun 2024 11:15:09 +0100",
        "Message-Id": "<20240606101512.375178-4-david.plowman@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.39.2",
        "In-Reply-To": "<20240606101512.375178-1-david.plowman@raspberrypi.com>",
        "References": "<20240606101512.375178-1-david.plowman@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "<libcamera-devel.lists.libcamera.org>",
        "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>",
        "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>",
        "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>",
        "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "From: Ben Benson <benbenson2004@gmail.com>\n\nChanged how users select which platform to tune for. Now users\nspecify a command line argument, '-t', to specify which target\nplatform.\n\nSigned-off-by: Ben Benson <ben.benson@raspberrypi.com>\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\n---\n .../ctt/{alsc_pisp.py => alsc_only.py}        | 13 +++++--\n utils/raspberrypi/ctt/alsc_vc4.py             | 37 ------------------\n utils/raspberrypi/ctt/cac_only.py             |  9 ++---\n utils/raspberrypi/ctt/{ctt_run.py => ctt.py}  | 38 ++++++++++++++++---\n utils/raspberrypi/ctt/ctt_image_load.py       |  1 -\n utils/raspberrypi/ctt/ctt_log.txt             | 31 ---------------\n utils/raspberrypi/ctt/ctt_pisp.py             | 33 +---------------\n .../raspberrypi/ctt/ctt_pretty_print_json.py  |  8 +++-\n utils/raspberrypi/ctt/ctt_tools.py            |  3 +-\n utils/raspberrypi/ctt/ctt_vc4.py              | 33 +---------------\n 10 files changed, 57 insertions(+), 149 deletions(-)\n rename utils/raspberrypi/ctt/{alsc_pisp.py => alsc_only.py} (69%)\n delete mode 100755 utils/raspberrypi/ctt/alsc_vc4.py\n rename utils/raspberrypi/ctt/{ctt_run.py => ctt.py} (96%)\n delete mode 100644 utils/raspberrypi/ctt/ctt_log.txt",
    "diff": "diff --git a/utils/raspberrypi/ctt/alsc_pisp.py b/utils/raspberrypi/ctt/alsc_only.py\nsimilarity index 69%\nrename from utils/raspberrypi/ctt/alsc_pisp.py\nrename to utils/raspberrypi/ctt/alsc_only.py\nindex d0034ae1..a521c4ad 100755\n--- a/utils/raspberrypi/ctt/alsc_pisp.py\n+++ b/utils/raspberrypi/ctt/alsc_only.py\n@@ -4,12 +4,11 @@\n #\n # Copyright (C) 2022, Raspberry Pi Ltd\n #\n-# alsc_only.py - alsc tuning tool\n+# alsc tuning tool\n \n import sys\n \n-from ctt_pisp import json_template, grid_size, target\n-from ctt_run import run_ctt\n+from ctt import *\n from ctt_tools import parse_input\n \n if __name__ == '__main__':\n@@ -25,6 +24,7 @@ if __name__ == '__main__':\n     '-o' : Name of output json file.\n \n     Optional Arguments:\n+    '-t' : Target platform - 'pisp' or 'vc4'. Default 'vc4'\n     '-c' : Config file for the CTT. If not passed, default parameters used.\n     '-l' : Name of output log file. If not passed, 'ctt_log.txt' used.\n               \"\"\")\n@@ -33,5 +33,10 @@ if __name__ == '__main__':\n         \"\"\"\n         parse input arguments\n         \"\"\"\n-        json_output, directory, config, log_output = parse_input()\n+        json_output, directory, config, log_output, target = parse_input()\n+        if target == 'pisp':\n+            from ctt_pisp import json_template, grid_size\n+        elif target == 'vc4':\n+            from ctt_vc4 import json_template, grid_size\n+\n         run_ctt(json_output, directory, config, log_output, json_template, grid_size, target, alsc_only=True)\ndiff --git a/utils/raspberrypi/ctt/alsc_vc4.py b/utils/raspberrypi/ctt/alsc_vc4.py\ndeleted file mode 100755\nindex caf6a174..00000000\n--- a/utils/raspberrypi/ctt/alsc_vc4.py\n+++ /dev/null\n@@ -1,37 +0,0 @@\n-#!/usr/bin/env python3\n-#\n-# SPDX-License-Identifier: BSD-2-Clause\n-#\n-# Copyright (C) 2022, Raspberry Pi (Trading) Limited\n-#\n-# alsc tuning tool\n-\n-import sys\n-\n-from ctt_vc4 import json_template, grid_size, target\n-from ctt_run import run_ctt\n-from ctt_tools import parse_input\n-\n-if __name__ == '__main__':\n-    \"\"\"\n-    initialise calibration\n-    \"\"\"\n-    if len(sys.argv) == 1:\n-        print(\"\"\"\n-    VC4 Lens Shading Camera Tuning Tool version 1.0\n-\n-    Required Arguments:\n-    '-i' : Calibration image directory.\n-    '-o' : Name of output json file.\n-\n-    Optional Arguments:\n-    '-c' : Config file for the CTT. If not passed, default parameters used.\n-    '-l' : Name of output log file. If not passed, 'ctt_log.txt' used.\n-              \"\"\")\n-        quit(0)\n-    else:\n-        \"\"\"\n-        parse input arguments\n-        \"\"\"\n-        json_output, directory, config, log_output = parse_input()\n-        run_ctt(json_output, directory, config, log_output, json_template, grid_size, target, alsc_only=True)\ndiff --git a/utils/raspberrypi/ctt/cac_only.py b/utils/raspberrypi/ctt/cac_only.py\nindex 2bb11ccc..1c0a8193 100644\n--- a/utils/raspberrypi/ctt/cac_only.py\n+++ b/utils/raspberrypi/ctt/cac_only.py\n@@ -2,7 +2,7 @@\n #\n # SPDX-License-Identifier: BSD-2-Clause\n #\n-# Copyright (C) 2023, Raspberry Pi (Trading) Limited\n+# Copyright (C) 2023, Raspberry Pi (Trading) Ltd.\n #\n # cac_only.py - cac tuning tool\n \n@@ -102,11 +102,11 @@ def cac(filelist, output_filepath, plot_results=False):\n     sample = sample.replace(\"ry_vals\", pprint_array(rx * -1))\n     sample = sample.replace(\"bx_vals\", pprint_array(by * -1))\n     sample = sample.replace(\"by_vals\", pprint_array(bx * -1))\n-    print(\"Successfully converted to YAML\")\n+    print(\"Successfully converted to JSON\")\n     f = open(str(output_filepath), \"w+\")\n     f.write(sample)\n     f.close()\n-    print(\"Successfully written to yaml file\")\n+    print(\"Successfully written to json file\")\n     '''\n     If you wish to see a plot of the colour channel shifts, add the -p or --plots option\n     Can be a quick way of validating if the data/dots you've got are good, or if you need to\n@@ -139,5 +139,4 @@ if __name__ == \"__main__\":\n             plot_results = True\n \n     arg_output = argv[output_location + 1]\n-    logfile = open(\"log.txt\", \"a+\")\n-    cac(filelist, arg_output, plot_results, logfile)\n+    cac(filelist, arg_output, plot_results)\ndiff --git a/utils/raspberrypi/ctt/ctt_run.py b/utils/raspberrypi/ctt/ctt.py\nsimilarity index 96%\nrename from utils/raspberrypi/ctt/ctt_run.py\nrename to utils/raspberrypi/ctt/ctt.py\nindex 074136a1..522933bd 100755\n--- a/utils/raspberrypi/ctt/ctt_run.py\n+++ b/utils/raspberrypi/ctt/ctt.py\n@@ -185,22 +185,22 @@ class Camera:\n             except ArithmeticError:\n                 print('ERROR: Matrix is singular!\\nTake new pictures and try again...')\n                 self.log += '\\nERROR: Singular matrix encountered during fit!'\n-                self.log += '\\nCCM aborted!'\n+                self.log += '\\nCAC aborted!'\n                 return 1\n         else:\n             \"\"\"\n             case where config options suggest greyscale camera. No point in doing CAC\n             \"\"\"\n             cal_cr_list, cal_cb_list = None, None\n-            self.log += '\\nWARNING: No ALSC tables found.\\nCCM calibration '\n+            self.log += '\\nWARNING: No ALSC tables found.\\nCAC calibration '\n             self.log += 'performed without ALSC correction...'\n \n         \"\"\"\n         Write output to json\n         \"\"\"\n         self.json['rpi.cac']['cac'] = cacs\n-        self.log += '\\nCCM calibration written to json file'\n-        print('Finished CCM calibration')\n+        self.log += '\\nCAC calibration written to json file'\n+        print('Finished CAC calibration')\n \n \n     \"\"\"\n@@ -710,7 +710,6 @@ def run_ctt(json_output, directory, config, log_output, json_template, grid_size\n     mac_small = get_config(macbeth_d, \"small\", 0, 'bool')\n     mac_show = get_config(macbeth_d, \"show\", 0, 'bool')\n     mac_config = (mac_small, mac_show)\n-    cac_d = get_config(configs, \"cac\", {}, 'dict')\n \n     if blacklevel < -1 or blacklevel >= 2**16:\n         print('\\nInvalid blacklevel, defaulted to 64')\n@@ -770,3 +769,32 @@ def run_ctt(json_output, directory, config, log_output, json_template, grid_size\n         pass\n     else:\n         Cam.write_log(log_output)\n+\n+if __name__ == '__main__':\n+    \"\"\"\n+    initialise calibration\n+    \"\"\"\n+    if len(sys.argv) == 1:\n+        print(\"\"\"\n+    PiSP Tuning Tool version 1.0\n+    Required Arguments:\n+    '-i' : Calibration image directory.\n+    '-o' : Name of output json file.\n+\n+    Optional Arguments:\n+    '-t' : Target platform - 'pisp' or 'vc4'. Default 'vc4'\n+    '-c' : Config file for the CTT. If not passed, default parameters used.\n+    '-l' : Name of output log file. If not passed, 'ctt_log.txt' used.\n+              \"\"\")\n+        quit(0)\n+    else:\n+        \"\"\"\n+        parse input arguments\n+        \"\"\"\n+        json_output, directory, config, log_output, target = parse_input()\n+        if target == 'pisp':\n+            from ctt_pisp import json_template, grid_size\n+        elif target == 'vc4':\n+            from ctt_vc4 import json_template, grid_size\n+\n+        run_ctt(json_output, directory, config, log_output, json_template, grid_size, target)\ndiff --git a/utils/raspberrypi/ctt/ctt_image_load.py b/utils/raspberrypi/ctt/ctt_image_load.py\nindex ea5fa360..531de328 100644\n--- a/utils/raspberrypi/ctt/ctt_image_load.py\n+++ b/utils/raspberrypi/ctt/ctt_image_load.py\n@@ -351,7 +351,6 @@ def dng_load_image(Cam, im_str):\n         c3 = np.left_shift(raw_data[1::2, 1::2].astype(np.int64), shift)\n         Img.channels = [c0, c1, c2, c3]\n         Img.rgb = raw_im.postprocess()\n-        Img.sizes = raw_im.sizes\n \n     except Exception:\n         print(\"\\nERROR: failed to load DNG file\", im_str)\ndiff --git a/utils/raspberrypi/ctt/ctt_log.txt b/utils/raspberrypi/ctt/ctt_log.txt\ndeleted file mode 100644\nindex 682e24e4..00000000\n--- a/utils/raspberrypi/ctt/ctt_log.txt\n+++ /dev/null\n@@ -1,31 +0,0 @@\n-Log created : Fri Aug 25 17:02:58 2023\n-\n-----------------------------------------------------------------------\n-User Arguments\n-----------------------------------------------------------------------\n-\n-Json file output: output.json\n-Calibration images directory: ../ctt/\n-No configuration file input... using default options\n-No log file path input... using default: ctt_log.txt\n-\n-----------------------------------------------------------------------\n-Image Loading\n-----------------------------------------------------------------------\n-\n-Directory: ../ctt/\n-Files found: 1\n-\n-Image: alsc_3000k_0.dng\n-Identified as an ALSC image\n-Colour temperature: 3000 K\n-\n-Images found:\n-Macbeth : 0\n-ALSC : 1 \n-CAC: 0 \n-\n-Camera metadata\n-ERROR: No usable macbeth chart images found\n-\n-----------------------------------------------------------------------\ndiff --git a/utils/raspberrypi/ctt/ctt_pisp.py b/utils/raspberrypi/ctt/ctt_pisp.py\nindex 862587a6..4c432f17 100755\n--- a/utils/raspberrypi/ctt/ctt_pisp.py\n+++ b/utils/raspberrypi/ctt/ctt_pisp.py\n@@ -4,13 +4,8 @@\n #\n # Copyright (C) 2019, Raspberry Pi Ltd\n #\n-# ctt_pisp.py - camera tuning tool for PiSP platforms\n+# ctt_pisp.py - camera tuning tool data for PiSP platforms\n \n-import os\n-import sys\n-\n-from ctt_run import run_ctt\n-from ctt_tools import parse_input\n \n json_template = {\n     \"rpi.black_level\": {\n@@ -207,29 +202,3 @@ json_template = {\n }\n \n grid_size = (32, 32)\n-\n-target = 'pisp'\n-\n-if __name__ == '__main__':\n-    \"\"\"\n-    initialise calibration\n-    \"\"\"\n-    if len(sys.argv) == 1:\n-        print(\"\"\"\n-    PiSP Camera Tuning Tool version 1.0\n-\n-    Required Arguments:\n-    '-i' : Calibration image directory.\n-    '-o' : Name of output json file.\n-\n-    Optional Arguments:\n-    '-c' : Config file for the CTT. If not passed, default parameters used.\n-    '-l' : Name of output log file. If not passed, 'ctt_log.txt' used.\n-              \"\"\")\n-        quit(0)\n-    else:\n-        \"\"\"\n-        parse input arguments\n-        \"\"\"\n-        json_output, directory, config, log_output = parse_input()\n-        run_ctt(json_output, directory, config, log_output, json_template, grid_size, target)\ndiff --git a/utils/raspberrypi/ctt/ctt_pretty_print_json.py b/utils/raspberrypi/ctt/ctt_pretty_print_json.py\nindex d3bd7d97..350cec65 100755\n--- a/utils/raspberrypi/ctt/ctt_pretty_print_json.py\n+++ b/utils/raspberrypi/ctt/ctt_pretty_print_json.py\n@@ -108,6 +108,7 @@ def pretty_print(in_json: dict, custom_elems={}) -> str:\n if __name__ == \"__main__\":\n     parser = argparse.ArgumentParser(formatter_class=argparse.RawTextHelpFormatter, description=\n                     'Prettify a version 2.0 camera tuning config JSON file.')\n+    parser.add_argument('-t', '--target', type=str, help='Target platform', choices=['pisp', 'vc4'], default='vc4')\n     parser.add_argument('input', type=str, help='Input tuning file.')\n     parser.add_argument('output', type=str, nargs='?',\n                         help='Output converted tuning file. If not provided, the input file will be updated in-place.',\n@@ -117,7 +118,12 @@ if __name__ == \"__main__\":\n     with open(args.input, 'r') as f:\n         in_json = json.load(f)\n \n-    out_json = pretty_print(in_json)\n+    if args.target == 'pisp':\n+        from ctt_pisp import grid_size\n+    elif args.target == 'vc4':\n+        from ctt_vc4 import grid_size\n+\n+    out_json = pretty_print(in_json, custom_elems={'table': grid_size[0], 'luminance_lut': grid_size[0]})\n \n     with open(args.output if args.output is not None else args.input, 'w') as f:\n         f.write(out_json)\ndiff --git a/utils/raspberrypi/ctt/ctt_tools.py b/utils/raspberrypi/ctt/ctt_tools.py\nindex 27c52193..50b01ecf 100644\n--- a/utils/raspberrypi/ctt/ctt_tools.py\n+++ b/utils/raspberrypi/ctt/ctt_tools.py\n@@ -65,11 +65,12 @@ def parse_input():\n     directory = get_config(args_dict, '-i', None, 'string')\n     config = get_config(args_dict, '-c', None, 'string')\n     log_path = get_config(args_dict, '-l', None, 'string')\n+    target = get_config(args_dict, '-t', \"vc4\", 'string')\n     if directory is None:\n         raise ArgError('\\n\\nERROR! No input directory given.')\n     if json_output is None:\n         raise ArgError('\\n\\nERROR! No output json given.')\n-    return json_output, directory, config, log_path\n+    return json_output, directory, config, log_path, target\n \n \n \"\"\"\ndiff --git a/utils/raspberrypi/ctt/ctt_vc4.py b/utils/raspberrypi/ctt/ctt_vc4.py\nindex 86acfd47..7154e110 100755\n--- a/utils/raspberrypi/ctt/ctt_vc4.py\n+++ b/utils/raspberrypi/ctt/ctt_vc4.py\n@@ -4,13 +4,8 @@\n #\n # Copyright (C) 2019, Raspberry Pi Ltd\n #\n-# ctt_vc4.py - camera tuning tool for VC4 platforms\n+# ctt_vc4.py - camera tuning tool data for VC4 platforms\n \n-import os\n-import sys\n-\n-from ctt_run import run_ctt\n-from ctt_tools import parse_input\n \n json_template = {\n     \"rpi.black_level\": {\n@@ -129,29 +124,3 @@ json_template = {\n }\n \n grid_size = (16, 12)\n-\n-target = 'bcm2835'\n-\n-if __name__ == '__main__':\n-    \"\"\"\n-    initialise calibration\n-    \"\"\"\n-    if len(sys.argv) == 1:\n-        print(\"\"\"\n-    VC4 Camera Tuning Tool version 1.0\n-\n-    Required Arguments:\n-    '-i' : Calibration image directory.\n-    '-o' : Name of output json file.\n-\n-    Optional Arguments:\n-    '-c' : Config file for the CTT. If not passed, default parameters used.\n-    '-l' : Name of output log file. If not passed, 'ctt_log.txt' used.\n-              \"\"\")\n-        quit(0)\n-    else:\n-        \"\"\"\n-        parse input arguments\n-        \"\"\"\n-        json_output, directory, config, log_output = parse_input()\n-        run_ctt(json_output, directory, config, log_output, json_template, grid_size, target)\n",
    "prefixes": [
        "3/6"
    ]
}