Ejemplo n.º 1
0
                                   mbt, chull)
                        del mbs, mbt, chull

                ### Get synop file
                if synoptics:
                    refmbstr = dset + "-olr-0-0"
                    refall = dset + "-olr-0-all"
                    reffull = dset + "-olr-0-full"
                    metblobslist = [refmbstr, refall, reffull]
                    mfilelist = [
                        outsuf + thre_str + '_' + j + '.mbs'
                        for j in metblobslist
                    ]
                    print mfilelist
                    s = sy.SynopticEvents(metblobslist,
                                          mfilelist,
                                          hrwindow=hrwindow)
                    s.buildtracks()
                    s.buildevents(basetrkkey=refmbstr)
                    u = s.uniqueevents()
                    syfile = outsuf + thre_str + '_' + dset + '-OLR.synop'
                    s.save(syfile)
                    del s

                ### Add event rain
                if addrain:

                    globp = 'pr'

                    ### Open rain data
                    if dset == 'noaa':
Ejemplo n.º 2
0
        thresh = int(thresh)
        thisthresh = thresh
        thre_str = str(int(thisthresh))

        ###  Open synop file
        sydir = botdir + dset + '/' + name + '/'
        sysuf = sydir + name + '_'
        mbsfile = sysuf + thre_str + '_' + dset + "-olr-0-0.mbs"
        refmbs, refmbt, refch = blb.mbopen(mbsfile)
        refmbt[:, 3] = 0

        if from_event == 'first':

            syfile = sysuf + thre_str + '_' + dset + '-OLR.synop'
            s = sy.SynopticEvents((), [syfile], COL=False)
            ks = s.events.keys()
            ks.sort()
            refkey = s.mbskeys[0]
            count_all = str(int(len(ks)))
            print "Total CBs flagged =" + str(count_all)

            ev_dts = []
            ev_keys = []
            ev_cXs = []
            ev_chs = []

            for k in ks:
                e = s.events[k]
                dts = s.blobs[refkey]['mbt'][e.ixflags]
                for dt in range(len(dts)):
Ejemplo n.º 3
0
            exec("ixt,[time,%s,dtime]=\
                  my.ixtwindow(reftime,time,hrwindow,time,%s,dtime)"\
                   %(varstr,varstr) )
            mbs, mbt, chull = blb.MetBlobs(olr,dtime,time,lat,lon,v,\
                                      sub=sub,showblobs=showblb,interact=False)
            blb.mbsave(picdir+v+".mbs",mbs,mbt,chull)
            del mbs,mbt,chull
        if noaaolrfull:
            v="noaa-olr-0-full"
            dset,varstr, lev, drv = v.split('-')
            mbs, mbt, chull = blb.MetBlobs(olr,dtime,time,lat,lon,v,\
                                      sub=sub,showblobs=showblb,interact=False)
            blb.mbsave(picdir+v+".mbs",mbs,mbt,chull)
            del mbs,mbt,chull
        
if synoptics:
    refmbstr="noaa-olr-0-0"
    refall="noaa-olr-0-all"
    reffull="noaa-olr-0-full"
    metblobslist=[refmbstr,refall,reffull]
    mfilelist=[picdir+j+'.mbs' for j in metblobslist]
    print mfilelist
    s = sy.SynopticEvents(metblobslist,mfilelist,hrwindow=hrwindow)
    s.buildtracks()
    s.buildevents()
    u = s.uniqueevents()
    s.save(picdir+'NOAA-OLR.synop')
    del s

print 'TOTAL TIME TAKEN FOR test.py is:',(tmr.time()-tstart)/60,'mins'