Skip to content

Commit

Permalink
Updates to Ag 2_ notebook
Browse files Browse the repository at this point in the history
Fixed the crop type sampling bug, improved workflow & documentation
  • Loading branch information
maxwellCcook committed Jun 9, 2024
1 parent 250ae48 commit 816d514
Show file tree
Hide file tree
Showing 3 changed files with 345 additions and 1,843 deletions.
1,733 changes: 61 additions & 1,672 deletions notebooks/agriculture/0_Ag_Lands_Search_EMIT.ipynb

Large diffs are not rendered by default.

89 changes: 20 additions & 69 deletions notebooks/agriculture/1_Orthorectify_images.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": null,
"id": "c85f8c1b-c98e-4144-9353-9ccc2c5cf6b7",
"metadata": {},
"outputs": [],
Expand All @@ -48,7 +48,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": null,
"id": "b9904e03-c7e0-4e14-ae86-38033534d227",
"metadata": {},
"outputs": [],
Expand All @@ -69,24 +69,10 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": null,
"id": "c0e6854f-2505-42fb-8552-42161c9c5622",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['EMIT_L2A_RFL_001_20230729T205618_2321014_018.nc',\n",
" 'EMIT_L2A_RFL_001_20230729T205630_2321014_019.nc',\n",
" 'EMIT_L2A_RFL_001_20230729T205642_2321014_020.nc',\n",
" 'EMIT_L2A_RFL_001_20230729T205653_2321014_021.nc']"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"### List downloaded files in the directory\n",
"# Create a file list of the non-ortho images\n",
Expand All @@ -106,31 +92,10 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": null,
"id": "fde8b643-1e57-47bf-bfef-dcf5b17622b1",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Input Granule ID: EMIT_L2A_RFL_001_20230729T205618_2321014_018.nc\n",
"Output Granule ID: EMIT_L2A_RFL_001_20230729T205618_2321014_018_ortho.nc\n",
" \n",
"Input Granule ID: EMIT_L2A_RFL_001_20230729T205630_2321014_019.nc\n",
"Output Granule ID: EMIT_L2A_RFL_001_20230729T205630_2321014_019_ortho.nc\n",
" \n",
"Input Granule ID: EMIT_L2A_RFL_001_20230729T205642_2321014_020.nc\n",
"Output Granule ID: EMIT_L2A_RFL_001_20230729T205642_2321014_020_ortho.nc\n",
" \n",
"Input Granule ID: EMIT_L2A_RFL_001_20230729T205653_2321014_021.nc\n",
"Output Granule ID: EMIT_L2A_RFL_001_20230729T205653_2321014_021_ortho.nc\n",
" \n",
"Total time: 31.769140243530273\n",
"*** Success! ***\n"
]
}
],
"outputs": [],
"source": [
"### Ortho-mosaic the data granules\n",
"t0 = time.time()\n",
Expand Down Expand Up @@ -168,45 +133,31 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": null,
"id": "d542b966-e9c6-4d84-86d6-b72a4f2b2fbe",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"['EMIT_L2A_RFL_001_20230729T205618_2321014_018_ortho.nc',\n",
" 'EMIT_L2A_RFL_001_20230729T205630_2321014_019_ortho.nc',\n",
" 'EMIT_L2A_RFL_001_20230729T205642_2321014_020_ortho.nc',\n",
" 'EMIT_L2A_RFL_001_20230729T205653_2321014_021_ortho.nc']"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"### List ortho-mosaiced files in the working image directory\n",
"fnmatch.filter(os.listdir(source_file_path), '*ortho.nc')"
]
},
{
"cell_type": "markdown",
"id": "ec8dbb62-ac72-4f51-99b9-aa97cb8d5330",
"metadata": {},
"source": [
"### OPTIONAL: Transfer data to your cyverse data store\n",
"\n",
"Note that this will take a few minutes to complete!"
]
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": null,
"id": "ffb5ff5f-b051-4fbf-88cc-89b7ac9ded4b",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\n",
"\n",
"*** Copying complete! ***\n"
]
}
],
"outputs": [],
"source": [
"### Create backup copy of orthorectified images\n",
"user_name = os.environ.get(\"IPLANT_USER\")\n",
Expand Down
Loading

0 comments on commit 816d514

Please sign in to comment.