def main(): if len(sys.argv) < 3: print "Usage: %s [sqlite database] [destination file]" % os.path.basename( __file__) print "The destination file can be .xls or .csv." exit(1) src = sys.argv[1] dst = sys.argv[2] if not os.path.exists(src): print "File '%s' does not exist. Call export_results.m for your experiment first?" % src exit(2) db = sqlShort(host=src, type='sqlite') dat = read_db(db) del db _, ext = os.path.splitext(dst) if ext == '.xls': export_to_xls(dat, dst) elif ext == '.csv': export_to_csv(dat, dst) else: print "Format '%s' is not implemented." % ext exit(3)
#!/usr/bin/env python # -*- coding: utf-8 -*- from numpy import * from scipy import * from matplotlib import pylab from sqlShort import sqlShort db = sqlShort(host='results/jvo_db.sqlite', type='sqlite') ref_voices, ref_f0s, ref_sers = db.query(""" SELECT ref_voice, ref_f0, ref_ser FROM thr GROUP BY ref_voice ORDER BY ref_voice DESC """) subject_clause = ' ' voices = dict() for ref_voice, ref_f0, ref_ser in zip(ref_voices, ref_f0s, ref_sers): voices[ref_voice] = (ref_f0, ref_ser) #subject_clause = " AND subject='S01b' " cm = array([[207, 82, 10], [237, 186, 70], [78, 164, 38], [25, 112, 176], [149, 38, 138], [250, 90, 0], [200, 0, 0], [0, 150, 255], [158, 204, 59], [54, 102, 255]]) / 255. cols = {'female': cm[0], 'male': cm[3], 'child': cm[2]} lw = 2
from numpy import * from scipy import * from matplotlib import pylab from sqlShort import sqlShort cm = array([[207, 82, 10], [237, 186, 70], [78, 164, 38], [25, 112, 176], [149, 38, 138], [250, 90, 0], [200, 0, 0], [0, 150, 255], [158, 204, 59], [54, 102, 255]]) / 255. #cols = {'female': cm[0], 'male': cm[3], 'child': cm[2]} cols = {'NH': cm[2], 'CI': cm[3], 'AB': cm[3], 'Cochlear': cm[1]} lw = 2 dbd = dict() dbd['CI'] = sqlShort(host='results/jvo_db.sqlite', type='sqlite') dbd['NH'] = sqlShort( host= '/Users/egaudrain/Experiments/2013-J-VO GPR-VTL jnd/2013-05-07 - Exp.1 - Resolution/results/jvo_db.sqlite', type='sqlite') fig = pylab.figure() ax = fig.add_axes((.12, .1, .8, .8)) xTickLabel = list() ciVal = list() for k in dbd.keys(): print k
# -*- coding: utf-8 -*- from numpy import * from scipy import * from matplotlib import pylab from sqlShort import sqlShort cm = array([[207, 82, 10], [237, 186, 70], [78, 164, 38], [25, 112, 176], [149, 38, 138], [250, 90, 0], [200, 0, 0], [0, 150, 255], [158, 204, 59], [54, 102, 255]])/255. #cols = {'female': cm[0], 'male': cm[3], 'child': cm[2]} #cols = {'NH': cm[2], 'CI': cm[3], 'AB': cm[3], 'Cochlear': cm[1]} cols = {'NH': cm[2], 'CI': cm[3], 'AB': cm[3], 'Cochlear': cm[3]} lw = 2 dbd = dict() dbd['CI'] = sqlShort(host='results/jvo_db.sqlite', type='sqlite') dbd['NH'] = sqlShort(host='/Users/egaudrain/Experiments/2013-J-VO GPR-VTL jnd/2013-05-07 - Exp.1 - Resolution/results/jvo_db.sqlite', type='sqlite') fig = pylab.figure() ax = fig.add_axes((.12, .1, .8, .8)) xTickLabel = list() ciVal = list() for k in dbd.keys(): print k db = dbd[k] ref_voices, ref_f0s, ref_sers = db.query("""
#!/usr/bin/env python # -*- coding: utf-8 -*- from numpy import * from scipy import * from matplotlib import pylab from sqlShort import sqlShort db = sqlShort(host='results/jvo_db.sqlite', type='sqlite') ref_voices, ref_f0s, ref_sers = db.query(""" SELECT ref_voice, ref_f0, ref_ser FROM thr GROUP BY ref_voice ORDER BY ref_voice DESC """) subject_clause = ' ' voices = dict() for ref_voice, ref_f0, ref_ser in zip(ref_voices, ref_f0s, ref_sers): voices[ref_voice] = (ref_f0, ref_ser) #subject_clause = " AND subject='S01b' " cm = array([[207, 82, 10], [237, 186, 70], [78, 164, 38], [25, 112, 176], [149, 38, 138], [250, 90, 0], [200, 0, 0], [0, 150, 255], [158, 204, 59], [54, 102, 255]])/255. cols = {'female': cm[0], 'male': cm[3], 'child': cm[2]} lw = 2 fig = pylab.figure() ax = fig.add_axes((.12, .1, .8, .8))