Personal tools
You are here: Home Comunità zopemaster's Home Programmazione GPyB impedance measurements

Daniele Paganelli


alias mythsmith

  • Blog
  • Feed RSS
    Iscriviti al diario, con il feed RSS (?)
  • Emopiano
    Imporvvisazioni al pianoforte ed alla tastiera (del computer :)
  • Università
    Documenti redatti per/a/con l'Università
  • Programmazione
    La mia limitata biblioteca personale di script, principalmente in Python.
  • Macropost
    Testi molto lunghi, inadatti per il blog.
  • Segnalibri
    I miei segnalibri direttamente da Firefox... quando mi ricordo di aggiornarli!

Sinapsi

  • AGESCI zona di Modena
    (curato da me, si nota? ;-)
  • Magnatune
    Etichetta discografica online. Musica di alta qualità con licenza CreativeCommons. Anteprime gratuite e complete di qualsiasi album... Attenzione: rischi di non uscirne più fuori!!!
  • Conoscere Linux
    Il Linux User Group di Modena, cui sono associato dalla fondazione.
  • Slack.it
    Wiki di un amico...
  • Punto Informatico
    I miei inutili interventi sulla rivista online più antica d'italia...
  • Oblivion999
    Un gruppo metal
  • Fax via eMail
    Il servizio che utilizzo per inviare e ricevere fax via eMail per lavoro.



Contatti Personali:
  • Jabber: dapa@jabber.org
    Per accedere alla rete Jabber usa Gaim oppure Google Talk
  • Posta: daniele.chioccia.modena1.it
  • OpenWengo: paganoide
  • Perché evito MSN?
 
Document Actions

impedance measurements

by mythsmith last modified 2007-05-18 06:44 PM

This script was made to do impedance measurements with an hardware that suddenly borke... :( I think it will not be useful for anyone!

#!/usr/bin/python
''' This is the text frontend to impedance measurements using EiFraExp class.
To start it in interactive mode, go to the program folder and type 'impedance'. It will read
non-asked setting from eifra_cnf.py
Optional arguments:
?  Will show this message
mode='mode string' Will start this program in the mode 'mode'. Valid mode strings are:
    'i'  Interactive mode, (default)
    'q'  Quiet mode. Will read all data from config file.
    ! Note: if the cfg file is in the same directory, you can omit the path and specify only
    file name. Otherwise, write the entire path!
    '''

from erc import *
from sys import path, argv
print str(argv) from os.path import basename, dirname, exists
from time import time
import os
if '?' in argv: print ''' This is the text frontend to impedance measurements using EiFraExp class. To start it in interactive mode, go to the program folder and type 'impedance.py'. It will read non-asked setting from eifra_cnf.py Optional arguments: ? Will show this message Valid argument strings are: 'q' Quiet mode. Will read all data from config file. 'r' Read-only mode.Useful if you made a manual measurament and want to save the results as specified in config file. cfg='/path/to/cfg/file' ! Note: if the cfg file is in the same directory, you can omit the path and specify only file name. Otherwise, write the entire path! ''' cfg='eifra_cnf.py' pth=None
for opt in argv: if 'cfg=' in opt: opt=opt.replace('cfg=','').replace('\'','') while inpt not in ['','y','yes',1]: if exists(opt): cfgf=basename(opt) pth=dirname(opt) else: cfgf='eifra_cnf' inpt=raw_input('Cfg file not found. Please enter another file path, or press return to use eifra_cnf.py') if 'mode=' in opt: mode=opt.replace('mode=','').replace('\'','') else: mode='i' cfgf=cfg.replace('.py','') path+=['/home/daniele/prg',pth] cmd="from "+cfgf+' import loops, hd, mysql, mycomment';exec(cmd) exp=EiFraExp() if 'q' not in argv: exp.setup(cfg=cfgf) else: exp.setup(cfg=cfgf,set=0) if 'r' not in argv: exp.send_ei() exp.send_custom_ei() exp.send_fra() exp.send_custom_fra() for loop in range(loops): print 'Loop number '+str(loop+1) exp.loop(num=loop+1) print 'Reading buffer...' sleep(3) r=exp.read_buffer() print exp.data
print '\a\a\a' #print 'Done. Plotting the result.' else: print "Read only mode" print "Reading the buffer.." exp.send_ei() r=exp.read_buffer() if r==0: print 'Saving data as specifyed in config file.' dsm=DataStorageManager(cfgf,exp) if hd==1: dsm.store2f() if mysql==1: if mycomment==None: mycomment=raw_input('Type a comment for this record: ') dsm.store2my() #exp.fra.wrt('TT0') else: print r
print 'Impossible to save data. Something went wrong. Read the output for more info. '

hosting
Iniziative che sponsorizziamo:
Scopri altri siti scout!
Sito precedente 5o sito precedente Home ScoutRing Lista dei Siti Sito Casuale Sito successivo 5o sito successivo
Informati e protesta contro il DRM!
Powered by Plone, the Open Source Content Management System