Skip to content

Instantly share code, notes, and snippets.

@mattkoes
Created February 1, 2012 21:28
Show Gist options
  • Save mattkoes/1719577 to your computer and use it in GitHub Desktop.
Save mattkoes/1719577 to your computer and use it in GitHub Desktop.
plot greens functions
# Read in a Kao GF
# Print the file
from string import *
import matplotlib.pyplot as plt
# Open Greens function file for reading with a given filename
GF = open("kaogf.txt","r")
# Read in lines and split into a list
ln = GF.readline()
data = split(ln)
while ln != '':
ln = GF.readline()
data += split(ln)
size = len(data)
print "the length of the file is ", size
# Cutout Headers
data = data[3:size-1]
size = len(data)
print "the length of the file is ", size
# Plot Greens Functions
plt.hold(True)
plt.figure(1)
for i in range(1,13):
n = 101
temp_data = data[n*(i-1):n*i]
plt.subplot(6,2,i)
plt.plot(temp_data)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment