Commit 4bf6f38a authored by Tilmann Sager's avatar Tilmann Sager
Browse files

Added README.md // sample data folders + output examples

parent 42431013
# Contraildetect
Detecting contrails on MODIS satellite imagery with Hough transformation.
## Dependencies
- Python >= 3.8
- Conda
## Quick Start
1. Create conda environment and install requirements:
```shell
conda create --name contraildetect_env python=3.9 --file requirements.txt
```
2. Activate environment:
```shell
conda activate contraildetect
```
3. Change the parameters in `config.ini` to your needs.
4. Place HDF files according your settings in `config.ini`.
5. Place flight files according your settings in `config.ini`.
6. (optional) Check the flight files for errors:
```shell
python scripts/repair_flight_csv.py
```
8. Run contraildetect:
```shell
python main.py
```
## Folder structure
```shell
.
├── data/ input and output data
...├── granules/
......├── MODTBGA/
.........MODTBGA...hdf satellite images as hdf
...├── flights/
......├── processed/ filtered flights per granule as csv
......├── raw/ raw flights file as csv
├── analysis analysis methods
├── common config, logger, constants, ...
├── detection hough, labelling, cleaning, block splitting
├── extraction file extraction operations for hdf/csv
├── plot plotting
├── preprocessing Contrail Detection Algorithm
├── scripts useful scripts to run alone
├── config.ini configuration
```
## Configuration
```ini
[general]
multiprocessing = 1 # multiprocessing: true (1) or false (0). If true, cores - 2 will be used
limit = 0 # limit the number of hdf files to be processed (will take the first ones)
[path]
hdf = ../data/granules # root directory hdf products
flights = ../data/flights # root directory for flights
output = ../data/output # root directory for results (will create a folder per run)
[product]
name = MODTBGA # name of the product to be used, also the name for subdir of granules/
bands = 31, 32 # bands to extract
11um = 31 # band at 11um to perform BTD
12um = 32 # band at 12um to perform BTD
band_keyword = BAND # keyword for band extraction from hdf files
band_suffix = _1 # suffix for bands that have to be filtered
[preprocessing]
norm_interval = 100 # norm the image from 0 to ...
gauss_kernel_size = 5 # kernel size for Gauss filter
k = 0.1 #
order = 0
sigma = 0.35
[detection]
method = straight # hough method to be used (straight, probabilistic)
min_px_size = 150 # filter objects smaller than this size in pixel
connectivity = 2 # define connectivity
split_by = 6 # number of blocks per row or per column
threshold = 70 # threshold in percent
postprocess = 0 # do postprocessing with probabilistic hough transformation
ratio_threshold = 5 # threshold for line type segments
[straight]
threshold = 0.5 # threshold for straight hough transformation
[probabilistic]
line_length = 150 # line length to be used
line_gap = 3 # line gap
filter = canny # edge detection (canny, scharr)
sigma = 2 # sigma for canny edge detection
[plot]
world_map = ../data/maps/ne_10m_admin_0_countries/ne_10m_admin_0_countries.shp
```
[general]
multiprocessing = 1
limit = 0
limit = 5
[product]
name = MODTBGA
......
{"num_processed": 6, "limit": 0, "hdf_dir": "../data/granules/MODTBGA", "flight_raw_dir": "../data/flights/raw", "flight_proc_dir": "../data/flights/processed", "output_dir": "../data/output/20210713-1514", "bands": [31, 32], "11um": 31, "12um": 32, "band_key": "BAND", "band_suffix": "_1", "cda_norm_interval": 100, "cda_kernel_size": 5, "cda_k": 0.1, "cda_order": 0, "cda_sigma": 0.35, "detect_method": "straight", "detect_max_px_size": 150, "detect_connectivity": 2, "detect_split_by": 6, "detect_threshold": 70, "detect_postprocess": false, "detect_ratio_threshold": 5, "prob_line_length": 150, "prob_line_gap": 3, "prob_sigma": 2, "prob_filter": "canny", "straight_threshold": 0.5, "world_map": "../data/maps/ne_10m_admin_0_countries/ne_10m_admin_0_countries.shp"}
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment