Skip to content
/ pywheat Public

Python library for simulation of wheat phenological development, crop growth and yield.

License

Notifications You must be signed in to change notification settings

egiron/pywheat

Repository files navigation

IWIN tools library

Welcome to PyWheat

Build Downloads Python Package Index GPLv3 License

Python library for simulation of wheat phenological development, crop growth and yield at large scales.

Intro

The PyWheat simulates the wheat growth and development in a daily time-step at field, local, regional and global scales. Most of the algorithms are based on the original Fortran routines of the CERES-Wheat 2.01.

To accurately simulate wheat growth, development, and yield, the model takes into account the following processes:

  • Phenological development, especially as it is affected by genetics and weather.
  • Extension growth of leaves, stems, and roots.
  • Biomass accumulation and partitioning, especially reproductive organs.
  • Soil water balance and water use by the crop.

Quick start

The package for estimating wheat grain yield using pywheat can be installed with pip:

pip install pywheat

For detailed installation instructions visit installation

This will add a command-line interface (CLI) that you can then use like so:

pywheat

This simple command shows the following message:

Usage: pywheat [OPTIONS] COMMAND [ARGS]...

Options:
  -h, --help  Show this message and exit.

Commands:
  pheno
  phenology

You can see two functions or commands you will be able to run. Use the help option (-h) to see how to proceed.

pywheat phenology -h
Usage: pywheat phenology [OPTIONS]

Options:
  -lat, --latitude FLOAT       Latitude of the site  [required]
  -lon, --longitude FLOAT      Longitude of the site
  -sd, --sowing_date TEXT      Sowing date of the crop. eg. 1972-03-13
                               [required]
  -tbase, --tbase FLOAT        Base temperature for estimate Thermal time.
                               Default 0.0
  -tt_topt, --tt_topt FLOAT    Thermal time optimum temperature. Default 26
  -tt_tmax, --tt_tmax FLOAT    Thermal time maximum temperature. Default 34
  -sa, --sunangle FLOAT        Sun angle with the horizon. eg. p = 6.0 : civil
                               twilight. Default 0.0
  -sn, --snow FLOAT            Snow fall. Default 0.0
  -sdepth, --sdepth FLOAT      Sowing depth in cm. Default 3.0 cm
  -gdde, --gdde FLOAT          Growing degree days per cm seed depth required
                               for emergence, Default 6.2 GDD/cm.
  -dsgft, --dsgft FLOAT        GDD from End Ear Growth to Start Grain Filling
                               period. Default 200 degree-days
  -vreq, --vreq FLOAT          Vernalization required for max.development rate
                               (VDays). Default 505 degree-days
  -phint, --phint FLOAT        Phyllochron. A good estimate for PHINT is 95
                               degree days. This value for PHINT is
                               appropriate except for spring sown wheat in
                               latitudes greater than 30 degrees north and 30
                               degrees south, in which cases a value for PHINT
                               of 75 degree days is suggested. Default 95.0
                               degree-days
  -p1v, --p1v FLOAT            Development genetic coefficients,
                               vernalization. 1 for spring type, 5 for winter
                               type. Default 4.85
  -p1d, --p1d FLOAT            Development genetic coefficients, Photoperiod
                               (1 - 6, low- high sensitive to day length).
                               Default 3.675
  -p5, --p5 FLOAT              Grain filling degree days. Old value was
                               divided by 10. Default 500 degree-days.
  -p6, --p6 FLOAT              Approximate the thermal time from physiological
                               maturity to harvest. Default 250.
  -glim, --glim FLOAT          Threshold for days to germination. Default 40
  -elim, --elim FLOAT          Threshold for thermal time to emergence.
                               Default 300
  -tdu, --tdu FLOAT            Threshold for thermal development units (TDU).
                               Default 400
  -fmt, --inputformat TEXT     File format of the input weather file. Options
                               CSV, DSSAT .WTH or Parquet
  -ofmt, --outputformat TEXT   File format of the output phenology file.
                               Options txt or csv
  -best, --bestmodel BOOLEAN   Use the calibration parameters to estimate
                               phenology
  -w, --weather FILE           Path to input weather file in CSV or Parquet
                               format  [required]
  -o, --output FILE            Path to output phenology file.
  -verbose, --verbose BOOLEAN  Display comments
  -h, --help                   Show this message and exit.

Usage in CLI

pywheat phenology -lat 37.18 -lon -99.75 -sd '1981-10-16' \
 -w ./pywheat/data/example/KSAS.WTH -fmt wth -o ./outputs.txt -verbose False

The above instruction use 3 variables (latitude, longitude and sowing date of the site) to run the phenology model. It also requires the path of the weather data file in this case in DSSAT format. This will take a minute or so at the first time to compile the main functions and save them to the cache. Next time will be much faster.

RSTG   GROWTH STAGE      DAP  DOY   CROP AGE   SUMDTT   DATE 
7      Sowing              0  289      0            0   1981-10-16
8      Germinate           1  290      1           28   1981-10-17
9      Emergence           5  294      5           66   1981-10-21
1      Term Spklt         36  325     31         1683   1981-11-21
2      End Veg           147   71    111          290   1982-03-12
3      End Ear Gr        169   93     22          202   1982-04-03
4      Beg Gr Fil        184  108     15          158   1982-04-18
5      End Gr Fil        214  138     30          459   1982-05-18
6      Harvest           228  152     14          267   1982-06-01

For detailed instructions of how-to get started, configuration options, and a demo, visit Getting Started

Feedback

If you have any feedback, please reach out to us at Feedback

## FAQ

Please read out frequently asked questions before you send an email.

Authors

License

MIT License

Copyright (c) 2023

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Additional License please check out License

Sponsors

 

Footnotes

  1. CERES-Wheat version 2.0 by Dr. Joe T. Ritchie and Dr. Doug Godwin. https://nowlin.css.msu.edu/wheat_book/

About

Python library for simulation of wheat phenological development, crop growth and yield.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published