This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| ''' | |
| Pure Python implementation of some numerical optimizers | |
| Created on Jan 21, 2011 | |
| @author Jiahao Chen | |
| ''' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| def rebin(a, new_shape): | |
| """ | |
| Resizes a 2d array by averaging or repeating elements, | |
| new dimensions must be integral factors of original dimensions | |
| Parameters | |
| ---------- | |
| a : array_like |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Start by storing model names in an array. This keeps order, but prolly not important | |
| models = [ 'casa', 'lpj', 'jules', 'middle_aged_glamour_model'] | |
| # The year list that you are going to loop over | |
| years = np.arange ( 1990, 2011 ) | |
| # Model variables for each model | |
| # You need to keep each list in the order they appear in the output. That's fairly important. | |
| model_var = { 'casa':[ 'doy','NEE', 'NPP'], 'lpj':['year', 'doy','NEE', "GPP"], \ | |
| 'doy',middle_aged_glamour_model']=[ 'doy','you','dont','wanna_know'] } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Create a new repo at github called `test` | |
| # On your local machine: | |
| $ cd test | |
| $ git init | |
| Initialized empty Git repository in /Users/bcf/Git/me/test/.git/ | |
| $ touch README | |
| $ git add . | |
| $ git commit -m 'first commit' | |
| # wire everything up to the remote at github (replace yourName) |
NewerOlder