Skip to content

Instantly share code, notes, and snippets.

@Kirubaharan
Created November 16, 2014 08:10
Show Gist options
  • Save Kirubaharan/29f3bd1055c26d7927e4 to your computer and use it in GitHub Desktop.
Save Kirubaharan/29f3bd1055c26d7927e4 to your computer and use it in GitHub Desktop.
phenology
import matplotlib.pyplot as plt
import numpy as np
from phenology import *
data2011 = np.loadtxt('/Users/User/data2011.txt')
# Define variables
doy = data2011[:,0]
temp = data2011[:,1]
tbase = 10.
tmax = 40.
# Calculate AGDD
agdd = calculate_gdd( temp, tbase=tbase, tmax=tmax )
# First subplot is Hainich (DE)
fig = plt.figure()
plt.plot(doy, temp, '-r')
plt.plot(doy, agdd, 'g')
plt.xlabel("DoY")
plt.show()
@Kirubaharan
Copy link
Author

You already have temperature so just use the calculate_gdd function from phenology library to calculate gdd and then plot it with your data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment