示例#1
0
    def test():
        data = FitxerRugRealitzacio("rug.dat")
        mitjana_ = data.mitjana()

        bd = BurstDetector(data)
        bd.set_threshold(mitjana_)
        bursts = bd.bursts()

        bi = BurstIntegrator(bursts)
        print bi
示例#2
0
    def test():
        data = FitxerEneRealitzacio("./ene.dat")
        print data
        mitjana_ = data.mitjana()

        bd = BurstDetector(data)
        bd.set_threshold(mitjana_)
        bursts = bd.bursts()

        print "mitjana:", mitjana_
        bi = BurstIntegrator(bursts)
        print bi

        tl = TimeLapses(bursts)
        print tl
示例#3
0
def main(directori):
    stressmf = os.path.join(directori, "stressm.dat")
    data = RealitzacioDStressm(stressmf)
    threshold = data.threshold()
    
    bd = BurstDetector(data)
    bd.set_threshold(threshold)

    bursts = bd.bursts()
    bi = BurstIntegrator(bursts)
    bi.integrate_with_x_from(column=3)
    outfile = os.path.join(directori, "burst_dstressm.dat")
    outfile = open(outfile, 'w')
    print >> outfile, bi
    print >> sys.stderr, "printing", outfile.name
    outfile.close()
示例#4
0
def main(directori, threshold=None, outfile="burst.dat"):
    fitxer = os.path.join(directori, "rug.dat")

    data = FitxerRugRealitzacio(fitxer)
    # amb aquest donava bé!!!
    #if threshold is None:
        #threshold = data.mitjana() / 10. # el / 10. el copio de energy
    threshold = data.threshold() 

    bd = BurstDetector(data)
    bd.set_threshold(threshold)
    bursts = bd.bursts()

    bi = BurstIntegrator(bursts)
    bi.integrate_with_x_from(column=3)

    outfile = os.path.join(directori, outfile)
    assert_file_is_empty (outfile)
    outfile = open(outfile,"w")
    print >> outfile, bi
    print >> sys.stderr, "printing", outfile.name
    outfile.close()
示例#5
0
def main(directori, threshold=None, outfile="burst_dW.dat", outfile_time_lapses="time_lapses.dat"):
    fitxer = os.path.join(directori, "eneNow.dat")
    data = FitxerEneRealitzacio(fitxer)
    # if threshold is None:
    # threshold = data.mitjana()/10.
    threshold = data.threshold()

    bd = BurstDetector(data)
    bd.set_threshold(threshold)
    bursts = bd.bursts()

    bi = BurstIntegrator(bursts)
    bi.integrate_with_x_from(column=3)
    bm = BurstMaxims(bursts)

    outfile = os.path.join(directori, outfile)
    assert_file_is_empty(outfile)
    outfile = open(outfile, "w")
    print >> outfile, bi
    print >> sys.stderr, "printing", outfile.name
    outfile.close()

    outfile = os.path.join(directori, "burst_maxims.dat")
    assert_file_is_empty(outfile)
    outfile = open(outfile, "w")
    print >> outfile, bm
    print >> sys.stderr, "printing", outfile.name
    outfile.close()

    tl = TimeLapses(bursts)
    outfile = os.path.join(directori, outfile_time_lapses)
    assert_file_is_empty(outfile)
    outfile = open(outfile, "w")
    print >> outfile, tl
    print >> sys.stderr, "printing", outfile.name
    outfile.close()