TwinYields / farmingpy

Python library for Smart Farming data and modelling. Enables reading of ISOBUS task files, EO data from SentinelHub and interfacing APSIM simulation models.

Home Page:https://twinyields.github.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FarmingPy

Python library for Smart Farming data and modeling. Enables reading of ISOBUS task files, EO data from SentinelHub and interfacing APSIM simulation models.

Installation

Dotnet installation is required to run the code https://dotnet.microsoft.com/en-us/download/dotnet/6.0. A C# library is used to read in timelog data (trough PythonNet).

pip install git+https://github.com/TwinYields/farmingpy.git

APSIM interface

In order to use APSIM interface from farmingpy.apsim you need to install APSIM and add the directory containing the Models executable to path or python path (to find the right .dll files). You can use the APSIM installer or build from source.

Source build

git clone --depth 1 https://github.com/APSIMInitiative/ApsimX.git

On Linux or Mac you can use the following to build APSIM:

dotnet build -o ~/.local/lib/apsimx -c Release ApsimX/Models/Models.csproj

On Ubuntu make sure you have sqlite installed:

sudo apt install libsqlite3-dev

And add the build location to Pythonpath (add this to shell config e.g. .bashrc to make it permanent):

export PYTHONPATH=~/.local/lib/apsimx

Build on Windows, and add the output directory to path or Python path

dotnet build -o %USERPROFILE%\apsimx -c Release ApsimX/Models/Models.csproj

Usage:

import farmingpy as fp
tl = fp.TimeLogData("TASKDATA_20210603_0159/TASKDATA.XML")
# List measurement info
tl.headers
# DataFrame containing all logged data
tl.data()
# GeoDataFrame containing only "Actual Mass Per Area Application Rate" (DD entity 7)
# and "Actual Work State" columns
tl.rates()

About

Python library for Smart Farming data and modelling. Enables reading of ISOBUS task files, EO data from SentinelHub and interfacing APSIM simulation models.

https://twinyields.github.io

License:MIT License


Languages

Language:Python 97.9%Language:Dockerfile 2.1%