ποΈπ³π²π½π Land cover generator for the GOBLIN model (Ireland only)ο
Based on the GOBLIN (General Overview for a Backcasting approach of Livestock INtensification) land use tool module
The package takes scenario input data, spared,utilised grassland area, the soil class breakdown for the spared grassland area, as well as the calibration year and target year. It produces a land use dataframe for grassland, cropland, forest, wetland, settlements and farmable condition. It also produces a transition matrix, in the form of a dataframe, which captures the areas transitioning from one land use category to another.
Finally, this package produces an afforestation dataframe that can be used by the cbm_runner, which is broken down by forest yield classes. The soil groups relate to those found in the Teagasc national farm survey. The soil groups are mapped to Sitka spruce yield classes following Table 2 of Upton et al. (2013), which translates the National Farm Survey soil categories into expected yield classes using the productivity model of Farrelly et al. (2011); see docs/data_sources.md.
An example has been provided below. Total grassland, spared area and spared area breakdown area generated by the grassland_production module.
Final result are pandas dataframes that can be read by numerous GOBLIN packages, including GOBLIN lite and GeoGOBLIN (catchment level).
The geo_landcover_assignment sub module is intended for use at the catchment level and interfaces with the catchment_data_api to retrieve catchment specific data that has been derived from Irelandβs National Land Cover map.
src/
β
βββ landcover_assignment
β βββ ... (other modules and sub-packages)
β
βββ geo_landcover_assignment
| βββ ... (other modules and sub-packages)
For national level analysis, the historic land uses and areas of organic and mineral soil are taken from Irelandβs national inventory: the Common Reporting Tables and National Inventory Document 2026 (EPA, National Inventory Submissions 2026), with burnt area from the CRF 2024 tables. The managed forest area and forest fire follow cbm_runner 0.6.1. The package database records the unit, source and cell of every value; see docs/data_sources.md.
The package is currently parameterised for use in the Irish context.
Installationο
Install from git hub.
pip install "landcover_assignment@git+https://github.com/GOBLIN-Proj/landcover_assignment.git@main"
Install from PyPI
pip install landcover_assignment
The optimiser uses the open-source HiGHS solver through Pyomo; highspy is installed as a dependency, and no commercial solver is needed.
Usageο
The baseline year represents the scenario baseline. The target year is the end year for each one of the scenarios.
The scenario dataframe is the scenario input parameters.
Spared area and grassland area represent the calculated spared area and the remaining grassland area, respectively.
The example below is tests/example.py, which runs on the test inputs in tests/data/ (python tests/example.py).
import os
import pandas as pd
from landcover_assignment.afforestation import Afforestation
from landcover_assignment.landcover import LandCover
from landcover_assignment.transition_matrix import TransitionMatrix
def main():
path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "data")
baseline = 2020 # calibration year
target_year = 2050
scenario_dataframe = pd.read_csv(os.path.join(path, "scenario_dataframe.csv"), index_col=0)
spared_area = pd.read_csv(os.path.join(path, "spared_area.csv"), index_col=0)
spared_area.columns = spared_area.columns.astype(int)
spared_area_breakdown = pd.read_csv(os.path.join(path, "spared_area_breakdown.csv"), index_col=0)
grassland_area = pd.read_csv(os.path.join(path, "total_grassland_area.csv"), index_col=0)
grassland_area.columns = grassland_area.columns.astype(int)
land = LandCover(
baseline, target_year, scenario_dataframe, grassland_area, spared_area, spared_area_breakdown
)
# land use areas and shares: calibration year, then the target year of each scenario
print("combined future land use area")
print(land.combined_future_land_use_area())
print("#" * 50)
# where the spared area went, per scenario
print("spared area log")
print(land.get_spared_area_log())
print("#" * 50)
# the grassland row's parts: herd grassland, spared organic land, other (national balance)
print("grassland area breakdown")
print(land.get_grassland_area_breakdown())
print("#" * 50)
# transition matrix (Grassland_to_<land use>, in ha)
transition = TransitionMatrix(
baseline, target_year, scenario_dataframe, grassland_area, spared_area, spared_area_breakdown
)
transition_matrix = transition.create_transition_matrix()
print("transition matrix")
print(transition_matrix)
print("#" * 50)
# afforestation by species and yield class, for cbm_runner
affor = Afforestation(baseline, target_year, scenario_dataframe, transition_matrix)
print("afforestation")
print(affor.gen_cbm_afforestation_dataframe(spared_area_breakdown))
if __name__ == "__main__":
main()
Where the grassland area comes fromο
The grassland row holds two parts:
herd grassland, the
total_grasslandinput from grassland_production: the area the herd needs for its grass (grass eaten Γ· yield Γ· utilisation rate). Only this can be spared; the spared area is its fall between the calibration and target years.other grassland (the balance), the national grassland area in the calibration year minus the herd grassland. It is fixed, never spared, and included so that its emissions are counted (national tree only).
The grassland row therefore equals the national grassland area in the baseline, and the national shares apply to all of it. LandCover.get_grassland_area_breakdown() reports the parts for the baseline and each scenario.
Spared area and rewettingο
A scenarioβs spared grassland is divided into:
rewetted organic soil, which stays in the grassland row: the scenarioβs rewetting target (rewetted proportion x spared area), capped by the drained organic grassland available, and never more;
mineral soil, which the optimiser allocates to forest, cropland and farmable condition (farmable condition is mineral soil only);
organic soil spared beyond the rewetting target (only when the mineral land runs out, e.g. a scenario that spares all herd grassland), which stays in the grassland row in its current condition: drained land stays drained, land with rewet status stays so. Only the animals go.
Rewetted grassland is not wetland:
The inventory reports it inside grassland remaining grassland (CRT 4.C.1) as rewet status (NID 2026 s.6.5.2), and landcover_lca applies grassland rewetting factors to it.
In the land-use table, rewetting moves area from the drained to the rewet-status shares of the grassland row (
share_rewetted_rich_organic,share_rewetted_poor_organic).Grassland_to_Wetlandin the transition matrix is always 0.The spared-area log records the rewetted area as
rewet_grassland, and organic land spared beyond the target asspared_drained_organic_grasslandandspared_rewetted_organic_grassland.
See docs/rewetting.md for the method and a worked example.
Peat extraction in scenariosο
Modelling assumption (decision D10): all peat extraction, industrial and domestic, ends in 2040. In target-year wetland rows it falls in a straight line from the calibration year to 0 in 2040, and the stopped share becomes rewetted (share_rewetted_industrial_peat_extraction, share_rewetted_domestic_peat_extraction). The wetland area and the calibration-year rows (the inventory) are unchanged.
Testsο
python -m unittest discover -s tests -p "test_*.py"
See tests/README.md for what each test guards.
Licenseο
This project is licensed under the terms of the MIT license.