Skip to content

Commit

Permalink
chore(release) : release 0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasK committed Dec 15, 2023
1 parent d0c9806 commit a76bef8
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 15 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Auth datacube `earthdaily.earthdatastore.Auth().datacube(...)` function now manage multiple collections.
- Uses `fields` to query only assets asked over Skyfox/EDS (enhance performance).

### Changed

- `asset_mapper` has now all assets from available collections.

## [0.0.1-rc9] - 2023-12-12

### Added
Expand Down
8 changes: 4 additions & 4 deletions examples/field_evolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@
datetime=["2022-07-01", "2022-08-31"],
assets=["red", "green", "blue"],
mask_with="ag_cloud_mask",
# mask_statistics=True, # as you ask `clear_cover`it will force computing mask_statistics
clear_cover=50,
resampling="cubic",
cross_calibration_collection="sentinel-2-l2a")
)

pivot_cube.clear_percent.plot.scatter(x="time")

##############################################################################
# Plots cube with SCL with at least 50% of clear data
# ----------------------------------------------------
pivot_cube = pivot_cube.load()
pivot_cube.to_array(dim="band").plot.imshow(vmin=0, vmax=0.4, col="time", col_wrap=3)
pivot_cube.to_array(dim="band").plot.imshow(
vmin=0, vmax=0.4, col="time", col_wrap=3
)

plt.title("Clear cover percent with SCL")
plt.title("Pivot evolution with SCL masks")
Expand Down
5 changes: 3 additions & 2 deletions examples/first_steps_create_datacube.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@
s2_datacube.clear_percent.plot.scatter(x="time")
plt.title("Percentage of clear pixels on the study site")
plt.show()
print(s2_datacube)

s2_datacube[["red", "green", "blue"]].to_array(dim="band").plot.imshow(
vmin=0, vmax=0.2, col="time", col_wrap=4
Expand All @@ -57,7 +56,9 @@
# Request items

items = eds.search(
"sentinel-2-l2a", intersects=geometry, datetime=["2022-08-01", "2022-08-09"]
"sentinel-2-l2a",
intersects=geometry,
datetime=["2022-08-01", "2022-08-09"],
)

###########################################################
Expand Down
34 changes: 25 additions & 9 deletions examples/multisensors_cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
# -------------------------------------------

eds = earthdatastore.Auth()
collections = ['sentinel-2-l2a','landsat-c2l2-sr']
datetime = ['2022-07-01','2022-09-01']
collections = ["sentinel-2-l2a", "landsat-c2l2-sr"]
datetime = ["2022-07-01", "2022-09-01"]
intersects = datasets.load_pivot_corumba()
assets = ["blue","green","red","nir"]
assets = ["blue", "green", "red", "nir"]
mask_with = "ag_cloud_mask"
clear_cover = 50
resampling = "cubic"
Expand All @@ -32,24 +32,40 @@
# Create the multisensors datacube
# -------------------------------------------

datacube = eds.datacube(collections,assets=assets, datetime=datetime,intersects=intersects, mask_with=mask_with, clear_cover=clear_cover, cross_calibration_collection=cross_calibration_collection)
datacube = eds.datacube(
collections,
assets=assets,
datetime=datetime,
intersects=intersects,
mask_with=mask_with,
clear_cover=clear_cover,
cross_calibration_collection=cross_calibration_collection,
)

# Add the NDVI
datacube['ndvi'] = (datacube['nir']-datacube['red'])/(datacube['nir']+datacube["red"])
datacube["ndvi"] = (datacube["nir"] - datacube["red"]) / (
datacube["nir"] + datacube["red"]
)

# Load in memory
# Load in memory
datacube = datacube.load()

##############################################################################
# See the evolution in RGB
# -------------------------------------------

datacube[['red','green','blue']].to_array(dim="band").plot.imshow(col='time',col_wrap=3,vmax=0.2)
datacube[["red", "green", "blue"]].to_array(dim="band").plot.imshow(
col="time", col_wrap=3, vmax=0.2
)
plt.show()

##############################################################################
# See the NDVI evolution
# -------------------------------------------

datacube['ndvi'].plot.imshow(col='time',col_wrap=3,vmin=0, vmax=0.8, cmap="RdYlGn");plt.show()
datacube['ndvi'].groupby('time').mean(...).plot(x="time");plt.plot()
datacube["ndvi"].plot.imshow(
col="time", col_wrap=3, vmin=0, vmax=0.8, cmap="RdYlGn"
)
datacube["ndvi"].groupby("time").mean(...).plot.line(x="time")
plt.title("NDVI evolution")
plt.show()

0 comments on commit a76bef8

Please sign in to comment.