README.md 4.31 KB
Newer Older
Gencer Sümbül committed
1 2 3 4 5 6 7 8 9 10 11 12 13
BigEarthNet-tools
===========

This repository contains tools for processing the BigEarthNet Sentinel-2 Benchmark Archive. For the detailed explanation about the archive and downloading the archive, you can visit the website of the BigEarthNet, [http://bigearth.net/](http://bigearth.net/).

* Tools are written in Python at the moment.
* All the codes are tested in Python 2.7 and 3.5 on Ubuntu 16.04 at the moment.
* To use the tools, you may need to first download the archive and/or the lists of image patches with seasonal snow and cloud&shadow from the website. 


List of Tools and How to Use Them
-----
 
Gencer Sümbül committed
14
#### Python script to read Sentinel-2 image patches in the BigEarthNet ([read_patch.py](https://gitlab.tubit.tu-berlin.de/rsim/bigearthnet-tools/blob/master/scripts/read_patch.py))
Gencer Sümbül committed
15 16 17 18 19 20 21 22 23 24 25 26 27 28

This script reads GeoTIFF files each of which is for one spectral band of a Sentinel-2 image patch in the BigEarthNet Archive. The script is capable of reading either all spectral bands of one patch folder (-p option) or all bands for all patches (-r option). After reading files, Sentinel-2 image patch values can be used as numpy array for further purposes. 

* Examples:

```
python read_patch.py -p BigEarthNet-v1.0/S2A_MSIL2A_20171104T095201_5_43/
python read_patch.py -r BigEarthNet-v1.0/
```

* Requirements for running:

The BigEarthNet archive should be downloaded first. Either [GDAL](https://pypi.org/project/GDAL/) or [rasterio](https://github.com/mapbox/rasterio/) package should be installed. To use the resulting pixel values of patches, [NumPy](http://www.numpy.org/) package can also be installed. 

Gencer Sümbül committed
29
#### Python script to eliminate Sentinel-2 image patches with high density snow/shadow/cloud in the BigEarthNet ([eliminate_snowy_cloudy_patches.py](https://gitlab.tubit.tu-berlin.de/rsim/bigearthnet-tools/blob/master/scripts/eliminate_snowy_cloudy_patches.py)) 
Gencer Sümbül committed
30 31 32 33 34 35

This script eliminates patches with seasonal snow cover and/or cloud&shadow cover from the BigEarthNet Archive while reading the GeoTIFF files. The script is capable of eliminating patches with either seasonal snow cover list (-s option) or cloud&shadow cover list (-c option) or both of them together (-e) while reading patches of the BigEarthNet. For the patch lists, it accepts csv files, which can be downloaded from the BigEarthNet website. After reading and eliminating patches, pixel values can be used as a numpy array for further purposes.

* Examples: 

```
Gencer Sümbül committed
36 37 38
python eliminate_snowy_cloudy_patches.py -r BigEarthNet-v1.0/ -s patches_with_seasonal_snow.csv
python eliminate_snowy_cloudy_patches.py -r BigEarthNet-v1.0/ -c patches_with_cloud_and_shadow.csv
python eliminate_snowy_cloudy_patches.py -r BigEarthNet-v1.0/ -e patches_with_seasonal_snow.csv patches_with_cloud_and_shadow.csv
Gencer Sümbül committed
39 40 41 42 43 44
```

* Requirements for running:

The BigEarthNet archive and csv files for the list of patches should be downloaded first. Either [GDAL](https://pypi.org/project/GDAL/) or [rasterio](https://github.com/mapbox/rasterio/) package should be installed. To use the resulting pixel values of patches, [NumPy](http://www.numpy.org/) package can also be installed. 

Gencer Sümbül committed
45
#### Python script to extract names and download links of the Sentinel-2 Level-1C tiles that were used to create the BigEarthNet image patches ([extract_tile_names_and_links.py](https://gitlab.tubit.tu-berlin.de/rsim/bigearthnet-tools/blob/master/scripts/extract_tile_names_and_links.py)) 
Gencer Sümbül committed
46

Gencer Sümbül committed
47
This script creates a csv file whose each row contains the patch name, corresponding Sentinel-2 Level-1C tile name and tile download link. You can directly use the resulting file from [files/tile_names_and_links.csv](https://gitlab.tubit.tu-berlin.de/rsim/bigearthnet-tools/blob/master/files/tile_names_and_links.csv) without running the script.
Gencer Sümbül committed
48 49 50 51 52 53 54 55 56 57 58

* Examples: 

```
python extract_tile_names_and_links.py -r BigEarthNet-v1.0/ -u <COPERNICUS_HUB_USERNAME> -p <COPERNICUS_HUB_PASSWORD> -o tile_names_links.csv
```

* Requirements for running:

The BigEarthNet archive should be downloaded first. [sentinelsat](https://github.com/sentinelsat/sentinelsat) package should be installed to search tiles within Copernicus Open Access Hub via sentinelsat API. 

Gencer Sümbül committed
59 60 61 62
Bugs and Requests
----

If you face a bug or have a feature request, please create an issue:
Gencer Sümbül committed
63
https://gitlab.tubit.tu-berlin.de/rsim/bigearthnet-tools/issues
Gencer Sümbül committed
64 65 66 67 68 69

Authors
-------

**Gencer Sümbül**
http://www.user.tu-berlin.de/gencersumbul/