From 9d8feb77535712c9edb08ec9b9ddccb118344ac3 Mon Sep 17 00:00:00 2001 From: SylviaWhittle Date: Tue, 23 Apr 2024 11:20:11 +0100 Subject: [PATCH] Example loading jpk --- examples/example_01.ipynb | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/examples/example_01.ipynb b/examples/example_01.ipynb index a39aee1..ba9dc98 100644 --- a/examples/example_01.ipynb +++ b/examples/example_01.ipynb @@ -29,6 +29,47 @@ "source": [ "create_animation(file_name=\"sample_0\", frames=frames)" ] + }, + { + "cell_type": "markdown", + "metadata": {}, + "source": [ + "# JPK Files" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Import the load_jpk function from topofileformats\n", + "from topofileformats.jpk import load_jpk" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Load the IBW file as an image and pixel to nm scaling factor\n", + "FILE = \"../tests/resources/sample_0.jpk\"\n", + "image, pixel_to_nm_scaling = load_jpk(file_path=FILE, channel=\"height_trac\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# Plot the image\n", + "import matplotlib.pyplot as plt\n", + "\n", + "plt.imshow(image, cmap=\"afmhot\")\n", + "plt.show()" + ] } ], "metadata": {