From e55847e89e2e317c3afbe2aa2b952ccd8aa3a820 Mon Sep 17 00:00:00 2001 From: Matt Savoie Date: Tue, 14 May 2024 13:39:54 -0600 Subject: [PATCH] DAS-2166: Final Tweaking of example notebook words. --- docs/HyBIG-Example-Usage.ipynb | 83 +++++++++++++++++++--------------- 1 file changed, 46 insertions(+), 37 deletions(-) diff --git a/docs/HyBIG-Example-Usage.ipynb b/docs/HyBIG-Example-Usage.ipynb index f9fd732..a45c533 100644 --- a/docs/HyBIG-Example-Usage.ipynb +++ b/docs/HyBIG-Example-Usage.ipynb @@ -97,7 +97,7 @@ "source": [ "### Helper function to rename output images.\n", "\n", - "Harmony prepends a job identifier to processed images, but in order to display them in this notebook we strip off that id with the `rename_files` function." + "Harmony prepends a job identifier to processed images, to display them in this notebook the `rename_files` function will strip off the job id." ] }, { @@ -107,9 +107,6 @@ "metadata": {}, "outputs": [], "source": [ - "from pathlib import Path\n", - "\n", - "\n", "def rename_files(file_paths):\n", " print('Renaming:')\n", " for file_path in file_paths:\n", @@ -298,7 +295,7 @@ "#### The resulting output JPEG\n", "Notice the .2 degree border on the north and west edges.\n", "\n", - "\n" + "\n" ] }, { @@ -448,9 +445,7 @@ "source": [ "## Example: Tiling \n", "\n", - "In the next examples, we demonstrate HyBIG's tiling mechanism. \n", - "\n", - "Choosing the scale extent along with scale size, we can demonstrate the tiling behavior in HyBIG. " + "In the next examples, carefully choosing the scale extent along with scale size, demonstrates the tiling behavior in HyBIG. " ] }, { @@ -458,9 +453,10 @@ "id": "4c659b31", "metadata": {}, "source": [ - "Start with a square `scale_extent` over Australia, 42 degrees on a side. \n", + "### Example: untiled maximum size output image \n", + "Start with a square `scale_extent` over Australia, 42° on a side. \n", "\n", - "Choose a `scale_size`s so that the expected output is the maxium size of an untiled image. \n", + "Choose a `scale_size`s so that the expected output is precisely the maxium size of an untiled image. \n", "\n", "```\n", "australia_extent = [112, -47, 154, -5]\n", @@ -468,9 +464,8 @@ "scale_size_y = (-5 - -47) / 8192\n", "```\n", "\n", - "We choose 8192 because HyBIG can create a single untiled image of up to 8,192 x 8,192 cells large.\n", - "\n", - "By choosing these parameters, the output will be a single untiled image with size 8,192 x 8,192." + "We used 8192 because HyBIG can create a single untiled image of up to 8,192 x 8,192 cells large.\n", + "\n" ] }, { @@ -527,7 +522,7 @@ "metadata": {}, "outputs": [], "source": [ - "# We can see the file has the expected dimensions 8192 x 8192\n", + "# The output file has the expected dimensions 8192 x 8192\n", "!file hybig-output/example5/VCF5KYR_1991001_001_2018224205008.png" ] }, @@ -536,9 +531,9 @@ "id": "4bfcae8c", "metadata": {}, "source": [ - "We can see the output image here:\n", + "the untiled output image:\n", "\n", - "\n" + "\n" ] }, { @@ -546,9 +541,11 @@ "id": "d5e8e1f6", "metadata": {}, "source": [ - "Again, start with a square `scale_extent` over Australia, 42 degrees on a side. \n", + "### Example: tiled output images\n", "\n", - "Now Choose a `scale_size`s so that the expected output exceedd the maxium size of an untiled image to force a tiled output. \n", + "Again, start with same square `scale_extent` over Australia, 42° on a side. \n", + "\n", + "Decrease the `scale_size`s so that the expected output exceeds the maxium size of an untiled image forcing tiled output. \n", "\n", "```\n", "australia_extent = [112, -47, 154, -5]\n", @@ -556,9 +553,7 @@ "scale_size_y = (-5 - -47) / 8192 + 10\n", "```\n", "\n", - "We extended the cells by 10 in each direction, so that the output will be tiled into 3 rows and 3 columns.\n", - "\n", - "\n" + "The total number of output cells have been extened by 10 in each direction, so that the output will be tiled into 4096 x 4096 images.\n" ] }, { @@ -608,26 +603,48 @@ "rename_files(downloaded_tiled_outputs)" ] }, + { + "cell_type": "code", + "execution_count": null, + "id": "8d1a6948", + "metadata": {}, + "outputs": [], + "source": [ + "# The tiles have expected dimensions 4096 x 4096:\n", + "!file hybig-output/example5/VCF5KYR_1991001_001_2018224205008.r00c00.png" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8f0a64c9", + "metadata": {}, + "outputs": [], + "source": [ + "# The edge tiles make up the remaining 10 grid cells\n", + "!file hybig-output/example5/VCF5KYR_1991001_001_2018224205008.r00c02.png" + ] + }, { "cell_type": "markdown", "id": "319a2b99", "metadata": {}, "source": [ - "We can see some of the tiled output images here:\n", + "Some of the tiled output images:\n", "\n", "\n", - "\n", + "
\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "\n", - "\n", - "\n", + "\n", + "\n", "\n", "
\n", "\n" @@ -652,14 +669,6 @@ "\n", "rmtree(output_dir)" ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "ee544ef4", - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": {