Пример #1
0
    if n == "":
        n = "??"
    st = "%s_%s" % (n,s)
    if l == "":
        l = "??"
    ch = "%s-%s" % (l,c)
    print "processing '%s'" % file
    print "  reading ...",
    timer.start()
    fh = open(file, 'r')
    lines = fh.readlines()
    fh.close()
    print "done (%f seconds)" % timer.split()
    print "  parsing ...",
    dataless = Dataless(lines, quiet=True)
    dataless.process()
    print "done (%f seconds)" % timer.split()
    print "  calculating ...",
    calib = Calib(dataless, st, ch)
    calib.calculate_calib(period, correct)
    results[key] = calib
    print "done (%f seconds)" % timer.split()
    timer.stop()
    print "took %f seconds" % timer.span()
    print

for resp,calib in sorted(results.items()):
    cor_str = ""
    if correct:
        cor_str = " (corrected)"
    print "[%s]>  CALPER=%f  CALIB=%f%s" % (resp.ljust(19), calib.calper, calib.calib, cor_str)
Пример #2
0
import pprint

from jtk.Dataless import Dataless
from jtk import Pretty
import Queue

def get_file_lines(file):
    return open(file, 'r').readlines()

file = "/qcwork/datalessSTUFF/littlesdataless" # EVERYTHING!
file = "/qcwork/datalessSTUFF/littlesANMO" # just ANMO

engine = Dataless(get_file_lines(file))

try:
    engine.process()
except Exception, e:
    print "Caught an Exception at:"
    print "  file '%s'" % file
    print "  %d lines skipped" % engine.skipped
    print "  on line %d of %d" % (engine.count, engine.total)
    print "    [%s]" % engine.line
    print
    print "Exception Details:"
    exc_type,exc_value,exc_traceback = sys.exc_info()                                               
    print traceback.format_exc()

#Pretty.pretty(engine.map)

for st_name,data in engine.map['stations'].items():
    channels = data['channels']