Skip to content

Commit

Permalink
DAS-2166: Final Tweaking of example notebook words.
Browse files Browse the repository at this point in the history
  • Loading branch information
flamingbear committed May 14, 2024
1 parent a7ba93d commit e55847e
Showing 1 changed file with 46 additions and 37 deletions.
83 changes: 46 additions & 37 deletions docs/HyBIG-Example-Usage.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -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."
]
},
{
Expand All @@ -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",
Expand Down Expand Up @@ -298,7 +295,7 @@
"#### The resulting output JPEG\n",
"Notice the .2 degree border on the north and west edges.\n",
"\n",
"<img src=\"hybig-output/example2/ASTGTMV003_N00E022_dem.jpg\" width=500 align='left' style=\"border:3px solid\" />\n"
"<img src=\"hybig-output/example2/ASTGTMV003_N00E022_dem.jpg\" width=500 align='left' style=\"border:3px solid gray\" />\n"
]
},
{
Expand Down Expand Up @@ -448,29 +445,27 @@
"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. "
]
},
{
"cell_type": "markdown",
"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",
"scale_size_x = (154 - 112) / 8192\n",
"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"
]
},
{
Expand Down Expand Up @@ -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"
]
},
Expand All @@ -536,29 +531,29 @@
"id": "4bfcae8c",
"metadata": {},
"source": [
"We can see the output image here:\n",
"the untiled output image:\n",
"\n",
"<img src='hybig-output/example5/VCF5KYR_1991001_001_2018224205008.png' width=250 align='left'/>\n"
"<img src='hybig-output/example5/VCF5KYR_1991001_001_2018224205008.png' width=350 align='left'/>\n"
]
},
{
"cell_type": "markdown",
"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",
"scale_size_x = (154 - 112) / 8192 + 10\n",
"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"
]
},
{
Expand Down Expand Up @@ -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",
"<table margin-left=0>\n",
"<table align=\"left\">\n",
"<tr>\n",
"<td> <img src=\"hybig-output/example5/VCF5KYR_1991001_001_2018224205008.r00c00.png\" width=75 height=75 align=\"left\" /> </td>\n",
"<td> <img src=\"hybig-output/example5/VCF5KYR_1991001_001_2018224205008.r00c01.png\" width=75 height=75 align=\"left\" /> </td>\n",
"<td> <img src=\"hybig-output/example5/VCF5KYR_1991001_001_2018224205008.r00c00.png\" width=150 height=150 align=\"left\" /> </td>\n",
"<td> <img src=\"hybig-output/example5/VCF5KYR_1991001_001_2018224205008.r00c01.png\" width=150 height=150 align=\"left\" /> </td>\n",
"</tr>\n",
"<tr>\n",
"<td> <img src=\"hybig-output/example5/VCF5KYR_1991001_001_2018224205008.r01c00.png\" width=75 height=75 align=\"left\" /> </td>\n",
"<td> <img src=\"hybig-output/example5/VCF5KYR_1991001_001_2018224205008.r01c01.png\" width=75 height=75 align=\"left\" /> </td>\n",
"<td> <img src=\"hybig-output/example5/VCF5KYR_1991001_001_2018224205008.r01c00.png\" width=150 height=150 align=\"left\" /> </td>\n",
"<td> <img src=\"hybig-output/example5/VCF5KYR_1991001_001_2018224205008.r01c01.png\" width=150 height=150 align=\"left\" /> </td>\n",
"</tr>\n",
"<tr>\n",
"<td> <img src=\"hybig-output/example5/VCF5KYR_1991001_001_2018224205008.r02c00.png\" width=75 height=75 align=\"left\" /> </td>\n",
"<td> <img src=\"hybig-output/example5/VCF5KYR_1991001_001_2018224205008.r02c01.png\" width=75 height=75 align=\"left\" /> </td>\n",
"<td> <img src=\"hybig-output/example5/VCF5KYR_1991001_001_2018224205008.r02c00.png\" width=150 height=150 align=\"left\" /> </td>\n",
"<td> <img src=\"hybig-output/example5/VCF5KYR_1991001_001_2018224205008.r02c01.png\" width=150 height=150 align=\"left\" /> </td>\n",
"</tr>\n",
"</table>\n",
"\n"
Expand All @@ -652,14 +669,6 @@
"\n",
"rmtree(output_dir)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ee544ef4",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
Expand Down

0 comments on commit e55847e

Please sign in to comment.