bestiapop - A python package for climate data extraction and processing

Photo by

PyPI - Downloads

Climate data is an essential input for crop models to predict crop growth and development using site-specific (point) or gridded climate data. While point data is currently available in MET format, gridded data is provided in NetCDF file format which is difficult to store and convert to an input file readable by APSIM or other crop models. We developed bestiapop (a spanish word that translates to pop beast), a Python script (soon to become a package) which allows model users to automatically download gridded climate data, e.g. SILO’s (Scientific Information for Land Owners) data in a crop model format such as MET file format in APSIM or WHT format in DSSAT that can then be inputted for crop modelling predictions. The package offers the possibility to select a range of grids (5 km × 5 km resolution) and years producing various types of output files: MET, WHT and soon csv, SQLite and Jason.

Although the code currently downloads data from the SILO database, it will be updated to be applied to other climate data sources e.g. NASA POWER as was impplemented in R using APSIM CRAN.


Data Analytics Specialist & Code Developer: Diego Perez @darkquassar

Data Scientist, Crop Physiologist & Crop Modeller: Jonathan Ojeda @JJguri


What is APSIM?

The Agricultural Production Systems sIMulator (APSIM) is internationally recognised as a highly advanced platform for modelling and simulation of agricultural systems. It contains a suite of modules that enable the simulation of systems for a diverse range of crop, animal, soil, climate and management interactions. APSIM is undergoing continual development, with new capability added to regular releases of official versions. Its development and maintenance is underpinned by rigorous science and software engineering standards. The APSIM Initiative has been established to promote the development and use of the science modules and infrastructure software of APSIM.

What is a MET file?

The APSIM Met module provided daily meteorological information to all modules within an APSIM simulation. The APSIM Met Module requires parameters to specify the climate of the site for each APSIM time step. This information is included in a MET file.

APSIM MET files consist of a section name, which is always, several constants consisting of name = value, followed by a headings line, a units line and then the data. Spacing in the file is not relevant. Comments can be inserted using the ! character.

At a minimum three constants must be included in the file: latitude, tav and amp. The last two of these refer to the annual average ambient temperature and annual amplitude in mean monthly temperature. Full details about tav and amp can be found here: tav_amp.

The MET file must also have a year and day column (or date formatted as yyyy/mm/dd), solar radiation (MJ/m2), maximum temperature (°C), minimum temperature (°C) and rainfall (mm). The column headings to use for these are year and day (or date), radn, maxt, mint, rain. Other constants or columns can be added to the file. These then become available to APSIM as variables that can be reported or used in manager script.

Can I use this script to generate climate files for other process-based crop models?

So far, the code is producing CSV or MET files to be directly used by APSIM, however, it also could be applied to produce input climate data for other crop models such as DSSAT and STICS. Decision Support System for Agrotechnology Transfer (DSSAT) is a software application program that comprises dynamic crop growth simulation models for over 40 crops. DSSAT is supported by a range of utilities and apps for weather, soil, genetic, crop management, and observational experimental data, and includes example data sets for all crop models. The STICS (Simulateur mulTIdisciplinaire pour les Cultures Standard, or multidisciplinary simulator for standard crops) model is a dynamic, generic and robust model aiming to simulate the soil-crop-atmosphere system.

Read code documentation at:

Script documentation

GitHub repo

Jonathan Ojeda
Crop Physiologist – Crop Modeller

My research interests include the use of crop models to understand GxExM crop interactions.