Terraflux Terraflux
Download

Carbon and REDD+

6 operators. Inputs marked required must be connected or given; the others have defaults.

carbon.emissions#

The carbon emitted and removed by land change over a series of maps (the IPCC's stock-difference method): every cell's stock at every date from its class (a stock per class, tC/ha; or a curve of regrowth, Chapman-Richards or linear, from the date the class appeared in the cell, for secondary forest), a fall an emission, a rise a removal; by period, by transition, and every cell's net emission over the series. Transitions happen at the later date of a period.

InputTypeWhat it is
mapsrequiredrasterthe maps of classes, a layer per date
OutputTypeWhat it is
periodstablea row per period: year_from, year_to, emissions, removals, net (t of CO2, or of C)
transitionstablea row per period and pair of classes with cells: year_from, year_to, from, to, area_ha, emissions, removals
stocksstackthe stock of every cell at every date, tC/ha
netmapevery cell's net emission over the series, t per hectare
SettingTypeWhat it is
stockrequiredanythe stock of each class, tC/ha: {class: stock}
regrowthanythe classes that grow from the date they appear: {class: {max, rate, shape, form}} (tC/ha; Chapman-Richards's max (1 - exp(-rate age))^shape, or linear: rate tC/ha a year up to max)
co2boolin tonnes of CO2 (C × 44/12; default true), else of carbon
timesanythe dates of the maps (default: the layers' names)
cell_areanumbera cell's area in m2 (default: the cells' sides)

redd.allocate#

VT0007's allocation (UDef-ARP's prediction): the fitted relative frequency of every modelling region (a region the fit lacks takes its class's average over the subdivisions) gives each cell a density; the densities are scaled to the activity data, the expected deforestation (or a period's observed one, to confirm the model), never above a cell's area, again until the adjustment ratio is 1.00001 or less.

InputTypeWhat it is
classesrequiredmapthe vulnerability classes of the period
tablerequiredtablethe relative frequency table (redd.fit)
subdivisionsmapthe subdivisions, as in the fit
expectednumberthe expected deforestation, hectares
deforestationmapor the period's observed deforestation (1)
OutputTypeWhat it is
densitymapthe expected deforestation of each cell, hectares
infotableadjustment_ratio, iterations, expected_ha, allocated_ha, filled (regions the fit lacked)
SettingTypeWhat it is
max_iterationsintegerthe adjustments at most (default 50)

redd.assess#

VT0007's assessment of an allocation (UDef-ARP's model evaluation): the predicted and the actual deforestation in the square cells of an assessment grid wholly inside the jurisdiction (centred on the grid's nodes from the map's corner, as UDef-ARP's Thiessen polygons), and their agreement: the mean and median absolute errors (also as shares of a cell), the intersection over union, R², the ordinary least squares and Theil-Sen lines.

InputTypeWhat it is
densityrequiredmapthe predicted deforestation of each cell, hectares
deforestationrequiredmapthe actual deforestation (1)
maskmapthe jurisdiction (non-zero; default all the map)
OutputTypeWhat it is
tabletablea row per assessment cell: cell, x, y (its centre), actual_ha, predicted_ha, residual_ha
metricstablesamples, mae, mae_percent, medae, medae_percent, iou_percent, agreement, difference, r2, ols_slope, ols_intercept, theil_sen_slope, theil_sen_intercept
residualsmapeach assessment cell's residual (predicted - actual), ha
SettingTypeWhat it is
grid_arearequirednumberthe area of an assessment cell, hectares

redd.fit#

VT0007's fit of a vulnerability map to a period's deforestation (UDef-ARP's fitting): the relative frequency of deforestation in every modelling region (a vulnerability class in a subdivision of the jurisdiction) and the density it gives every cell, in hectares.

InputTypeWhat it is
classesrequiredmapthe vulnerability classes (redd.vulnerability)
deforestationrequiredmapthe deforestation of the period (1)
subdivisionsmapthe subdivisions of the jurisdiction (ids 0-999)
OutputTypeWhat it is
tabletablea row per modelling region: id (class × 1000 + subdivision), class, subdivision, deforested and all its cells, frequency
densitymapthe fitted density of deforestation, hectares per cell

redd.nrt#

VT0007's negligible risk threshold (UDef-ARP's nrt_calculation): the distance to the forest's edge below which 99.5 % of the deforestation of a period happened, the middle of the first bin (a cell wide) where the cumulative share of the deforested cells reaches 0.995, in whole map units.

InputTypeWhat it is
distancerequiredmapthe distance of the forest's cells to the edge, in map units
deforestationrequiredmapthe deforestation of the period (1)
maskmapthe jurisdiction (non-zero; default all the map)
OutputTypeWhat it is
nrtnumberthe negligible risk threshold, in map units

redd.vulnerability#

VT0007's vulnerability map in classes of geometric widths (UDef-ARP's geometric classification): the benchmark from the distance to the forest's edge (classes 2 to n + 1 from the edge to the negligible risk threshold, 1 beyond it), or an alternative from a map of vulnerability (a potential, a probability; classes 1 to n from the lowest), inside the jurisdiction; 0 elsewhere.

InputTypeWhat it is
distancemapthe benchmark: the distance to the forest's edge
nrtnumberwith the distance: the negligible risk threshold
vulnerabilitymapor an alternative: a map of vulnerability
forestmapwith a vulnerability: the forest (non-zero)
maskmapthe jurisdiction (non-zero; default all the map)
OutputTypeWhat it is
classesmapthe vulnerability class of each cell, 0 outside
SettingTypeWhat it is
classesintegerthe classes of geometric widths (default 29)