chfile = outsuf + thre_str + '_' + dset + '-OLR.synop' if os.path.isfile(chfile): print "MetBot already run on this model: " + name continue # goes back to the beginning of the for loop else: print "Running for the first time on: " + name plt.ion() ### 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,
dsrc = picdir # CHANGE ACCORDINGLY IF ALREADY HAVE THIS DATA olr, time, lat, lon, dtime = mync.openolr(dsrc + 'olr.day.mean.nc', 'olr', subs=sub) 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: