Recent Releases of spectral-recovery

spectral-recovery - v1.0.1

Changelog: https://github.com/PEOPLE-ER/spectral-recovery/blob/main/CHANGELOG.md#101---2024-08-29

What's New

  • Update documentation (overview and installation) (#139)
  • Update notebooks
  • Update notebook sample data
  • Fix typos in README's Quick Start section (#139)

- Python
Published by szwiep over 1 year ago

spectral-recovery - v1.0.0

Changelog: https://github.com/PEOPLE-ER/spectral-recovery/blob/main/CHANGELOG.md#100---2024-08-29

What's New

  • Add support for processing multiple restoration sites at once (#136)
  • Add GCI, TCW, and TCG indexes (#138)
  • Add demo/example data to a new data module (#143)
  • Remove CLI support (#137)
  • Allow non-continious timeseries inputs to read_timeseries (#129)
  • Refactor targets module into targets.historic and targets.reference sub-modules (#136)
  • Add support for timeseries of spectral indices to read_timeseries (#139)
  • Refactor targets and compute_metrics to return dict of Xarray with restoration site IDs as keys (#148)

Example Usage

```python import spectralrecovery as sr from spectralrecovery import data

Read in timeseries data

spectralts = sr.readtimeseries( pathtotifs=data.bc06wildfirelandsatbaptimeseries(), band_names={1: "blue", 2: "green", 3: "red", 4: "nir", 5: "swir16", 6: "swir22"}, )

Compute indices

indexts = sr.computeindices( timeseriesdata=spectralts, indices=["NBR", "NDVI"], )

Read in restoration site(s)

restsite = sr.readrestorationsite( path=data.bc06wildfirerestorationsite(), distrestyears={0: [2005, 2006]}, )

Compute recovery target for restoration site

medianhist = sr.recoverytargets.historic.median( timeseriesdata=indexts, restorationsites=restsite, referencestart=2003, referenceend=2005, scale="pixel", )

Compute recovery metrics for restoration site!

metrics = sr.computemetrics( metrics=["Y2R", "R80P", "YrYr", "deltaIR", "RRI"], timeseriesdata=indexts, restorationsites=restsite, recoverytargets=median_hist, )

Inspect recovery metrics for the restoration site (site 0)

e.g what is the site's mean R80P (porportion of 80% of the recovery target)?:

metrics[0].sel(metric="R80P").mean().compute()

Or, write results out to a TIF:

metrics[0].sel(metric="Y2R").rio.toraster("site0y2r.tif") ```

- Python
Published by szwiep over 1 year ago

spectral-recovery - v0.3.3

This is a re-publishing of v0.3.2. compute_indices changes were missing from previous release while documentation indicated they were present. v0.3.2 has been yanked from PyPI

Changelog: https://github.com/PEOPLE-ER/Spectral-Recovery/blob/main/CHANGELOG.md#033---2024-04-05

What's New

  • Remove compute_indices from metric/plotting, add to public API (#102)
  • Fix incorrect reference_polygons is None check (#104)

- Python
Published by szwiep about 2 years ago

spectral-recovery - v0.3.2

Changelog: https://github.com/PEOPLE-ER/Spectral-Recovery/blob/main/CHANGELOG.md#032---2024-04-04

What's New

  • Remove compute_indices from metric/plotting, add to public API (#102)
  • Fix incorrect reference_polygons is None check (#104)

- Python
Published by szwiep about 2 years ago

spectral-recovery - v0.3.1

Changelog: https://github.com/PEOPLE-ER/Spectral-Recovery/blob/main/CHANGELOG.md#031---2024-03-19

What's New

  • Add WindowedTarget method (based on raster's focal) (#84)
  • Fix non-zero GeoDataFrame row error (#83 )
  • Fix dask_expr import error (#82 )
  • Change "unrecovered" Y2R values to -9999 (#56)
  • Reintroduce RRI as available metric (#93)

- Python
Published by szwiep about 2 years ago

spectral-recovery - v0.3.0

Changelog: https://github.com/PEOPLE-ER/Spectral-Recovery/blob/main/CHANGELOG.md#023b0---2024-02-02

What's New

  • Use Spyndex to compute indices (#64)
  • API overhauled to be function-forward:
    • Add compute_metrics function (#72).
    • Add plotspectraltrajectory function (#72).
    • Add readrestorationpolygon and readreferencepolygon function (#72).
  • Rename readandstacktifs to readtimeseries (#72).
  • Take restoration/reference dates from vector files (#70).
  • Speed up plotting (#66).
  • Bring CLI up-to-date (#74).
  • Remove use of platform parameter (#73)

Example Usage

```python import spectral_recovery as sr

timeseries = sr.readtimeseries("tifs/", bandnames={1:"red", 2:"nir", 3:"swir16"}) polygons = sr.readrestorationpolygons("polygons.gpkg") # Takes dates from polygons.gpkg now!

compute metrics

metrics = sr.computemetrics( timeseriesdata=timeseries, restoration_polygon=polygons, metrics=["Y2R", "R80P"], indices=["NDVI", "NBR"], )

plot trajectories

sr.plotspectraltrajectory( timeseriesdata=timeseries, restorationpolygon=polygons, indices=["NDVI", "NBR"], ) ```

- Python
Published by szwiep about 2 years ago

spectral-recovery - v0.2.3b0

Changelog: https://github.com/PEOPLE-ER/Spectral-Recovery/blob/main/CHANGELOG.md#023b0---2024-02-02

What's New

  • Expose median recovery targets methods to users, parameterize base on scale
  • Allow users to pass recovery target method to RestorationArea
  • Rename recovery_targets module to targets

Here is an example of the functionality introduced in this release:

```python import spectral_recovery as sr

medianpolygonscale = sr.targets.MedianTarget(scale="polygon") medianpixelscale = sr.targets.MedianTarget(scale="pixel")

Get recovery target at the polygon scale (default, don't need to pass this)

ra = sr.RestorationArea(..., recoverytargetmethod=medianpolygonscale)

or, get recovery target at the pixel scale

ra = sr.RestorationArea(..., recoverytargetmethod=medianpixelscale)

```

- Python
Published by szwiep over 2 years ago

spectral-recovery - v0.2.2-beta.2

Changelog: https://github.com/PEOPLE-ER/Spectral-Recovery/blob/main/CHANGELOG.md#022b2---2024-02-11

What's New

  • Fix incorrect Y2R values bug (#42)
  • Historic vs. reference target details in overview (#47)

- Python
Published by szwiep over 2 years ago

spectral-recovery - v0.2.1-beta.2

Changelog: https://github.com/PEOPLE-ER/Spectral-Recovery/blob/main/CHANGELOG.md#021b2---2024-02-01

What's New

  • Support for Sentinel-2 Imagery.
  • Core functions are now accessible through the spectral_recovery module (e.g sr.compute_indices(...))
  • Add Method for plotting/visualizing a RestorationArea's spectral trajectory
  • Allow string inputs in place of datetime objects.
  • Allow NumPy computations as well as Dask.
  • Fixed incorrect NDII index computation.
  • Fixed incorrect multi-dimensional recovery target.

- Python
Published by szwiep over 2 years ago