# #a2maxgrad2.tofile(maxgrad2name) ##--- figure: max grad2 ---- #datname = maxgrad2name #a2maxgrad2 = fromfile(datname, float32).reshape(ny,nx) *1000.0*1000.0 # (m/km) #a2maxgrad2 = ma.masked_greater_equal(a2maxgrad2, thgrad2) #figname = datname[:-7] + ".png" #cbarname = datname[:-7] + ".cbar.png" #ctrack_fig.mk_pict_saone_reg(a2maxgrad2, soname=figname, cbarname=cbarname) #print figname #--- figure: max orog ---- datname = maxorogname a2maxorog = ma.masked_greater_equal(fromfile(datname, float32).reshape(ny,nx), thorog) figname = datname[:-7] + ".png" cbarname = datname[:-7] + ".cbar.png" ctrack_fig.mk_pict_saone_reg(a2maxorog, soname=figname, cbarname=cbarname) print figname ##--- figure: max grad ---- #datname = maxgradname #a2maxgrad = fromfile(datname, float32).reshape(ny,nx) *1000.0 # (m/km) #a2maxgrad = ma.masked_greater_equal(a2maxgrad, thgrad) #figname = datname[:-7] + ".png" #cbarname = datname[:-7] + ".cbar.png" #ctrack_fig.mk_pict_saone_reg(a2maxgrad, soname=figname, cbarname=cbarname) #print figname
a2figdat = fromfile(datname, float32).reshape(ny,nx) #------------------------------- #--- unit ---- totaldays = ctrack_para.ret_totaldays(iyear,eyear,season) a2figdat = ma.masked_equal(a2figdat, miss).filled(0.0) * 100.0 #a2figdat = ma.masked_equal(a2figdat, miss).filled(0.0) * totaldays / len(lyear) #-- filter -------------- if filterflag == True: #a2figdat = myfunc_fsub.mk_a2convolution(a2figdat.T, a2filter.T, miss).T a2figdat = ctrack_fsub.mk_a2radsum_saone(a2figdat.T, filtradkm, miss).T a2figdat = a2figdat / a2areanum elif filterflag ==False: pass else: print "check filterflag",filterflag sys.exit() #------------------------ #-- per 3.0 degree box -- if sum3x3flag == True: a2figdat = myfunc_fsub.mk_3x3sum_one(a2figdat.T, miss).T #------------------------------- ctrack_fig.mk_pict_saone_reg(a2figdat, lllat=lllat, lllon=lllon, urlat=urlat, urlon=urlon, bnd=bnd, mycm=mycm, soname=figname, stitle=stitle, miss=miss, a2shade=a2shade, cbarname=cbarname) print figname
0.000029, 0.000032, ] cbarname = "/home/utsumi/temp/grad.cbar.png" ##---- fig :chart -- fignamechart = "/home/utsumi/temp/chart.%04d.%02d.%02d.%02d.png" % (year, mon, day, hour) # ctrack_fig.mk_pict_saone_reg(a2chart, lllat=lllat, lllon=lllon, urlat=urlat, urlon=urlon, soname=fignamechart,miss=-9999.0,cbarname="self") # -- gradt ---- fignamegradt = "/home/utsumi/temp/gradt.%04d.%02d.%02d.%02d.png" % (year, mon, day, hour) ctrack_fig.mk_pict_saone_reg( a2gradt, lllat=lllat, lllon=lllon, urlat=urlat, urlon=urlon, soname=fignamegradt, miss=-9999.0, cbarname=cbarname, bnd=bnd, ) print fignamegradt # -- loc.gradt -- figname = "/home/utsumi/temp/loc.gradt.%04d.%02d.%02d.%02d.png" % (year, mon, day, hour) ctrack_fig.mk_pict_saone_reg( a2gradt, lllat=lllat, lllon=lllon, urlat=urlat, urlon=urlon,
#ctrack_fig.mk_pict_saone_reg(a2gradorogmask, soname=fig_gradorog_adj_name, cbarname=cbarname, bnd=bnd) #print gradorog_adj_name #-- adj orog & grad orog ---- orogname = "/media/disk2/data/JRA25/sa.one/const/topo/topo.sa.one" gradorog_adj_name = "/media/disk2/data/JRA25/sa.one/const/topo/grad.topo.adj.twogrids.sa.one" fig_gradorog_adj_name = "/media/disk2/data/JRA25/sa.one/const/topo/grad.topo.adj.twogrids.png" a2orog = fromfile(orogname, float32).reshape(ny,nx) a2gradorog = dtanl_fsub.mk_a2grad_abs_saone(a2orog.T).T a2gradorogmask = dtanl_fsub.mk_a2adj_multigrids(a2gradorog.T, 2).T *1000.0 # m/km bnd = [0.0, 2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0] a2gradorogmask.tofile(gradorog_adj_name) ctrack_fig.mk_pict_saone_reg(a2gradorogmask, soname=fig_gradorog_adj_name, cbarname=cbarname, bnd=bnd) print gradorog_adj_name #-- orog fmask ---- orogname = "/media/disk2/data/JRA25/sa.one/const/topo/topo.sa.one" soname = "/media/disk2/data/JRA25/sa.one/const/topo/grad.topo.fmasked.sa.one" figname = "/media/disk2/data/JRA25/sa.one/const/topo/grad.topo.fmasked.png" a2orog = fromfile(orogname, float32).reshape(ny,nx) a2gradorog = dtanl_fsub.mk_a2grad_abs_saone(a2orog.T).T a2out = mk_orogmask_loc(a2orog, a2gradorog, thorogmask1, thorogmask2) a2out = a2out.filled(miss) bnd = [0.0, 2.0, 4.0, 6.0, 8.0, 10.0, 12.0, 14.0]
gradname = "/media/disk2/data/JRA25/sa.one.125/const/topo/maxgrad.0200km.sa.one" a2orog = fromfile(orogname, float32).reshape(ny,nx) a2gradorog = fromfile(gradname, float32).reshape(ny,nx) orogname = "/media/disk2/data/CMIP5/sa.one.%s.%s/orog/orog.%s.sa.one"%(model,expr,model) gradorogname = "/media/disk2/data/CMIP5/sa.one.%s.%s/orog/maxgrad.0200km.sa.one"%(model,expr) a2orog = fromfile(orogname, float32).reshape(ny,nx) a2gradorog = fromfile(gradorogname, float32).reshape(ny,nx) a2shade = ones([ny,nx],float32) a2shade = ma.masked_where(a2orog > thorog, a2shade) a2shade = ma.masked_where(a2gradorog > thgradorog, a2shade) #--- data processing ------ frontdir_t_root = "/media/disk2/out/CMIP5/sa.one.%s.%s/6hr/front.t"%(model,expr) frontdir_t = frontdir_t_root + "/%04d%02d"%(year, mon) fronttname1 = frontdir_t + "/front.t.M1.%04d.%02d.%02d.%02d.sa.one"%(year, mon, day, hour) fronttname2 = frontdir_t + "/front.t.M2.%04d.%02d.%02d.%02d.sa.one"%(year, mon, day, hour) a2fbc1 = fromfile(fronttname1, float32).reshape(ny,nx) a2fbc2 = fromfile(fronttname2, float32).reshape(ny,nx) a2fbc = front_func.complete_front_t_saone(a2fbc1, a2fbc2, thfmask1t, thfmask2t, a2orog, a2gradorog, thorog, thgradorog, thgrids, miss ) #--- draw ----- figname = "./temp.front.png" stitle = "%s %s %04d-%02d-%02d UTC%02d"%(model, expr, year,mon,day,hour) ctrack_fig.mk_pict_saone_reg(a2in=a2fbc, soname=figname, stitle=stitle, lllat=lllat, lllon=lllon, urlat=urlat, urlon=urlon, a2shade=a2shade)
a2gradthetae500y = a2gradthetae500y.T # a2thetaeadv500 = (a2umean500 * a2gradthetae500x + a2vmean500 * a2gradthetae500y)*3600*24. #--- mask layers ----------- a2mask = ones([ny,nx],float32) #a2mask = ma.masked_where(a2gradtmean > thgradtheta, a2mask) #a2mask = ma.masked_where(a2gradqmean < thgradq, a2mask) #a2mask = ma.masked_where( ma.masked_outside(a2sta, -thsta, thsta).mask, a2mask) a2mask = ma.masked_where( a2dsta_adv_lateral > thdsta, a2mask) a2mask = a2mask.filled(miss) #--- figure baiu ---------- bnd = [0.5, 1.0, 1.5, 2.0, 2.5, 3.0] #bnd = False ctrack_fig.mk_pict_saone_reg(a2gradqmean*1.e+8, a2shade=a2mask, soname="./baiu.gradq.png", bnd=bnd, mycm="jet",cbarname="./baiu.gradq.cbar.png") ##---- figure s.d.vort ------- #bnd = [0,10,20,30,40,50] #ctrack_fig.mk_pict_saone_reg(a2sd_vort850, soname="./s.d.vort850.png", bnd=bnd, mycm="jet",cbarname="./s.d.vort.cbar.png") #ctrack_fig.mk_pict_saone_reg(a2sd_vort500, soname="./s.d.vort500.png", bnd=bnd, mycm="jet",cbarname="./s.d.vort.cbar.png") #--- figure gradq 6h ------- bnd = [0.5, 1.0, 1.5, 2.0, 2.5, 3.0] #bnd = False ctrack_fig.mk_pict_saone_reg(a2gradq6h*1.e+8, soname="./grad.q.6h.png", bnd=bnd, mycm="jet",cbarname="./grad.q.cbar.png") #--- figure gradq ---------- bnd = [0.5, 1.0, 1.5, 2.0, 2.5, 3.0] #bnd = False ctrack_fig.mk_pict_saone_reg(a2gradq*1.e+8, soname="./grad.q.day.png", bnd=bnd, mycm="jet",cbarname="./grad.q.cbar.png")
#-- fig: frac prep - bnd = range(6, 70+1, 8) #bnd = [10,20,30,40,50,60,70,80,90] bnd_all = [10,20,30,40,50,60,70,80,90] cbarname = figdir + "/frac.cbar.png" cbarname_all = figdir + "/frac.cbar.all.png" a2shade = ma.masked_equal(a2domain, 0.0).filled(miss) a2shade = ma.masked_where(a2orog >1500.0, a2shade).filled(miss) coef = 100.0 stitle = "proportion (%%), %s "%(season) mycm = "Spectral" lllon, lllat, urlon, urlat = chart_para.ret_domain_corner_rect_forfig(region_draw) #-- fig: frac draw - ctrack_fig.mk_pict_saone_reg(a2frac_warm, bnd, mycm, fracname_warm, stitle+"warm", cbarname, miss, lllat=lllat, lllon=lllon, urlat=urlat, urlon=urlon, a2shade=a2shade, coef=coef, lonlatfontsize=lonlatfontsize, lonrotation=lonrotation) ctrack_fig.mk_pict_saone_reg(a2frac_cold, bnd, mycm, fracname_cold, stitle+"cold", cbarname, miss, lllat=lllat, lllon=lllon, urlat=urlat, urlon=urlon, a2shade=a2shade, coef=coef, lonlatfontsize=lonlatfontsize, lonrotation=lonrotation) ctrack_fig.mk_pict_saone_reg(a2frac_occ, bnd, mycm, fracname_occ, stitle+"occ", cbarname, miss, lllat=lllat, lllon=lllon, urlat=urlat, urlon=urlon, a2shade=a2shade, coef=coef, lonlatfontsize=lonlatfontsize, lonrotation=lonrotation) ctrack_fig.mk_pict_saone_reg(a2frac_stat, bnd, mycm, fracname_stat, stitle+"stat", cbarname, miss, lllat=lllat, lllon=lllon, urlat=urlat, urlon=urlon, a2shade=a2shade, coef=coef, lonlatfontsize=lonlatfontsize, lonrotation=lonrotation) ctrack_fig.mk_pict_saone_reg(a2frac_all, bnd_all, mycm, fracname_all, stitle+"all", cbarname_all, miss, lllat=lllat, lllon=lllon, urlat=urlat, urlon=urlon, a2shade=a2shade, coef=coef, lonlatfontsize=lonlatfontsize, lonrotation=lonrotation) ctrack_fig.mk_pict_saone_reg(a2frac_cwo, bnd, mycm, fracname_cwo, stitle+"cwo", cbarname, miss, lllat=lllat, lllon=lllon, urlat=urlat, urlon=urlon, a2shade=a2shade, coef=coef, lonlatfontsize=lonlatfontsize, lonrotation=lonrotation) print fracname_all
#------------------------- a2mthermo = a2sthermo / ntimes a2mgrad = a2sgrad / ntimes a2mloc = a2sloc / ntimes # a2stdthermo = (( a2sthermo2 - 2.0*a2mthermo*a2sthermo + ntimes*a2mthermo**2.0) /ntimes)**0.5 /a2mthermo a2stdgrad = (( a2sgrad2 - 2.0*a2mgrad*a2sgrad + ntimes*a2mgrad**2.0) /ntimes)**0.5 / a2mgrad #-- figure --------------- figdir = "/media/disk2/out/JRA25/sa.one/6hr/tenkizu/%02dh/mean/fig" figdir = "." figmthermoname = figdir + "/mthermo.%s.png"%(season) figmgradname = figdir + "/mgrad.%s.png"%(season) figmlocname = figdir + "/mloc.%s.png"%(season) figstdthermoname = figdir + "/std.thermo.%s.png"%(season) figstdgradname = figdir + "/std.grad.%s.png"%(season) cbarmthermoname = figdir + "/mthermo.%s.cbar.png"%(season) cbarmgradname = figdir + "/mgrad.%s.cbar.png"%(season) cbarmlocname = figdir + "/mloc.%s.cbar.png"%(season) cbarstdthermoname = figdir + "/std.thermo.%s.cbar.png"%(season) cbarstdgradname = figdir + "/std.grad.%s.cbar.png"%(season) #------------------------- #ctrack_fig.mk_pict_saone_reg(a2in=a2mthermo, soname=figmthermoname, cbarname=cbarmthermoname) #ctrack_fig.mk_pict_saone_reg(a2in=a2stdthermo, soname=figstdthermoname, cbarname=cbarstdthermoname) #ctrack_fig.mk_pict_saone_reg(a2in=a2mgrad, soname=figmgradname, cbarname=cbarmgradname) #ctrack_fig.mk_pict_saone_reg(a2in=a2stdgrad, soname=figstdgradname, cbarname=cbarstdgradname) ctrack_fig.mk_pict_saone_reg(a2in=a2mloc, soname=figmlocname, cbarname=cbarmlocname) #-------------------------
#*** #*************************************************************************************************** #*** figure **************************************************************************************** ##**************************************** #--- figure gradq ------- figdir = "/media/disk2/out/JRA25/sa.one.%s/6hr/tenkizu/06h/%04d%02d/gradq"%(sresol, year, mon) ctrack_func.mk_dir(figdir) bnd = [0.5, 1.0, 1.5, 2.0, 2.5, 3.0] #bnd = False if day == iday: cbarname = figdir + "/gradq.cbar.png" # 6hr ------ soname = figdir + "/gradq.6hr.%04d.%02d.%02d.png"%(year,mon,day) stitle = "grad q (1.0e-8 kg/kg/m) %s 6-hourly\n"%(sresol) stitle = stitle + "%04d-%02d-%02d"%(year,mon,day) ctrack_fig.mk_pict_saone_reg(a2gradq6h*1.e+8, soname=soname, stitle=stitle, bnd=bnd, mycm="jet",cbarname=cbarname) print soname # daily ------ soname = figdir + "/gradq.day.%04d.%02d.%02d.png"%(year,mon,day) stitle = "grad q (1.0e-8 kg/kg/m) %s daily \n"%(sresol) stitle = stitle + "%04d-%02d-%02d"%(year,mon,day) ctrack_fig.mk_pict_saone_reg(a2gradq*1.e+8, soname=soname, stitle=stitle, bnd=bnd, mycm="jet",cbarname=cbarname) print soname #**************************************** #--- figure gradtheta ------- figdir = "/media/disk2/out/JRA25/sa.one.%s/6hr/tenkizu/06h/%04d%02d/grad.theta"%(sresol, year, mon) ctrack_func.mk_dir(figdir) bnd = [0.5, 1.0, 1.5, 2.0, 2.5, 3.0]