Skip to main content

Soil-Crop-Water model based on AquaCrop-OS.

Project description

AquaCrop-OSPy

Soil-Crop-Water model based on AquaCrop-OS.

checks release last-commit license python-version image Downloads

from aquacrop import AquaCropModel, Soil, Crop, InitialWaterContent
from aquacrop.utils import prepare_weather, get_filepath

weather_file_path = get_filepath('tunis_climate.txt')
model_os = AquaCropModel(
            sim_start_time=f"{1979}/10/01",
            sim_end_time=f"{1985}/05/30",
            weather_df=prepare_weather(weather_file_path),
            soil=Soil(soil_type='SandyLoam'),
            crop=Crop('Wheat', planting_date='10/01'),
            initial_water_content=InitialWaterContent(value=['FC']),
        )
model_os.run_model(till_termination=True)
model_results = model_os.get_simulation_results().head()
print(model_results)

About

AquaCrop-OSPy is an open-source Python crop-water model developed by Tim Foster and others (Tom Kelly and Chris Bowden) within the Agriculture, Water and Climate research group at the University of Manchester. The AquaCrop-OSPy code has been developed with support from the the University of Manchester, Daugherty Water for Food Global Institute, Imperial College London, along with input from the United Nations Food and Agriculture Organization's (FAO) AquaCrop Core Development Group.

Please note that AquaCrop-OSPy is not an official implementation or version of the FAO AquaCrop model. AquaCrop-OSPy currently mirrors most features available in version 7.1 of the official FAO AquaCrop model, with the exception of routines for salinity and fertility stress, weed management, and perennial herbaceous crops that are still to be developed. AquaCrop-OSPy has been rigorously tested to verify that the model reproduces accurately the calculations and outputs performed by the official FAO AquaCrop model. However, some bugs or errors may still be found. Please use the Issues tab to raise any issues encountered with the AquaCrop-OSPy. More details about the official FAO AquaCrop model on which AquaCrop-OSPy is based can be obtained here .

For further information about the AquaCrop-OSPy model, you can consult the accompanying open-access journal paper on the code here . There is also an extensive documentation for the model, along with a series of tutorials to help you get started with the Python code (see Quickstart below). AquaCrop-OSPy builds upon an earlier version of code developed in Matlab, more information about which can be found here .

More information about the official FAO AquaCrop model on which AquaCrop-OSPy is based can be obtained here , where you can also access the official raw source AquaCrop code, compiled executables, and most recent code releases that are developed and provided by FAO.

Install

pip install aquacrop

Quickstart

A number of tutorials has been created (more to be added in future) to help users jump straight in and run their first simulation. Run these tutorials instantly on Google Colab:

  1. Running an AquaCrop-OSPy model
  2. Estimation of irrigation water demands
  3. Optimisation of irrigation management strategies
  4. Projection of climate change impacts

Installation troubleshooting

If you receive an error message such as "No module named aquacrop.scripts.initiate_library" or "ModuleNotFoundError: No module named 'aquacrop.solution.solution_root_zone_water'", please try the following troubleshooting steps:

  1. Run "python -m aquacrop.scripts.initiate_library" in your terminal, if this generates an error such as "RuntimeError: Attempted to compile AOT function without the compiler used by numpy.distutils present. Cannot find suitable msvc.", then you need to download and install an MSVC compiler such as the one included in Visual Studio build tools (see https://www.youtube.com/watch?v=p_R3tXSq0KI).

  2. If Step 1 doesn't help, then you can run aquacrop in development mode using the code below. This will turn off some function compilation, resulting in minor increases in runtime:
    import os
    os.environ['DEVELOPMENT'] = 'DEVELOPMENT'

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

aquacrop-3.0.10.tar.gz (10.6 MB view details)

Uploaded Source

Built Distribution

aquacrop-3.0.10-py3-none-any.whl (10.7 MB view details)

Uploaded Python 3

File details

Details for the file aquacrop-3.0.10.tar.gz.

File metadata

  • Download URL: aquacrop-3.0.10.tar.gz
  • Upload date:
  • Size: 10.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for aquacrop-3.0.10.tar.gz
Algorithm Hash digest
SHA256 f8e75f89971941776b7d6f9b86f1959c6f53969c7edb0bc777da72bc11c84f8b
MD5 ad5469884770cd8daadf1cb48c7c3e90
BLAKE2b-256 9af9ccdd5abc8cd108b41d23c57dda7a15e07109433f0e5aa52b0952abe9187d

See more details on using hashes here.

File details

Details for the file aquacrop-3.0.10-py3-none-any.whl.

File metadata

  • Download URL: aquacrop-3.0.10-py3-none-any.whl
  • Upload date:
  • Size: 10.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for aquacrop-3.0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 328959735c00a9b311620234f4925eb14a2b058b6c25c699370d983f8ca19e2f
MD5 951e30ffff606f98168541a262115667
BLAKE2b-256 8bddefca634f71a7667c238cf7d610fac0eacb6c4e1e521f231a4c84a9f72cc8

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