Esempio n. 1
0
 
         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)
         frontqname1 = frontdir_q + "/front.q.M1.%04d.%02d.%02d.%02d.sa.one"%(year, mon, day, hour)
         frontqname2 = frontdir_q + "/front.q.M2.%04d.%02d.%02d.%02d.sa.one"%(year, mon, day, hour)  
 
         #-- front.t ---
         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, a2maxorog, a2gradorog, thorog_front, thgradorog, thgrids, miss )
 
         #-- front.q ---
         if ftype == "q":
           a2nbc1      = fromfile(frontqname1, float32).reshape(ny,nx)
           a2nbc2      = fromfile(frontqname2, float32).reshape(ny,nx)
           a2nbc       = front_func.complete_front_q_saone(a2fbc, a2nbc1, a2nbc2, thfmask1q, thfmask2q, a2maxorog, a2gradorog, thorog_front, thgradorog, thgrids, miss)
   
         #-- count baloclinic front loc --
         if ftype == "t":
           a2loc = a2fbc
         elif ftype == "q":
           a2loc = a2nbc
         #-------------------
         a2temp         = ma.masked_where(a2loc ==miss, a2one).filled(miss)
   
         a2countterr    = ctrack_fsub.mk_8gridsmask_saone(a2temp.T, miss).T
         a2count_tmp    = ma.masked_where(a2countterr ==miss, a2one).filled(0.0)
 
         a2count_mon = a2count_mon + a2count_tmp
     #********************************
     #-- for monthly data front ------
Esempio n. 2
0
import front_func
import ctrack_para, front_para
thfmask1t, thfmask2t, thfmask1q, thfmask2q   = front_para.ret_thfmasktq()

ny,nx      = 180,360
thorog     = ctrack_para.ret_thorog()
thgradorog = ctrack_para.ret_thgradorog()
thgrids    = front_para.ret_thgrids()
miss       = -9999.0

orogname   = "/media/disk2/data/JRA25/sa.one.125/const/topo/topo.sa.one"
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)

iname1t = "/media/disk2/out/JRA25/sa.one.anl_p/6hr/front.t/200404/front.t.M1.2004.04.06.00.sa.one"
iname2t = "/media/disk2/out/JRA25/sa.one.anl_p/6hr/front.t/200404/front.t.M2.2004.04.06.00.sa.one"
a2pott1 = fromfile(iname1t,float32).reshape(180,360)
a2pott2 = fromfile(iname2t,float32).reshape(180,360)

a2loct  = front_func.complete_front_t_saone(a2pott1, a2pott2, thfmask1t, thfmask2t, a2orog, a2gradorog, thorog, thgradorog, thgrids, miss )
print a2loct.max()

iname1q = "/media/disk2/out/JRA25/sa.one.anl_p/6hr/front.q/200404/front.q.M1.2004.04.06.00.sa.one"
iname2q = "/media/disk2/out/JRA25/sa.one.anl_p/6hr/front.q/200404/front.q.M2.2004.04.06.00.sa.one"
a2potq1 = fromfile(iname1q,float32).reshape(180,360)
a2potq2 = fromfile(iname2q,float32).reshape(180,360)

a2locq  = front_func.complete_front_q_saone(a2loct, a2potq1, a2potq2, thfmask1q, thfmask2q, a2orog, a2gradorog, thorog, thgradorog, thgrids, miss)