Created
February 17, 2012 12:13
-
-
Save gadamc/1853014 to your computer and use it in GitHub Desktop.
extract template with function
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 | |
import couchdbkit | |
s = couchdbkit.Server('https://edwdbik.fzk.de:6984') | |
db = s['pulsetemplates'] | |
vr = db.view('analytical/bychandate', startkey=['chalA FID807', '2012-02-17 13:09:14'], limit=1, reduce=False, descending=True, include_docs=True) | |
doc = vr.first()['doc'] | |
exec(doc['formula']['python']) #defines template function | |
templatePulse = [] | |
for i in range(512): | |
templatePulse.append( template(2.016*i, doc['formula']['par'])) | |
print templatePulse | |
print '' | |
print 'the template is printed out above... now I am trying to graphically plot it with matplotlib. be patient with slow networks...' | |
import matplotlib.pyplot as plt | |
import numpy as np | |
plt.ion() | |
plt.plot(np.array(templatePulse)) | |
raw_input('hit enter to quit') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
output: http://hop.tl/MHhUPL8pTqX7azg3S4