Created
February 1, 2012 21:28
-
-
Save mattkoes/1719577 to your computer and use it in GitHub Desktop.
plot greens functions
This file contains 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
# 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