Skip to content

Commit

Permalink
v0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
vitusbenson committed Mar 17, 2023
1 parent af163e2 commit ea3acdd
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 4 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,24 @@ emc.plot_rgb(mc)
See `notebooks/example.ipynb` for a more detailed usage example.



## Data Providers

The minicuber is centered around the concept of data providers, which wrap a data source and handle data loading of that source. The `emc.Minicuber` class then manages these data providers, by telling them the spatio-temporal range for which data needs to be loaded and afterwards re-gridding all data to a common reference frame (UTM grid).

### Sentinel 2

The Sentinel 2 provider loads and processes Copernicus Sentinel 2 imagery.

Kwargs:
- `bands`: choose any subset from `["B01", "B02", "B03", "B04", "B05", "B06", "B07", "B08", "B8A", "B09", "B11", "B12", "WVP", "AOT", "SCL"]`.
- `aws_bucket`: We currently support data loading from three cloud buckets: Microsoft Planetary Computer (`"planetary_computer"`), Element84 AWS bucket (`element84`) and DigitalEarthAfrica AWS bucket (`dea`). We recommend using the Microsoft planetary computer with the keyword argument `aws_bucket = "planetary_computer"`.
- `best_orbit_filter`: Sentinel 2 has a regular overpass frequency of 5 days. However, sometimes it can be smaller due to off-nadir captures. Such captures change the viewing angle of the scene. If `True`, this filter finds the best orbit and then only returns imagery from a regular 5-daily cycle.
- `five_daily_filter`: If `True` returns a regular 5-daily cycle starting with the first date in `full_time_interval`. It has no effect, if `best_orbit_filter` is used.
- `brdf_correction`: If `True`, does BRDF correction based on the Sentinel 2 Metadata (illumination angles).
- `cloud_mask`: If `True`, creates a cloud and cloud shadow mask based on deep learning. It automatically finds the best available cloud mask for the requested `bands`.


## Installation

Prerequisites (We use an Anaconda environment):
Expand Down
2 changes: 1 addition & 1 deletion earthnet_minicuber/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""EarthNet Minicuber"""

__version__ = "0.1.0"
__version__ = "0.1.1"
__author__ = "Vitus Benson"


Expand Down
4 changes: 2 additions & 2 deletions earthnet_minicuber/provider/s2/sentinel2.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

class Sentinel2(provider_base.Provider):

def __init__(self, bands = ["AOT", "B01", "B02", "B03", "B04", "B05", "B06", "B07", "B08", "B8A", "B09", "B11", "B12", "WVP"], best_orbit_filter = True, five_daily_filter = False, brdf_correction = True, cloud_mask = True, aws_bucket = "dea", s2_avail_var = True):
def __init__(self, bands = ["AOT", "B01", "B02", "B03", "B04", "B05", "B06", "B07", "B08", "B8A", "B09", "B11", "B12", "WVP"], best_orbit_filter = True, five_daily_filter = False, brdf_correction = True, cloud_mask = True, aws_bucket = "planetary_computer", s2_avail_var = True):

self.is_temporal = True

Expand Down Expand Up @@ -213,7 +213,7 @@ def load_data(self, bbox, time_interval, **kwargs):


if self.cloud_mask:
stack = self.cloud_mask(stack)
stack = self.cloud_mask(stack.compute())

bands = stack.band.values
stack["band"] = [f"s2_{b}" for b in stack.band.values]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@


setup(name='earthnet-minicuber',
version='0.1.0',
version='0.1.1',
description="EarthNet Minicuber",
author="Vitus Benson, Christian Requena-Mesa",
author_email="[email protected]",
Expand Down

0 comments on commit ea3acdd

Please sign in to comment.