FIREDpy
Classifying fire events from the Collection 6 MODIS Burned Area Product.
https://github.com/earthlab/firedpy
Category: Biosphere
Sub Category: Wildfire
Keywords from Contributors
climate climate-data maca macav2 projection spatial-data environmental-justice esil hyperspectral imaging-spectroscopy
Last synced: about 12 hours ago
JSON representation
Repository metadata
A Python Command Line Interface for classifying fire events from the Collection 6 MODIS Burned Area Product.
- Host: GitHub
- URL: https://github.com/earthlab/firedpy
- Owner: earthlab
- License: mit
- Created: 2019-10-10T20:54:12.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-11-13T05:02:19.000Z (6 months ago)
- Last Synced: 2025-04-17T22:44:37.496Z (10 days ago)
- Language: Python
- Homepage:
- Size: 459 MB
- Stars: 40
- Watchers: 10
- Forks: 20
- Open Issues: 24
- Releases: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
README.md
FIREDpy - FIRe Event Delineation for python
A Python Command Line Interface for classifying fire events from the Collection 6 MODIS Burned Area Product.
This package uses a space-time window to classify individual burn detections from late 2001 to near-present into discrete events and return both a data table and shapefiles of these events. The user is able to specify the spatial and temporal parameters of the window, as well as the spatial and temporal extent, using either a shapefile or a list of MODIS Sinusoidal Projection tile IDs. Shapefiles include full event polygons by default, and the user has the option of having firedpy produce daily-level perimeters, providing a representation of both final and expanding event perimeters.
Any area from the world may be selected. However, in the current version, memory constraints may limit the extent available for a single model run. Equatorial regions have much more fire activity, and may require much more RAM to process than a normal laptop will have.
More methodological information is at:
Balch, J. K., St. Denis, L. A., Mahood, A. L., Mietkiewicz, N. P., Williams, T. P., McGlinchy J,
and Cook, M. C. 2020. FIRED (Fire Events Delineation): An open, flexible algorithm & database
of U.S. fire events derived from the MODIS burned area product (2001-19). Remote
Sensing, 12(21), 3498; https://doi.org/10.3390/rs12213498
Description of the country-level data sets is at:
Mahood, A.L. Lindrooth, E.J., Cook, M.C. and Balch, J.K. Country-level fire perimeter datasets (2001-2021). 2022. Nature Scientific Data, 9(458). https://doi.org/10.1038/s41597-022-01572-3
BUG ALERT:
Many of the data products created in Fall 2021 may be shifted by a half pixel, and may lack a coordinate reference system.
The problem is now fixed, so this will not affect new iterations of firedpy. We created a script, R/posthoc_fixes.R that contains a function to fix either or both of these problems.
Sometimes the server (fuoco.geog.umd.edu) that houses the MCD64A1 product used by firedpy is down. If this happens, you just need to wait until it comes back up.
See the issues tab for more bugs, or to report a new bug!
Have you used firedpy?
The algorithm and derived data products are under active development. Please take this survey to help us improve firedpy.
Current status of created products
Already-created products are linked below. They are housed in the CU Scholar data repository in the Earth Lab Data collection, or here.
All of the created products have an event-level shapefile in .gpkg and .shp formats. Many countries also have the daily-level shapefile, but these were not created for most countries in Africa and Asia due to computational restrictions.
Click on a link below to download a fire perimeter dataset for your favorite country
North America
- Coterminous USA + Alaska
- US plus Canada
- Canada
- Hawaii
- Carribean (Barbados, Bahamas, Cayman Islands, Cuba, Dominican Republic, Haiti, Jamaica, Montserrat, Puerto Rico, Saint Kitts And Nevis, Trinidad And Tobago, British Virgin Islands, Guadeloupe, Saint Barthelemy)
- Mexico and Central America (Belize, Guatemala, Honduras, El Salvador, Nicaragua, Costa Rica, Panama)
South America
- Bolivia
- Argentina
- Northern South America (Suriname, French Guiana, Guyana)
- Chile
- Uruguay
- Brazil
- Peru
- Colombia
- Ecuador
- Venezuela
- Paraguay
Europe
- Northern Europe (Iceland, Sweden, Norway, and Denmark)
- Poland
- Finland
- Russia
- Italy
- Spain & Portugal
- Western Europe (France, Germany, Poland, Switzerland, Belgium, Netherlands, Luxembourg and Austria)
- Central to Southern Europe (Estonia, Latvia, Lithuania, Belarus, Ukraine, Czech Republic, Slovakia, Hungary, Romania, Bulgaria, Montenegro, Bosnia, Turkey, Republic Of Moldova, Serbia, Albania, Slovenia, and North Macedonia)
- Greece
- UK and Ireland
Africa
- Angola
- Benin
- Botswana
- Burundi
- Burkina Faso
- Cameroon
- Central North Africa (Libya, Algeria, Tunisia)
- Chad
- Central African Republic
- Democratic Republic of the Congo
- Djibouti
- Equatorial Guinea
- Eritrea
- eSwatini
- Ethiopia
- Gabon
- The Gambia
- Ghana
- Guinea
- Guinea-Bissau
- Ivory Coast
- Kenya
- Lesotho
- Liberia
- Madagascar
- Malawi
- Mali
- Mauritania
- Morocco
- Mozambique
- Namibia
- Niger
- Nigeria
- Republic of the Congo
- Rwanda
- Senegal
- Sierra Leone
- Somalia
- Somaliland
- South Africa
- South Sudan
- Sudan
- Tanzania
- Togo
- Uganda
- Zambia
- Zimbabwe
Asia
- China
- India
- Central Asia (Turkmenistan, Kazakhstan, Uzbekistan, Kyrgystan, Tajikistan, Afghanistan, and Pakistan)
- Middle East (Saudi Arabia, Qatar, Oman, Yemen, United Arab Emirates, Iraq, Jordan, Syria, Israel, Palestine, Lebanon, Egypt)
- Mongolia
- Caucasus (Armenia, Azerbaijan, Georgia)
- Japan
- South Korea
- North Korea
- Taiwan
- Sri Lanka
- Nepal
- Bhutan
- Bangladesh
- Vietnam
- Thailand
- Laos
- Myanmar
Australia (state by state)
- Tasmania
- Victoria
- New South Wales + Capital Territory
- Queensland
- South Australia
- Western Australia
- Northern Territory
Oceania
Installation
There are two ways to install firedpy. Method one is to run it out of a docker container, Method 2 is to install locally.
Method 1. Run from a Docker Container:
1.1 Get the docker container running:
Note, the docker container has changed from earthlab/firedpy
to earthlabcu/firedpy
-
docker run -t -d earthlabcu/firedpy
-
Call
docker ps
to get the name of the docker container you just created. -
Then get into the docker container by running docker exec:
docker exec -it <silly_name> /bin/bash
-
Then you will be inside of the docker container in the firedpy directory. Now, enter:
conda activate firedpy
And the environment is ready to use.
1.2 Copy firedpy outputs to your local machine
After creating a new fire product, it might be useful to get it out of the docker container in order to use it.
-
First, exit the docker container by typing
exit
-
Second, copy the file out. Here we will use the example of a container with the name "unruffled_clarke". The
docker cp
command uses the syntaxdocker cp <source> <destination>
. Files inside of a docker container will have a prefix of the docker container name (or container ID) followed by a colon, then with a normal path.Here is an example command using the container name:
docker cp unruffled_clarke:/home/firedpy/proj/outputs/shapefiles/fired_events_s5_t11_2020153.gpkg /home/Documents/fired_events_s5_t11_2020153.gpkg
Another example command using the container ID:
docker cp fa73c6d3e007:/home/firedpy/proj/outputs/shapefiles/fired_events_s5_t11_2020153.gpkg /home/Documents/fired_events_s5_t11_2020153.gpkg
Method 2. Local Installation Instructions:
-
Clone this repository to a local folder and change directories into it:
git clone https://github.com/earthlab/firedpy.git
cd firedpy
-
Ensure your anaconda setup has conda-forge, channel_priority set to strict, and update your conda.
conda update conda --yes
conda config --add channels conda-forge
conda config --set channel_priority strict
-
You must have all packages listed in the environment.yaml installed using 'conda install -c conda-forge <package_name>'
-
Create and activate a conda environment:
conda env create -f environment.yaml
conda activate firedpy
-
Install locally:
python setup.py install
Use:
-
Run firedpy with no options to be prompted with input questions for each option/attribute
firedpy
-
Or use the following commands in your command line to specify the options/attributes you would like:
-
In your terminal use this command to print out the available options and their descriptions:
firedpy --help
-
Run firedpy with the default option to download required data and write a data table of classified fire events to a temporary directory. This uses CONUS as the default area of interest with a spatial parameter of 5 pixels (~2.3 km) and 11 days:
firedpy --default
-
Change the spatial and temporal parameters of the model run:
firedpy -spatial 6 -temporal 10
-
Specify specific tiles and a local project_directory for required data and model outputs:
firedpy -spatial 6 -temporal 10 -aoi h11v09 h12v09 -proj_dir /home/<user>/fired_project
-
Write shapefiles as outputs in addition to the data table:
firedpy -spatial 6 -temporal 10 -aoi h11v09 h12v09 -proj_dir /home/<user>/fired_project --shapefile
-
Add the most common level 3 Ecoregion as an attribute to each event:
firedpy -spatial 6 -temporal 10 -aoi h11v09 h12v09 -proj_dir /home/<user>/fired_project --shapefile -ecoregion_level 3
-
Add landcover information and produce the daily burn file
firedpy -spatial 6 -temporal 10 -aoi h11v09 h12v09 -proj_dir /home/<user>/fired_project --shapefile -ecoregion_level 3 -landcover_type 1 -daily yes
For more information about each parameter, use:
'firedpy --help'
Parameter table (under construction)
parameter | value(s) | example | description |
---|---|---|---|
-spatial | integer | -spatial 5 | pixel radius for moving window, defaults to 5 |
-temporal | integer | -temporal 11 | day radius for moving window, defaults to 11 |
-aoi | character (MODIS tile) | -aoi h11v09 | which modis tiles should be used |
-aoi | character (shapefile) | -aoi /home/firedpy/individual_countries/canada.gpkg | figures out which modis tiles to download based on the polygon -- polygon must be in the same projection as MODIS MCD64 -- all the polygons in the ref folder are correctly projected and can be used as crs templates to prepare other polygons. |
-proj_dir | character | -proj_dir /home/firedpy/proj | which directory should firedpy operate within? Defaults to a folder called "proj" within the current working directory. |
-ecoregion_type | character | -ecoregion_type na | type of ecoregion, either world or na |
-ecoregion_level | integer | -ecoregion_level 3 | if ecoregion type = na, the level (1-3) of North American ecoregions |
-landcover_type | integer and character | -landcover_type 2:username:password | number (1-3) corresponding with a MODIS/Terra+Aqua Land Cover (MCD12Q1) category. You will need to also make an account at https://urs.earthdata.nasa.gov/home and include your login information within the argument. |
-shp_type | character | -shp_type gpkg | option to build a shapefile for the fired event in gpkg, ESRI shapefile (shp), both, or none |
-file | character | -file fired_colorado | specifies the base of the file name for the tables and shapefile outputs, defaults to "fired", in the format: "(-file aruguement)toYYYYDDD(either events or daily).gpkg", with YYYY being the year, and DDD being the julian day of the last month in the time series. The example would output fired_colorado_to2021031_events.gpkg. |
-daily | character (yes or no) | -daily yes | creates daily polygons, if no just the event-level perimeters will be created. Defaults to no. |
-start_yr | integer | -start_yr 2001 | gets the hdf files from the MODIS tiles starting in this year. The first year avalible is 2001 |
-end_yr | integer | -end_yr 2021 | gets the hdf files from the MODIS tiles ending in this year. The last year avalible is 2021 |
Boundary files are available for use as areas of interest
- Country boundaries are in ref/individual_countries
- Continent boundaries are in ref/continents
- United States state boundaries for the United States of America are in ref/us_states
- Australian state boundaries are in ref/australian_states
- For example
firedpy -aoi /home/firedpy/ref/us_states/colorado.gpkg
, and so on. Every space is a '_'. - If using the user input option, when prompted for the name of the continent, country, or state use "_" for spaces.
- Ensure that the input shapefiles are in the modis sinusiodal projection
How to update the docker container
- step 0.1. install docker (go to the docker website for OS-specific instructions.)
- step 0.2. get a dockerhub account
- step 1. login to docker hub via the command line
docker login
orsudo docker login
- step 2. get the existing docker image set up
- docker run -t -d earthlab/firedpy
- step 3. update from github
- git pull
- step 4. build the docker container
docker build -t earthlab/firedpy:latest .
- step 5. ENSURE THE SOFTWARE STILL WORKS BEFORE PUSHING
firedpy -aoi /home/firedpy/ref/individual_countries/samoa.gpkg
- step 6. push it up to dockerhub
docker push earthlab/firedpy:latest
Owner metadata
- Name: Earth Lab
- Login: earthlab
- Email:
- Kind: organization
- Description: Capitalizing on the data deluge to accelerate science
- Website: https://www.earthdatascience.org/
- Location: Boulder, Colorado, USA
- Twitter: EarthLabCU
- Company:
- Icon url: https://avatars.githubusercontent.com/u/19476722?v=4
- Repositories: 58
- Last ynced at: 2023-03-01T01:55:24.593Z
- Profile URL: https://github.com/earthlab
GitHub Events
Total
- Issues event: 4
- Watch event: 5
- Issue comment event: 2
- Push event: 17
- Create event: 1
Last Year
- Issues event: 4
- Watch event: 5
- Issue comment event: 2
- Push event: 17
- Create event: 1
Committers metadata
Last synced: 5 days ago
Total Commits: 565
Total Committers: 12
Avg Commits per committer: 47.083
Development Distribution Score (DDS): 0.46
Commits in past year: 66
Committers in past year: 3
Avg Commits per committer in past year: 22.0
Development Distribution Score (DDS) in past year: 0.379
Name | Commits | |
---|---|---|
Adam Mahood | a****d | 305 |
Erick Verleye | e****5@c****u | 80 |
EllieLindrooth | 5****h | 76 |
maxwellCcook | m****k@c****u | 35 |
williamstravis | t****s@c****u | 31 |
Travis Williams | T****s@c****u | 24 |
Max Joseph | m****h@g****m | 6 |
Joe McGlinchy | j****y@c****u | 2 |
Erick Verleye | 3****r | 2 |
Travis Williams | t****s@n****v | 2 |
Erick Verleye | e****5@c****u | 1 |
Lise Ann St Denis, PhD | l****s@c****u | 1 |
Committer domains:
Issue and Pull Request metadata
Last synced: 1 day ago
Total issues: 83
Total pull requests: 15
Average time to close issues: 3 months
Average time to close pull requests: 15 minutes
Total issue authors: 12
Total pull request authors: 4
Average comments per issue: 2.28
Average comments per pull request: 0.27
Merged pull request: 14
Bot issues: 0
Bot pull requests: 0
Past year issues: 5
Past year pull requests: 3
Past year average time to close issues: about 8 hours
Past year average time to close pull requests: 12 minutes
Past year issue authors: 3
Past year pull request authors: 1
Past year average comments per issue: 4.8
Past year average comments per pull request: 0.0
Past year merged pull request: 3
Past year bot issues: 0
Past year bot pull requests: 0
Top Issue Authors
- admahood (63)
- mikoontz (4)
- maxwellCcook (3)
- ChangpeiHe (3)
- EllieLindrooth (2)
- DrWKID (2)
- lwasser (1)
- ozjimbob (1)
- mbjoseph (1)
- NPriyankaDS (1)
- shawnmiaomiao (1)
- pamu5248 (1)
Top Pull Request Authors
- maxwellCcook (8)
- Ckster (4)
- mbjoseph (2)
- WilliamsTravis (1)
Top Issue Labels
- enhancement (19)
- bug (7)
Top Pull Request Labels
Dependencies
- continuumio/miniconda3 4.6.14 build
Score: 6.643789733147672