Skip to content

Commit c51878f

Browse files
committed
added images and modified the readme
1 parent 55aef9a commit c51878f

File tree

5 files changed

+56
-7
lines changed

5 files changed

+56
-7
lines changed

README.md

+49
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,52 @@
33

44
![FIREDpy - NRT - Page 2](https://github.com/earthlab/FIREDpy-NRT/assets/67020853/e56abc54-99d4-490a-ade0-994b63c8fbfb)
55
Project funded by NASA Applied Sciences Program and developed by ESOC and Earth Lab, CIRES - CU Boulder
6+
7+
8+
## Fist Stage (Summer 2023)
9+
### Done by [Behzad Vahedi](mailto:[email protected])
10+
11+
Our project aims to extende the EarthLab’s "Fire Event Delineation for Python (FIREDpy)" library by updating it for Near-Real-Time (NRT) fire event perimeter mapping through the fusion of optical and radar remote sensing data. Our main motivations are twofold: to achieve closer-to-real-time temporal resolution and to improve the spatial resolution of the FIREDpy outputs.
12+
13+
In the first stage of the project, we focused on answering two questions:
14+
- Is applying BRDF correction necessary to generated NRT fire perimeters?
15+
- How does fire affect the signal in Sentinel-2 and Landsat-8 images and how do these satellites compare?
16+
17+
### BERDF Correction
18+
The flowchart below demonstrates the steps I took to answer the first question, with the caveat that I only tested BRDF on Sentinel-2 images (using the Sen2nbar package) since I couldn't find any python implementation of this correction for Landsat images.
19+
20+
<img src="./images/Flowchart.jpg" width=800>
21+
22+
__Now, let's go through the different steps in the flowchart__
23+
24+
The steps in the first row of this flowchart are done using the [FiredPy](https://github.com/earthlab/firedpy) package. This resulted in a shapefile of 20 fire events in the Americas which you can find in the [fire_events](./fire_events/) folder.
25+
26+
Once the fire events are extracted, you need to __get pre- and post-fire image pairs__ for each event. This is done using the [optical_scenes.py](./scripts/optical_scenes.py) script. This script uses the footprint of the fire as well as its start and end date to search for optical images. It can download the images and/or save their footprints. You can run this script using the command below:
27+
28+
`python optical_scenes.py --event_id "202" --satellite "sentinel"`
29+
30+
or alternatively,
31+
32+
`python optical_scenes.py -id "202" -s "sentinel"`
33+
34+
In these commands, the value of the `event_id` (or `id`) argument must be the ID of the fire event for which satellite images are to be searched. This comes from the id field of the [fire events shapefile](./fire_events/Fire_events.zip). The value of the `satellite` (or `s`) argument must be the name of the satellite, either "sentinel" or "landsat".
35+
36+
You can set or change the search criteria in the `config.py` file. These parameters are:
37+
- `max_cloud_cover`: Maximum cloud cover percentage. default: 40%.
38+
- `delta_days_landsat`: The number of days to use as a buffer before and after the fire event when searching for Landsat images. default: 70 days.
39+
- `delta_days_sentinel`: The number of days to use as a buffer before and after the fire event when searching for Sentinel-2 images. default: 40 days.
40+
- `download_scenes`: Whether to download images or not. default: False. __CAUTION: depending on the number of the images found, this could take a long time and might reqiure a huge amount of storage__
41+
- `save_footprints`: Whether to save image footprints or not. default: False.
42+
- `update_json`: deprecated.
43+
- `data_dir`: The directory where the images and/or their footprints will be saved. See below for more information.
44+
45+
#### Directory Organization
46+
`data_dir` is the directory where the you would want the images to be saved. Once you create this directory, extract (unzip) the `Fire_events.zip` there. This will (should) create a new subdirectory called Fire_events. Per each fire id you run the `optical_scenes.py` script for, a new subdirectory will be created within "Fire_events". Also, depending on what the `-s` parameter is, the corresponding subdirectory will be created within the fire_id folder where the footprints and images will be saved.
47+
48+
<img src="./images/directory_tree.png" width="300">
49+
50+
51+
#### Important Note:
52+
Before running the `optical_scenes.py` script, you should create separate accounts for Landsat and Sentinel API and set your username and password in the corresponidng variables in the `config.py` file.
53+
54+
### Optical Signal Evaluation

fire_events/Fire_events.zip

643 KB
Binary file not shown.

images/Flowchart.jpg

250 KB
Loading

images/directory_tree.png

80 KB
Loading

scripts/config.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,28 @@ class Config():
55
def __init__(self):
66
# [credential_landsat]
77
# landsat API
8-
self.username_landsat = "behzad69"
9-
self.password_landsat = "Realeblis@69"
8+
self.username_landsat = "YOUR_USERNAME"
9+
self.password_landsat = "YOUR_PASSWORD"
1010

1111

1212
# [credential_sentinel]
1313
# Copernicus Open Access Hub (SciHub) username and password
14-
self.username_sentinel = "behzadseaice"
15-
self.password_sentinel = "lion15th"
14+
self.username_sentinel = "YOUR_USERNAME"
15+
self.password_sentinel = "YOUR_PASSWORD"
1616

1717
# [params]
1818
self.max_cloud_cover = 40
1919
self.delta_days_landsat = 70
20-
self.delta_days_sentinel = 20
20+
self.delta_days_sentinel = 40
2121
# Sentinel-2: S2MSI2A,S2MSI1C, S2MS2Ap
2222
self.producttype_sentinel = "S2MSI2A"
2323

24-
# [directory]
25-
self.data_dir = os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..', 'data')) # ("../data/")
2624
# whether to download the scenes or not
2725
self.download_scenes = False
2826
self.save_footprints = True
2927
self.update_json = False
28+
# [directory]
29+
self.data_dir = os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..', 'data')) # ("../data/")
3030

3131
if os.name == 'nt': # Windows
3232
self.dir_sep = '\\'

0 commit comments

Comments
 (0)