mapme-initiative / mapme.biodiversity

Efficient analysis of spatial biodiversity datasets for global portfolios
https://mapme-initiative.github.io/mapme.biodiversity/dev
GNU General Public License v3.0
33 stars 7 forks source link

Fire occurence and/or burned area #40

Closed Jo-Schie closed 2 years ago

Jo-Schie commented 2 years ago
Jo-Schie commented 2 years ago

Definition of research questions:

indicator @Ohm-Np what would be good indicators on the level of a protected areas polygon?

what would be a meaningfull indicator to estimate the damage to the vegetation/ecosystem on the level of a protected areas polygon? e.g. is FRP/sqkm a meaningfull indicator? -> what does FRP mean and how do others aggregate it? how is it used in studies by researchers in the context of conservation?

Ohm-Np commented 2 years ago

Available indicators in VIIRS active fire CSV file:

what does FRP mean and how do others aggregate it?

FRP represents the energy emitted by fire through radiative processes (i.e. the total fire intensity minus the energy dissipated through convection and conduction) over its total area. It is widely used as fire impact assessment, biomass combustion rates, fire event and fire spread. However, many studies show that this indicator is being used in combination with other variables such as fire size (patch), burned areas, landcover.

Jo-Schie commented 2 years ago

Available indicators in VIIRS active fire CSV file:

  • lattitude, longitude
  • bright_ti4 fire pixel brightness temperature on channel I4 (Kelvin)
  • scan, track
  • acq_date, acq_time
  • satellite NPP
  • instrument VIIRS
  • confidence confidence class (low, nominal, high)
  • version 1
  • bright_ti5 fire pixel brightness temperature on channel I5 (Kelvin)
  • frp fire radiative power (MW per pixel)
  • daynight D or N
  • type type attributed to thermal anomaly (0 - presumed vegetation fire: 1 - active volcano: 2 - other static land source: 3 - offshore detection)

what does FRP mean and how do others aggregate it?

FRP represents the energy emitted by fire through radiative processes (i.e. the total fire intensity minus the energy dissipated through convection and conduction) over its total area. It is widely used as fire impact assessment, biomass combustion rates, fire event and fire spread. However, many studies show that this indicator is being used in combination with other variables such as fire size (patch), burned areas, landcover.

Thanks for your clarifications. What is the difference between fire size and burned area? And where does this data come from? How do others combine it and can we combine it as well? Maybe you can add also a link to 1-2 studies so I can have a look how it is utilized...

Ohm-Np commented 2 years ago

What is the difference between fire size and burned area?

The main difference is that Fire size is measured in terms of HRR (Heat Release Rate) in kilowatts (kW) whereas burned area represents the surface which have been sufficiently affected by fire to display significant changes in the vegetation cover.

And where does this data come from? How do others combine it and can we combine it as well? Maybe you can add also a link to 1-2 studies

This study here shows the relationships between fire radiative power (frp) and fire size at global scale. I went through the data and methodology to see how they are analysing the FRP data. There is a map showing median FRP values over the globe:

median_frp

However, they used FRY database to make this map. There are two such datasets: one called FRY and another called FRY-FRP. These datasets in comparison to VIIRS active fire - have more indicators most importantly they have burned date information. Also, FRY data have some netcdf maps.

These are the indicators present in this dataset: ID, Fire ID, Minimum Burn Date, Maximum Burn Date, Mean Burn Date, Year, Number of Pixels, Number of Core Pixels, Area of the patch (ha), Core Area of the patch (ha), Perimeter, Perimeter to Area Ratio, Shape Index, Fractal Correlation Dimension, Core Area Index, Longitudinal coordinate of the center of the patch, Latitudinal coordinate of the center of the patch, Minor half-axis of the SDE (in degrees), Major and minor half-axes of the SDE (in degrees, in lonlat projection), major and minor half-axes of the SDE (in kilometers, in local flat projection), orientation of the SDE (with respect to North, clockwise, in degrees), orientation of the SDE in flat projection (with respect to North, clockwise, in degrees), eccentricity of the SDE, Ratio of SDE half axes

I also found another dataset Global Fire emissions database. The datasets are available in hdf5 format - which can be easily opened via terra and convert them to spatRaster. In this link, there is more information on the data characteristics and overview.

Here's another article which also uses FRP - in combination with satellite imageries to estimate biomass consumption.

Jo-Schie commented 2 years ago

Thanks. It seems that FRY and FRY-FRP are only available for a limited period of time. From the website description, it tells:

_"List of fire patch properties computed and associated NetCDF maps from the MCD64A1 Collection 6 (2000-2016) and the MERIS firecci v4.1 (2005-2011) BA products, COMBINED WITH MODIS FIRE RADIATIVE POWER MCD14ML"

Same holds true for the emission data-set which is available only from 1997 through 2016.

So let's stick to the VIIRS data, which is updated frequently I guess.
I have a couple of further questions:

Ohm-Np commented 2 years ago

Does VIIRS offer a proper API for their data or only the CSV files?

For the most recent data, we can download shapefiles directly via download url available to download for the last 24, 48 hours and 7 days. However, the archived data for years 2012 to 2021, they are available to download as CSVs here with lat/lon columns.

is the data from your csv files the same as offered from NASAs FIRM system which is also used by Global Forest Watch?

Yes, the download link provided above is actually from FIRMS.

How frequently are csv files updated/What is the revisit interval for VIIRS? -> i think daily correct?

Yes, the datasets are available daily (24 h) and also on 48 h or 7 days aggregate.

