Skip to main content

A goblin tool for the generation of areas of alternative land uses based on spared area available

Project description

🏘️🌳🌲🌽🍀 Land cover generator for the GOBLIN model (Ireland only)

license python Code style: black

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 conditon. 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 yield classes based on research conducted by Farrelly, N. and Gallagher, G (2015).

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 the National Invetory CRF Tables.

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

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.

import pandas as pd
import os
from landcover_assignment.transition_matrix import TransitionMatrix
from landcover_assignment.landcover import LandCover
from landcover_assignment.afforestation import Afforestation

def main():

    path = "./data/"

    baseline = 2020
    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_breakdown = pd.read_csv(os.path.join(path, "spared_area_breakdown.csv"), index_col=0)
    spared_area.columns = spared_area.columns.astype(int)
    grassland_area = pd.read_csv(os.path.join(path, "total_grassland_area.csv"), index_col=0)
    grassland_area.columns = grassland_area.columns.astype(int)


    transition = TransitionMatrix(
        baseline, target_year, scenario_dataframe, grassland_area, spared_area, spared_area_breakdown
    )

    land = LandCover(
        baseline, target_year, scenario_dataframe, grassland_area, spared_area, spared_area_breakdown
    )

    
    #create_combined_future_land_use_area
    print("combined future land use area")
    print(land.combined_future_land_use_area())
    print("#"*50)

    #create_transition_matrix
    transition_matrix = transition.create_transition_matrix()
    print(transition_matrix)
    print("#"*50)

    #create afforestation 
    affor = Afforestation(baseline, target_year, scenario_dataframe, transition_matrix)
    print(affor.gen_cbm_afforestation_dataframe(spared_area_breakdown))

if __name__ == "__main__":
    main()

License

This project is licensed under the terms of the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

landcover_assignment-0.4.0.tar.gz (62.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

landcover_assignment-0.4.0-py3-none-any.whl (69.6 kB view details)

Uploaded Python 3

File details

Details for the file landcover_assignment-0.4.0.tar.gz.

File metadata

  • Download URL: landcover_assignment-0.4.0.tar.gz
  • Upload date:
  • Size: 62.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.0 Linux/5.15.0-131-generic

File hashes

Hashes for landcover_assignment-0.4.0.tar.gz
Algorithm Hash digest
SHA256 d16dfc278e728fd2b8d74c2b0f060c94896f518498244484f7501dab619dde37
MD5 cdad16cbb302683fa935366053c77f95
BLAKE2b-256 aec7d9d9a59cf65a9d7d744806c1791087f889b232e35e653a871caf076aab8e

See more details on using hashes here.

File details

Details for the file landcover_assignment-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: landcover_assignment-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 69.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.0 Linux/5.15.0-131-generic

File hashes

Hashes for landcover_assignment-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2dc408ac73f642cc5697457d176d2e02598cc1f924b067074be15985d5c8608c
MD5 f7bd791b54bf68f4947b8d97ac651825
BLAKE2b-256 690bfce1479008592e2d57fb9759f1b7f7f3e7aa4d9aa362f7f936222ae2665a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page