generated from uwhackweek/jupyterbook-template
-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uavsar tutorial sections #63
Merged
scottyhq
merged 61 commits into
snowex-hackweek:main
from
ZachHoppinen:uavsar_tutorial_sections
Jul 1, 2022
Merged
Changes from 41 commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
184717f
starting tutorial
jacktarricone 4202ced
remove large photo
jacktarricone 1726090
updatding
jacktarricone 77f23ef
tutorial intro
ZachHoppinen 276bb54
work in progress
jacktarricone 2914b0b
Merge branch 'main' of https://github.com/snowex-hackweek/website2022…
jacktarricone 95a421b
xarray
jacktarricone f16ffb4
add hls data
jacktarricone e3a2e45
adding optical plotting
jacktarricone acf0e6d
notebook work
ZachHoppinen dc55702
staged changes
ZachHoppinen 6c36f38
Merge branch 'jack_uavsar' of https://github.com/snowex-hackweek/webs…
ZachHoppinen a2d21e3
tutorial skeleton
ZachHoppinen 5d45fd3
tutorial change
ZachHoppinen 1a4a838
tutorial work
ZachHoppinen ee84cc2
spell checking
ZachHoppinen adc4614
cleaned notebooks
ZachHoppinen 07ce7ca
spell checkign
ZachHoppinen 9064ad0
mores spellcheck
ZachHoppinen a3cc4be
accidently had output in this notebook somehow?
ZachHoppinen dcbff6b
removed empty cells
ZachHoppinen c1bca22
table of contents addition
ZachHoppinen 4f978ad
fixed path to tutorial in _toc.yml
ZachHoppinen 46b4aaf
removed ipynb from toc
ZachHoppinen bdb799b
adding captions to images to see if that is the error.
ZachHoppinen b3cc640
testing new packages
ZachHoppinen bf41339
Merge branch 'main' of https://github.com/snowex-hackweek/website2022…
ZachHoppinen 330e256
comment out long running cell
ZachHoppinen c96af0f
remove all rasterio openings of local files
ZachHoppinen 63b11d1
fixed github url
ZachHoppinen f16c9a7
Merge branch 'main' of https://github.com/snowex-hackweek/website2022…
ZachHoppinen 7f19762
subsetted tif uploads
ZachHoppinen b0da299
setting up accessing imagery notebook
ZachHoppinen 1419497
tutorial branch
ZachHoppinen 1966533
adding to motivation section
ZachHoppinen 76ae2ab
table of contents sections
ZachHoppinen e991e64
cleaned notebooks
ZachHoppinen 7ffb926
ran notebook cells in the database
ZachHoppinen 5b31841
remove empty notebook cell
ZachHoppinen d866dc8
add index.md to toc file
ZachHoppinen 681a8b3
changed title of tutorial
ZachHoppinen 971313e
plot iamges
ZachHoppinen d4e7e0e
swe inversion notebook
ZachHoppinen b70277a
swe inversion
ZachHoppinen fff8cea
removed clipped images to git clone isntead
ZachHoppinen 0e39936
tutorial download to tmp
ZachHoppinen 2ee9647
clean notebooks
ZachHoppinen 10363c9
spellcheck
ZachHoppinen 8b27e3e
better name for git data repo
ZachHoppinen 23d78a0
Merge branch 'main' of https://github.com/snowex-hackweek/website2022…
ZachHoppinen 1e24635
reverted database tutorial I had accidently cleaned
ZachHoppinen f44c3e2
one more to revert
ZachHoppinen d3f8e17
working on insar data types
ZachHoppinen dab2635
inline plotting and spellcheck
ZachHoppinen 3e5d67b
elevation violin plot
ZachHoppinen f8d02f9
coherence vs unwrapped phase comparison
ZachHoppinen acfe185
cleaned noteboos
ZachHoppinen 539f1cb
Merge branch 'main' of https://github.com/snowex-hackweek/website2022…
ZachHoppinen 7bffe31
trying to merge with final pushes
ZachHoppinen 2878085
index headers
ZachHoppinen 0cf5fd9
header level changes
ZachHoppinen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,217 @@ | ||
{ | ||
"cells": [ | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"# UAVSAR\n", | ||
"\n", | ||
":::{figure-md} sthelens\n", | ||
"<img src=\"../../img/uavsar/sthelens.jpeg\" alt=\"uavsar scene\" width=\"800px\">\n", | ||
"\n", | ||
"Uavsar polarimetry imagery of Mt. St Helens. Source: Jones et al. 2008\n", | ||
":::\n", | ||
"\n", | ||
"*Developers: \\\n", | ||
"Jack Tarricone, University of Nevada, Reno \\\n", | ||
"Zach Keskinen, Boise State University*\n", | ||
"\n", | ||
"*Other contributors: \\\n", | ||
"Ross Palomaki, Montana State University\\\n", | ||
"Naheem Adebisi, Boise State University*" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## What is UAVSAR?\n", | ||
"\n", | ||
"[UAVSAR](https://uavsar.jpl.nasa.gov/education/what-is-uavsar.html) is a low frequency plane-based synthetic aperature radar. UAVSAR stands for \"Uninhabited Aerial Vehicle Synthetic Aperature Radar\". It captures imagery using a L-band radar. This low frequency means it can penetrate into and through clouds, vegetation, and snow.\n", | ||
"\n", | ||
"| frequency (cm) | resolution (rng x azi m) | Swath Width (km) | Polarizations | Launch date |\n", | ||
"| - | - | - | - | - |\n", | ||
"| L-band 23| 1.8 x 5.5 | 16 | VV, VH, HV, HH | 2007 |\n", | ||
"\n", | ||
"### NASA SnowEx 2020 and 2021 UAVSAR Campaings\n", | ||
"\n", | ||
"During the winter of 2020 and 2021, NASA conducted an L-band InSAR timeseries across the Western US with the goal of tracking changes in SWE. Field teams in 13 different locations in 2020, and in 6 locations in 2021, deployed on the date of the flight to perform calibration and validation observations.\n", | ||
"\n", | ||
":::{figure-md} UAVSAR-map\n", | ||
"<img src=\"../../img/SnowEx_map.jpg\" alt=\"uavsar map\" width=\"800px\">\n", | ||
"\n", | ||
"Map of the UAVSAR flight locations for NASA SnowEx. Note that the Montana site (Central Agricultral Research Center) is not on this map. Source: Chris Hiemstra\n", | ||
":::\n", | ||
"\n", | ||
"---\n", | ||
"\n", | ||
"The site locations from the above map along with the [Uavsar defined campaign name](https://api.daac.asf.alaska.edu/services/utils/mission_list) and currently processed pairs of InSAR images for each site. Note that the image pair count may contain multiple versions of the same image and may increase as more pairs of images are processed by JPL. Also note that the Lowman campaign name is the wrong state when searching.\n", | ||
"\n", | ||
"| Site Location | Campaign Name | Image Pairs |\n", | ||
"| - | - | - |\n", | ||
"| Grand Mesa | Grand Mesa, CO | 13 |\n", | ||
"| Boise River Basin | Lowman, CO | 17 |\n", | ||
"| Frazier Experimental Forest | Fraser, CO | 16 |\n", | ||
"| Senator Beck Basin | Ironton, CO | 9 |\n", | ||
"| East River | Peeler Peak, CO | 4 |\n", | ||
"| Cameron Pass | Rocky Mountains NP, CO | 15 |\n", | ||
"| Reynold Creek | Silver City, ID | 1 |\n", | ||
"| Central Agricultral Research Center | Utica, MT | 2 |\n", | ||
"| Little Cottonwoody Canyon | Salt Lake City, UT | 21 |\n", | ||
"| Jemez River | Los Alamos, NM | 3 |\n", | ||
"| American River Basin | Eldorado National Forest, CA | 4 |\n", | ||
"| Sagehen Creek | Donner Memorial State Park, CA | 4 |\n", | ||
"| Lakes Basin | Sierra National Forest, CA | 3 |" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Why would I use UAVSAR?\n", | ||
"\n", | ||
"UAVSAR works with low frequency radar waves. This means it is unaffected by clouds, maintains coherence, a measure of radar image quality, over long periods, and a time series was captured over 13 sites as part of the winter of 2019-2020 and 2020-2021. Additionally the uavsar is awesome." | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"## Accessing Uavsar Images\n", | ||
"\n", | ||
"Uavsar imagery can be downloaded from both the [JPL](https://uavsar.jpl.nasa.gov/cgi-bin/data.pl) and [Alaska Satellite Facility](https://search.asf.alaska.edu/#/?dataset=UAVSAR). However both provide the imagery in a binary format that is not readily usable or readable by GIS software or python libraries. \n", | ||
"\n", | ||
"## Data Download and Conversion with ```uavsar_pytools```\n", | ||
"```uavsar_pytools``` ([github](https://github.com/SnowEx/uavsar_pytools))is a Python package developed out of work started at SnowEx Hackweek 2021. It nativiely downloads, formats, and converts this data in analysis ready rasters projected in WSG-84 Lat/Lon (maybe more information here). The data traditionally comes in a binary format, which is not injestible by traditional geospatial analysis software (Python, R, QGIS, ArcGIS). It can download and convert either individual images - `UavsarScene` or entire collections of images - `UavsarCollection`.\n", | ||
"\n", | ||
"### Netrc Authorization\n", | ||
"\n", | ||
"In order to download uavsar images you will need a [netrc file](https://www.gnu.org/software/inetutils/manual/html_node/The-_002enetrc-file.html) that contains your earthdata username and password. If you need to register for a NASA earthdata account use this [link](https://urs.earthdata.nasa.gov/). A netrc file is a hidden file, it won't appear in the your file explorer, that is in your home directory and that programs can access to get the appropriate usernames and passwords. While you won't need to use this for this demonstration uavsar_pytools has a tool to create this netrc file on a local computer. You only need to create this file once and then it should be permanently stored on your computer." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"# ## Creating .netrc file with Earthdata login information\n", | ||
"# from uavsar_pytools.uavsar_tools import create_netrc\n", | ||
"\n", | ||
"# # This will prompt you for your username and password and save this\n", | ||
"# # information into a .netrc file in your home directory. You only need to run\n", | ||
"# # this command once per computer. Then it will be saved.\n", | ||
"# create_netrc()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### Downloading and converting a single Uavsar interferogram scene\n", | ||
"\n", | ||
"You can find urls for Uavsar images at the [ASF vertex website](https://search.asf.alaska.edu/#/?dataset=UAVSAR). Make sure to change the platform to Uavsar and you may also want to filter to ground projected interferograms.\n", | ||
"\n", | ||
":::{figure-md} vertexexample\n", | ||
"<img src=\"../../img/uavsar/vertex_example.png\" alt=\"vertex example\" width=\"800px\">\n", | ||
"\n", | ||
"Example of getting the uavsar URL from vertex.\n", | ||
":::\n" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"try:\n", | ||
" from uavsar_pytools import UavsarScene\n", | ||
"except ModuleNotFoundError:\n", | ||
" print('Install uavsar_pytools with `pip install uavsar_pytools`')\n", | ||
"\n", | ||
"## This is the directory you want to download and convert the images in.\n", | ||
"work_dir = '/tmp/uavsar_data'\n", | ||
"\n", | ||
"## This is a url you want to download. Can be obtained from vertex\n", | ||
"url = 'https://datapool.asf.alaska.edu/INTERFEROMETRY_GRD/UA/\\\n", | ||
"lowman_23205_21009-004_21012-000_0007d_s01_L090_01_int_grd.zip'\n", | ||
"\n", | ||
"## clean = True will delete the binary and zip files leaving only the tiffs\n", | ||
"scene = UavsarScene(url = url, work_dir=work_dir, clean= True)\n", | ||
"\n", | ||
"## After running url_to_tiffs() you will download the zip file, unzip the binary \n", | ||
"## files, and convert them to geotiffs in the directory with the scene name in\n", | ||
"## the work directory. It also generate a .csv pandas dictionary of metadata.\n", | ||
"# scene.url_to_tiffs()" | ||
] | ||
}, | ||
{ | ||
"cell_type": "markdown", | ||
"metadata": {}, | ||
"source": [ | ||
"### Downloading and converting a full Uavsar collection\n", | ||
"\n", | ||
"If you want to download and convert an entire Uavsar collection for a larger analysis you can use `UavsarCollection`. The collection names for the SnowEx campaign are listed in the table in the introduction. The `UavsarCollection` only downloads interferometric image pairs, but will soon be able to select between InSAR pairs and PolSAR images." | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"from uavsar_pytools import UavsarCollection\n", | ||
"## Collection name, the SnowEx Collection names are listed above. These are case \n", | ||
"## and space sensitive.\n", | ||
"collection_name = 'Grand Mesa, CO'\n", | ||
"\n", | ||
"## Directory to save collection into. This will be filled with directory with \n", | ||
"## scene names and tiffs inside of them.\n", | ||
"out_dir = '/tmp/collection_ex/'\n", | ||
"\n", | ||
"## This is optional, but you will generally want to at least limit the date\n", | ||
"## range between 2019 and today.\n", | ||
"date_range = ('2019-11-01', 'today')\n", | ||
"\n", | ||
"# Keywords: to download incidence angles with each image use `inc = True`\n", | ||
"# For only certain pols use `pols = ['VV','HV']`\n", | ||
"collection = UavsarCollection(collection = collection_name, work_dir = out_dir, dates = date_range)\n", | ||
"\n", | ||
"## You can use this to check how many image pairs have at least one image in\n", | ||
"## the date range.\n", | ||
"collection.find_urls()\n", | ||
"\n", | ||
"## When you are ready to download all the images run:\n", | ||
"# collection.collection_to_tiffs()\n", | ||
"## This will take a long time and a lot of space, ~1-5 gB and 10 minutes per \n", | ||
"## image pair depending on which scene, so run it if you have the space and time." | ||
] | ||
} | ||
], | ||
"metadata": { | ||
"kernelspec": { | ||
"display_name": "Python 3.10.5 ('hackweek')", | ||
"language": "python", | ||
"name": "python3" | ||
}, | ||
"language_info": { | ||
"codemirror_mode": { | ||
"name": "ipython", | ||
"version": 3 | ||
}, | ||
"file_extension": ".py", | ||
"mimetype": "text/x-python", | ||
"name": "python", | ||
"nbconvert_exporter": "python", | ||
"pygments_lexer": "ipython3" | ||
}, | ||
"vscode": { | ||
"interpreter": { | ||
"hash": "485426853efb45fbcac7604c62a774e4eca2d162588db5a3cdf8fcb52b528869" | ||
} | ||
} | ||
}, | ||
"nbformat": 4, | ||
"nbformat_minor": 2 | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure why the metadata changed in all the database notebooks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think when I was cleaning notebooks I ran the clean *.ipynb command in the wrong directory. I reverted all these files back to the commit before I did that.