Skip to content
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

PR for 0.2.0 Release #37

Merged
merged 102 commits into from
Jan 2, 2024
Merged

PR for 0.2.0 Release #37

merged 102 commits into from
Jan 2, 2024

Conversation

szwiep
Copy link
Contributor

@szwiep szwiep commented Dec 14, 2023

PR for 0.2.0 Release

- Support for Sentinel 2 imagery

  • Effected files: enums.py, indices.py, io.raster.py
  • Create Platform enum; supports landsat tm, etm, oli, and sentinel 2
  • Users provide platform(s) through platform= parameter in read_and_stack_tifs
  • Decorators added to index methods for setting platform compatibility and band requirements for each index

- Update to recovery target methods

  • Effected files: restoration.py (ReferenceSystem), recovery_target.py
  • mean replaced with median
  • Historical recovery targets are now per-pixel (band, y, x), reference targets are still per-polygon (band)
  • ReferenceSystem uses a historical_reference_system parameter to choose type of recovery target method to compute in ReferenceSystem.recovery_target()

- Add plotting for spectral trajectories of restoration site

  • Effected files: restoration.py, timeseries.py
  • Add plot_spectral_trajectory() method to RestorationArea. Method plots trajectories for each band; includes restoration, disturbances, and reference windows if relevant. Implementation is fairly slow, likely due to Pandas.

- Support for band naming

- Support for additional bands

- NumPy computation

  • Effected files: io.raster.py
  • Added array_type= parameter, to allow users to choose NumPy or Dask arrays; if NumPy is chosen, all computation run in spectral-recovery will be NumPy based (locally). Useful for comptuation over smaller datasets.

- Allow str inputs from users

  • Effected files: timeseries.py, io.raster.py, indices.py
  • Users now pass str inputs for index choices in compute_indices and platform in read_and_stack_tifs
  • restoration start, disturbance state, and reference years for RestorationArea(...) can now be passed as strs instead of Timestamps

- Loosen spatial check

  • Effected files: timeseries.py
  • Allow close-to-zero distance in contains_spatial when checking whether images contain restoration/reference polygons. Accounts for rounding errors that pop up between almost-equal bounding boxes

- Update docs

  • Effective files: docs\overview_API.ipynb, docs\test_data\
  • Test data updated to Landsat timeseries used in validation process, restoration polygon updated to 2005 wildfire. Timeseries clipped to polygon to make dataset smaller.
  • overview_API.ipynb updated to reflect new changes in this release.
  • Add example of how to write rasters with rioxarray to end of overview_API.ipynb, closes Add documentation for writing TIFS #24 (feedback from VTT)

- General clean up

  • Improve docstrings for public methods
  • Add more corner cases to unit tests
  • Lint codebase using pylint, see Lint codebase #36 for descriptions

szwiep and others added 30 commits October 20, 2023 14:23
Support Sentinel 2 Images
Copy link
Collaborator

@KavlinClein KavlinClein left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's looking good. A couple of small things to change for the next update, but nothing major from what I could see!

pyproject.toml Show resolved Hide resolved
src/spectral_recovery/indices.py Show resolved Hide resolved
src/spectral_recovery/io/raster.py Show resolved Hide resolved
@KavlinClein KavlinClein merged commit 36f722f into main Jan 2, 2024
@KavlinClein KavlinClein deleted the dev branch January 2, 2024 16:56
@szwiep szwiep restored the dev branch January 2, 2024 18:24
@szwiep szwiep mentioned this pull request Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add documentation for writing TIFS
2 participants