Skip to main content

Tier 1 Environmental Impact Assessment tool for crops.

Project description

🌾 Crop_lca, a lifecycle assessment tool for cropping systems in Ireland

license python Code style: black

Based on the GOBLIN (General Overview for a Backcasting approach of Livestock INtensification) LifeCycle Analysis tool, the Crop_lca module decouples this module making it an independent distribution package.

The package is shipped with key data for emissions factors, fertiliser inputs, crop characteristics and upstream emissions.

Currently parameterised for Ireland, but the database can be updated with additional emissions factor contexts, which are selected able with an emissions factor key.

Final results are output as a dictionary object capturing emissions for:

-   crop_residue_direct
-   N_direct_fertiliser
-   N_indirect_fertiliser
-   soils_CO2

Structure

The package is structured for use in national and catchment level analysis.

The geo_crop_lca sub module is intended for use at the catchment level and interfaces with the catchment_data_api to retrieve catchment specific crop areas and types data that has been retrieved from Ireland's National Land Cover map and merged with crop types using the LUCAS land cover dataset.

   src/
   │
   ├── crop_lca/
       └── ... (other modules and sub-packages)
       │
       ├── geo_crop_lca/
       |   └── ... (other modules and sub-packages)

Installation

Install from git hub.

pip install "crop_lca@git+https://github.com/GOBLIN-Proj/crop_lca.git@main" 

Install from PyPI

pip install crop_lca

Usage

import pandas as pd
from crop_lca.models import load_crop_farm_data
from crop_lca.lca import ClimateChangeTotals
from crop_lca.national_crop_production import NationalCropData


def main():
    # Instantiate ClimateChange Totals Class, passing Ireland as the emissions factor country
    climatechange = ClimateChangeTotals("ireland")

    # Create a dictionary to store results
    index = 2020
    crop_emissions_dict = climatechange.create_emissions_dictionary([index])

    # Create some data to generate results
    data = NationalCropData.gen_national_crop_production_dataframe(index)
    
    data_frame = pd.DataFrame(data)

    #proportion of fertiliser inputs that is urea
    urea_proportion =0.2
    urea_abated_proportion = 0
    # generate results and store them in the dictionary

    data = load_crop_farm_data(data_frame)

    crop_emissions_dict["crop_residue_direct"][index] += (
        climatechange.total_residue_per_crop_direct(
            data[index],
        )
    )
    crop_emissions_dict["N_direct_fertiliser"][index] += (
        climatechange.total_fertiliser_direct(
            data[index],
            urea_proportion,
            urea_abated_proportion,
        )
        
    )
    crop_emissions_dict["N_indirect_fertiliser"][index] += (
        climatechange.total_fertiliser_indirect(
            data[index],
            urea_proportion,
            urea_abated_proportion,
        )
    )
    crop_emissions_dict["soils_N2O"][index] += (
        crop_emissions_dict["crop_residue_direct"][index]
        + crop_emissions_dict["N_direct_fertiliser"][index]
        + crop_emissions_dict["N_indirect_fertiliser"][index]
    )
    crop_emissions_dict["soils_CO2"][index] += (
        climatechange.urea_co2(
            data[index],
            urea_proportion,
            urea_abated_proportion,
        )
        
    )

    print(crop_emissions_dict)


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

crop_lca-0.2.2.tar.gz (179.3 kB view details)

Uploaded Source

Built Distribution

crop_lca-0.2.2-py3-none-any.whl (181.2 kB view details)

Uploaded Python 3

File details

Details for the file crop_lca-0.2.2.tar.gz.

File metadata

  • Download URL: crop_lca-0.2.2.tar.gz
  • Upload date:
  • Size: 179.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.2 CPython/3.10.0 Linux/5.15.0-106-generic

File hashes

Hashes for crop_lca-0.2.2.tar.gz
Algorithm Hash digest
SHA256 a40821e725f7d289e73a62050618e3c2cff112ddd1ba0fe48f06894f84349583
MD5 4750381769ecf270d6299d2d754252c8
BLAKE2b-256 fc91d8bad30a6dd51b31f71d9be3097061a404b9dbdd93e3da6a6fd97292f4bc

See more details on using hashes here.

File details

Details for the file crop_lca-0.2.2-py3-none-any.whl.

File metadata

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

File hashes

Hashes for crop_lca-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 09e8e570fdb142e0f72a6ddbfa96ee4aba369f66ffc994c6909af621573cdd2c
MD5 692b6683be4e2702c7cb39e13eb4aeff
BLAKE2b-256 3087a39380b3a76fba530ec19ba7951a51518e5d3ce35ace4f35d41952db7632

See more details on using hashes here.

Supported by

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