Skip to content

Instantly share code, notes, and snippets.

View mef51's full-sized avatar

Mohammed Chamma mef51

  • Gaza, Palestine
View GitHub Profile
@Zulko
Zulko / zombie_france.py
Last active May 24, 2024 21:54
Zombie pandemic simulation in France
"""
Model of a Zombie outbreak in France, starting in Grenoble
This is a rewrite from this blog post by Max Berrgren:
http://maxberggren.github.io/2014/11/27/model-of-a-zombie-outbreak/
with a different country, a slightly different model, and different
libraries. The map of population density is taken from Wikimedia Commons
@cwyenberg
cwyenberg / CorrFns.py
Created May 18, 2020 18:57
Python autocorrelation functions; 1D and 2D exploiting FFT identity for speedup, one vanilla 1D not using FFT
import numpy as np
def auto_corr(data, normalize=True):
# Performs an autocorrelation on data
# Note that for data size n_data, we autocorrelate to 2*n_data-1 points
# (i.e. this returns a larger array than passed)
n_data = data.shape[0] # Number of data points in the input data
n_ac = 2*n_data-1 # Autocorrelation array size