### Get mbs 0-0 if getmbs: v = dset + "-olr-0-0" daset, globv, lev, drv = v.split('-') mbs, mbt, chull = blb.MetBlobs_th(olr,dtime,time,lat,lon,v,thisthresh,\ sub=sub,showblobs=showblb,interact=intract,debugplots=debugplots) blb.mbsave(outsuf + thre_str + '_' + v + ".mbs", mbs, mbt, chull) del mbs, mbt, chull ### Get mbs 0-all if olrall: refmbsstr = dset + "-olr-0-0" refmbs, refmbt, refch = blb.mbopen(outsuf + thre_str + '_' + refmbsstr + ".mbs") reftime = refmbs[:, 0] v = dset + "-olr-0-all" daset, varstr, lev, drv = v.split('-') # Get data subset for days before and after CBs ixt, [time4all, olr4all, dtime4all ] = my.ixtwindow(reftime, time, hrwindow, time, olr, dtime) mbs, mbt, chull = blb.MetBlobs_th(olr4all,dtime4all,time4all,lat,lon,v,thisthresh,\ sub=sub,showblobs=showblb,interact=False) blb.mbsave(outsuf + thre_str + '_' + v + ".mbs", mbs, mbt, chull) del mbs, mbt, chull
thre_str = str(thisthresh) # Find TTT data print 'Opening MetBot files...' botpath = botdir + dset + '/' + name + '/' outsuf = botpath + name + '_' mbsfile = outsuf + thre_str + '_' + dset + "-olr-0-0.mbs" syfile = outsuf + thre_str + '_' + dset + '-OLR.synop' s = sy.SynopticEvents((), [syfile], COL=False) ks = s.events.keys() ks.sort() # all refkey = s.mbskeys[0] refmbs, refmbt, refch = blb.mbopen(mbsfile) # First do the processing that is going to apply to the whole figure # first day of event or all days? i.e. number of events or number of CBs # remove duplicate dates? # Get lots of info about event set print 'Getting more info about each cloud band...' dates, cXs, cYs, degs, chs, keys, daynos, tworecdt = sset.evset_info( s, refmbs, refmbt) # If wanting first day of event only, subset print 'Subset by first day?...' if from_event == 'first': print 'Selecting first day of event only' dates_d, cXs_d, cYs_d, degs_d, chs_d, keys_d, daynos_d, tworecdt_d = \
olr = olr[1675:, :, :] time = time[1675:] dtime = dtime[1675:] if testyear: olr, dtime, time = olr[:365, :, :], dtime[:365], time[:365] if getdistr: showme = blb.gethists(olr, time, lat, lon, v, sub=sub, figd=figdir) # CALLS TO METBLOBS plt.ion() if getmbs: 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 noaaolrall: refmbsstr = "noaa-olr-0-0" refmbs, refmbt, refch = blb.mbopen(picdir + refmbsstr + ".mbs") reftime = refmbs[:, 0] v = "noaa-olr-0-all" dset, varstr, lev, drv = v.split('-') 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)