-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
🚸 Walkthrough on stacking time-series earth observation data #62
Conversation
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
Bumps [pystac-client](https://github.com/stac-utils/pystac-client) from 0.4.0 to 0.5.0. - [Release notes](https://github.com/stac-utils/pystac-client/releases) - [Changelog](https://github.com/stac-utils/pystac-client/blob/main/CHANGELOG.md) - [Commits](stac-utils/pystac-client@v0.4.0...v0.5.0) Bumps [planetary-computer](https://github.com/microsoft/planetary-computer-sdk-for-python) from 0.4.6 to 0.4.7. - [Release notes](https://github.com/microsoft/planetary-computer-sdk-for-python/releases) - [Changelog](https://github.com/microsoft/planetary-computer-sdk-for-python/blob/main/CHANGELOG.md) - [Commits](microsoft/planetary-computer-sdk-for-python@v0.4.6...v0.4.7)
Initial draft tutorial on stacking a time-series of Synthetic Aperture Radar polarization channels for a change detection task. Will be looking at landslides digitized by UNOSAT over Gunung Talamau, Indonesia after the 25 Feb 2022 Pasaman Barat earthquake. Also added pystac-client and stackstac to the docs extras.
Show how to get the Copernicus Digital Elevation Model from a STAC catalog. Added some more subsections to the first part, included a teaser thumbnail for both Sentinel-1 GRD and Copernicus DEM over the study area. Wrote some clarification text on what parameters go where when the STAC API query is made, that may or may not be helpful.
Forgot to rename the `dp_stac_items` variable to `dp_sen1_items` in f76a9b7. Also completed the alt-text for the Copernicus DEM thumbnail.
Show how to get the vector layer loaded as a geopandas.GeoDataFrame and added an overview of the layer stacking steps. Reduced the size of the Sentinel-1 xarray.DataArray by clipping to just Gunung Talamau, reducing the spatial resolution from 10m to 30m, and optimizing dtype from float64 to float16. Also added link to Humanitarian Data Exchange where the nice link to the shapefile (on a server that supports HTTP range requests) can be found.
Show how to create a SAR datacube with the Copernicus DEM layer appended. Specifically, the datacube is an xarray.Dataset with data variables VH, VV and DEM. Realized that a `stackstac.mosaic` DataPipe will be needed, but here's doing the mosaic in the collate function for now.
2 tasks
Get StackSTACMosaicker!
Show how to turn a stack of DEM tiles in an xarray.DataArray into a mosaic using StackSTACMosaicker, rather than doing it in the collate function. Also renamed some DataPipes to have an 'er' after #64.
Show how to perform rasterization of the vector polygons (following previous vector-segmentation-mask tutorial) and add the resulting mask as another data variable layer of the xarray.Dataset datacube. Thinking about creating a general purpose xarray collate function that does data variable appending since this is the third time it's been needed.
Switching to the Radiometrically Terrain Corrected (RTC) intensity dataset because it's georeferenced and actually better over steep topography at Gunung Talamau. However, this requires setting a PC_SDK_SUBSCRIPTION_KEY (finally found the correct one) and 🤞 that it works on readthedocs! Also did some minor edits to the Copernicus DEM mosaic section.
Realized that the horizontal striped mask was not an issue with datashader but on the xarray merge. Need to use `join="override"` instead of `join="outer"`. With that, all four layers (vh, vv, dem, mask) can be visualized nicely. Subplot code is a little messy, but well, see https://stackoverflow.com/questions/70667835/use-different-color-scales-in-xarray-faceted-imshow.
Completing the stacking layer tutorial in one go! Hastily adapted some FDL2022 code for creating pre-event, post-event and target label tensors, and turned them into tensors without any proper averaging or transposing of the dimensions. Credited the FDL2022 SAR Change Detection challenge and linked to the final showcase Youtube video. Hopefully can do InSAR and NISAR some day!
weiji14
added a commit
that referenced
this pull request
Oct 2, 2022
Refactoring the xarray collate functions to use `xr.merge` instead of the dictionary style way of appending data variables to an xarray.Dataset. Solution adapted from 7787f8e in #62 that is more robust to images being cut off due to rounding issues as with 6b18934 in #31. Downside is the need to verbosely rename the xarray.DataArray objects, and handle some conflicting coordinate labels.
weiji14
added a commit
that referenced
this pull request
Oct 2, 2022
* ♻️ Use xarray.merge with join="override" in collate functions Refactoring the xarray collate functions to use `xr.merge` instead of the dictionary style way of appending data variables to an xarray.Dataset. Solution adapted from 7787f8e in #62 that is more robust to images being cut off due to rounding issues as with 6b18934 in #31. Downside is the need to verbosely rename the xarray.DataArray objects, and handle some conflicting coordinate labels. * 📝 Minor tweaks to vector segmentation mask walkthrough A few whitespace fixes and fixing some DataPipe references.
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Tutorial on stacking a time-series of Synthetic Aperture Radar polarization channels + Copernicus DEM for a change detection task. Will be looking at landslides digitized by UNOSAT over Gunung Talamau, Indonesia after the 25 Feb 2022 Pasaman Barat earthquake.
Preview at https://zen3geo--62.org.readthedocs.build/en/62/stacking.html
TODO:
pystac-client
spatiotemporal query and stack STAC items usingstackstac
Part of #48. Xref microsoft/torchgeo#412 (comment).