Skip to content

Instantly share code, notes, and snippets.

View jgomezdans's full-sized avatar

José Gómez-Dans jgomezdans

View GitHub Profile
@jiahao
jiahao / Optimizer.py
Created January 4, 2012 17:44
Pure Python implementation of some numerical optimizers
#!/usr/bin/env python
'''
Pure Python implementation of some numerical optimizers
Created on Jan 21, 2011
@author Jiahao Chen
'''
@zonca
zonca / rebin.py
Created November 8, 2011 19:12
IDL rebin in python
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
# 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'] }
# 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)