def load_data(self, button): file_chooser = gtk.FileChooserDialog(title='CSV Datei laden', buttons=(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN, gtk.RESPONSE_OK)) result = file_chooser.run() if result == gtk.RESPONSE_OK: self.data = load_csv(file_chooser.get_filename()) self.refresh() file_chooser.destroy()
#!/usr/bin/python # -*- coding: utf-8 -*- import os import sys from sitforc import modellib, load_csv from sitforc.core import RegressionIdentifier, ITMIdentifier with open('results.txt', 'w') as f_out: sys.stdout = f_out for filename in os.listdir(''): if filename.endswith('.csv'): print 'File: {0}'.format(filename) x, y = load_csv(filename) ident = RegressionIdentifier(x, y, modellib.pt2) mf = ident.model_fitter print 'Params for PT-2 Model: {0}'.format(mf.params) degree = 11 ident = ITMIdentifier(x, y, degree) print 'Params for ITM' print 'Tu\t\t{0:.3f}'.format(ident.tu) print 'Tg\t\t{0:.3f}'.format(ident.tg) print 'Tu/Tg\t\t{0:.3f}'.format(ident.tu/ident.tg) print
#!/usr/bin/python # -*- coding: utf-8 -*- from sitforc import modellib, load_csv, identify_reg, identify_itm x, y = load_csv('data.csv') print 'Identification with regression model of 3rd-order time-delay element:\n' identify_reg(x, y, modellib.pt3 , shift=1.8) print '\n' print 'Identification with inflectional tangent method:\n' identify_itm(x, y, shift=1.8)