README.md 3.5 KB
Newer Older
Agrineer.org's avatar
Agrineer.org committed
1
## Description
Agrineer.org's avatar
Agrineer.org committed
2
3
4
5
6
7
8
9
10
11
12
The Grow Degree Calulator (GDC) package contains a command-line driven 
Python code, "gdc.py", which calculates Grow Degree Days (GDD); 
a handy value in agriculture used to predict maturity stages of 
crops and insects alike.

The "gdc.py" program currently uses Weather, Research, 
and Forecast (WRF) model data for daily maximum and minimum 
temperatures along with user supplied parameters. Users can specify 
location, run dates, lower and upper temperature limits. 

A GUI implementation of this package is on the Agrineer.org 
Agrineer.org's avatar
Agrineer.org committed
13
[website](https://agrineer.org/gdc/gdc.php) and covers about half the of the western United States, with a ~3km pixel resolution.
Agrineer.org's avatar
Agrineer.org committed
14

Agrineer.org's avatar
Agrineer.org committed
15
The package was developed using GNU/Linux Mint 17, but other Debian platforms are known to work (Ubuntu 12,14; Mint 18,19).
Agrineer.org's avatar
Agrineer.org committed
16

Agrineer.org's avatar
Agrineer.org committed
17
18
## Function
The Grow Degree Calculator (GDC) package implements a simple daily calculation:
Agrineer.org's avatar
Agrineer.org committed
19
20
21
22
23

                      (Daily Max Air Temp + Daily Min Air Temp)
    Daily Degree Day = ----------------------------------------  - Lower Temp
                                           2
    
Agrineer.org's avatar
Agrineer.org committed
24
25
26
27
28
29
30
Where:   
    
         "Daily Max Air Temp" is capped by the "Upper Temp" threshold.
    
and  
       
         if "Daily Degree Day" < 0 then set "Daily Degree Day" = 0.
Agrineer.org's avatar
Agrineer.org committed
31

Agrineer.org's avatar
Agrineer.org committed
32
Daily values are accumulated over a period of specified run days.
Agrineer.org's avatar
Agrineer.org committed
33
34
35
36

Users are encouraged to vary parameters in order to further the 
accuracies of this calculator as applied to local cultivars. 

Agrineer.org's avatar
Agrineer.org committed
37
38
## Current Implemention Stream
Modeled Weather-> Local/Crop parameters -> GDD calculations
Agrineer.org's avatar
Agrineer.org committed
39

Agrineer.org's avatar
Agrineer.org committed
40
This initial release uses reanalyzed Global Forecasting System (GFS) data as input to the WRF model to produce modeled, hindcast weather data; although other models and input data can be used, including forecast data.
Agrineer.org's avatar
Agrineer.org committed
41

Agrineer.org's avatar
Agrineer.org committed
42
The only data used from the WRF model are maximum and minimum temperatures for a specified location pixel.
Agrineer.org's avatar
Agrineer.org committed
43

Agrineer.org's avatar
Agrineer.org committed
44
## Motivation
Agrineer.org's avatar
Agrineer.org committed
45
The GDC was designed as an architectural preliminary exercise for 
Agrineer.org's avatar
Agrineer.org committed
46
the Soil Moisture Estimator package [SME](https://gitlab.com/agrineer/sme). 
Agrineer.org's avatar
Agrineer.org committed
47
48
49
50
It is suggested that programmers interested in the SME project 
should start with the GDC, as it gives a less complicated approach to 
the WRF netCDF4 data.

Agrineer.org's avatar
Agrineer.org committed
51
52
53
54
55
## Installation
### Dependencies
   - The [agrineer](https://gitlab.com/agrineer/agrineer)
     package must be installed.
   - WRF/ETo data files retrieved by programs in the "agrineer" package. 
Agrineer.org's avatar
Agrineer.org committed
56

Agrineer.org's avatar
Agrineer.org committed
57
58
### Setup
   Determine a directory to house the GDC project, eg. /home/user/projects.
Agrineer.org's avatar
Agrineer.org committed
59

Agrineer.org's avatar
Agrineer.org committed
60
61
62
63
64
65
66
   Change into this directory and either unpack or clone this project.  
   
         > cd /home/user/projects  
         
         > tar xvf gdc.tar
         or 
         > git clone https://gitlab.com/agrineer/gdc
Agrineer.org's avatar
Agrineer.org committed
67

Agrineer.org's avatar
Agrineer.org committed
68
### Running the gdc.py program
Agrineer.org's avatar
Agrineer.org committed
69

Agrineer.org's avatar
Agrineer.org committed
70
   The gdc.py program requires appropriate data and a configuration file. Data can be downloaded using programs in the "agrineer" package.
Agrineer.org's avatar
Agrineer.org committed
71

Agrineer.org's avatar
Agrineer.org committed
72
73
74
   You will need to create a "results" directory to direct gdc output into.  
   
          > mkdir somewhere/results
Agrineer.org's avatar
Agrineer.org committed
75

Agrineer.org's avatar
Agrineer.org committed
76
77
   An example configuration file is given in the gdc directory 
   called "gdc.conf". Copy this file, eg.
Agrineer.org's avatar
Agrineer.org committed
78

Agrineer.org's avatar
Agrineer.org committed
79
          > cp gdc.conf MyGdc.conf
Agrineer.org's avatar
Agrineer.org committed
80

Agrineer.org's avatar
Agrineer.org committed
81
82
83
84
85
   and modify the input values for your environment. Be sure to point to the newly made "results" directory to direct GDC output into.
   
   Details on input values can be found at our [wiki](https://www.agrineer.org/wiki/index.php?title=Grow_Degree_Calculator).
   
   Run:  
Agrineer.org's avatar
Agrineer.org committed
86
   
Agrineer.org's avatar
Agrineer.org committed
87
88
           > cd /home/agrineer/projects/gdc
           > ./gdc.py -c MyGdc.conf
Agrineer.org's avatar
Agrineer.org committed
89

Agrineer.org's avatar
Agrineer.org committed
90
   Look in the output directory specified in the configuration file for result output.