What is the spatial resolution of VIIRS? --> i think about 300 m correct?

375 meters to be exact

Which source offers data on burned areas?

MODIS (MCD64A1.006) offers data on burned areas. Here is the parent directory where all the rasters are located but as hdf files. The datasets are available on monthly basis from November 2000 to present. The spatial resolution is 500 meters. But, we have to login via EOSDIS Earthdata Login to access the data.

Jo-Schie commented 2 years ago

Ok. Thanks for the information again. Since there are two different data providers, I think we should focus our efforts first on the FIRMS data. If I'm not mistaken, this is also the data, that you analyzed here., so we can take advantage of existing code.

My suggestion is that the output should look like the input data, so we do not lose information and users can decide on how to aggregate the observations in their AOI later on. I am not sure on the download routines, though. It seems like that data is very large. I downloaded the global data for the past 7 days, and it already had 170k observations.

For observations older than 7 days, I guess data is only available on country level, right? So that would not enable us to focus our download on data for a specific AOI, at least without doing some manual workarounds (like finding out to which country the AOI belongs...). Correct? Or is there any other way to do so?

If not, then probably the easiest way would be to let the user specify which countries to download. So basically the user himself needs to check in which country his AOIs are, and the function then downloads and preprocesses data on country level, correct? Not sure though if that would conflict with the download ressource approach that you are currently having @goergen95 .

I also googled a bit around but did not find any R packages that offer routines for downloading and working with the FIRMS data or nasa earthdata in general. I just did a quick research so maybe you @Ohm-Np could invest an hour more to check for that (inspire ourselves how others do it or avoid duplicating great packages if any exists).

goergen95 commented 2 years ago

The spatio-temporal extent should be derived automatically for any given portfolio. In this case, that would mean that we have to match a portfolio's extent against a country database in order to download the country specific shapefiles. But remind me again, what are the reasons against the MCD64A1 product? These seem to be readily available as .hdf and also cover the temporal extent 2000 to present. File size is ~3MB per tile and we could easily match the spatio-temporal extent of a portfolio to only download relevant tiles...

Ohm-Np commented 2 years ago

Here's a small example on how to get active fire resource and process the indicator. Assuming user will provide year and country name as arguments.

# Active fire points - processing

# load libraries
library(sf)
#> Linking to GEOS 3.8.0, GDAL 3.0.4, PROJ 7.0.0; sf_use_s2() is TRUE
library(terra)
#> terra 1.5.21
library(mapme.biodiversity)

# download function
.get_fire_events <- function(y, c) {

  # create url
  url <-
    paste0("https://firms.modaps.eosdis.nasa.gov/data/country/viirs-snpp/", y, "/viirs-snpp_", y, "_", c, ".csv")
  # create string for temporary file
  destfile <- paste0("../", c, "_", y, ".csv")
  # download the file and save it to temp folder
  download.file(url, destfile)
}

# aoi polygon
aoi <- system.file("extdata", "sierra_de_neiba_478140_2.gpkg",
  package = "mapme.biodiversity"
)
aoi <- read_sf(aoi)

# pass year (y) and country name (c) as argument
y <- 2020
c <- "Dominican_Republic"

# download csv
.get_fire_events(y, c)

# load csv
csv <- read.csv(paste0("../", c, "_", y, ".csv"))

# Convert csv to sf object
fire <- st_as_sf(
  x = csv,
  coords = c("longitude", "latitude"),
  crs = 4326
)
# intersect with aoi
intersected <- st_intersection(
  fire,
  aoi
)
#> Warning: attribute variables are assumed to be spatially constant throughout all
#> geometries
# view sample results
intersected[1:2, ]
#> Simple feature collection with 2 features and 17 fields
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: -71.65823 ymin: 18.68062 xmax: -71.65492 ymax: 18.68865
#> Geodetic CRS:  WGS 84
#>      bright_ti4 scan track   acq_date acq_time satellite instrument confidence
#> 580      354.34 0.39  0.44 2020-02-14     1819         N      VIIRS          n
#> 1348     337.07 0.39  0.36 2020-03-18     1801         N      VIIRS          n
#>      version bright_ti5   frp daynight type WDPAID            NAME
#> 580        1     306.69 41.88        D    0 478140 Sierra de Neiba
#> 1348       1     304.61 12.76        D    0 478140 Sierra de Neiba
#>          DESIG_ENG ISO3                   geometry
#> 580  National Park  DOM POINT (-71.65492 18.68062)
#> 1348 National Park  DOM POINT (-71.65823 18.68865)
# plot frp
plot(intersected[11])

Created on 2022-06-14 by the reprex package (v2.0.0)

Jo-Schie commented 2 years ago

Hi @Ohm-Np : I saw that you created a merge request. do you need my feedback on this or is it only @goergen95 who needs to approve?

Ohm-Np commented 2 years ago

Hi @Jo-Schie, I just put a comment on the PR specifying how the routine works here.

do you need my feedback on this

Yes, it would be great if you have any suggestions on better names for the resource and indicator.

Current names:

Resource: nasa_firms

Indicators: active_fire_counts active_fire_properties

Jo-Schie commented 2 years ago

Hi @Jo-Schie, I just put a comment on the PR specifying how the routine works here.

do you need my feedback on this

Yes, it would be great if you have any suggestions on better names for the resource and indicator.

Current names:

Resource:

nasa_firms

Indicators:

active_fire_counts

active_fire_properties

To me the names sound quite meaningful. I would keep them like this!