- Timestamp:
- Jan 29, 2015, 9:13:29 AM (9 years ago)
- Branches:
- master, 10.4.1_pesei, FPv9.3.1, FPv9.3.1b_testing, FPv9.3.2, GFS_025, bugfixes+enhancements, dev, fp9.3.1-20161214-nc4, grib2nc4_repair, release-10, release-10.4.1, scaling-bug, univie
- Children:
- 3372ef9
- Parents:
- 30006de
- Location:
- preproc
- Files:
-
- 2 added
- 3 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
preproc/python/FlexpartTools.py
r5763793 r0e29ef4 353 353 index_keys=["date","time","stepRange"] 354 354 indexfile="date_time_stepRange.idx" 355 silentremove(indexfile) 355 356 grib=GribTools(inputfiles.files) 356 357 iid=grib.index(index_keys=index_keys, index_file = indexfile) 357 358 359 print 'index done...' 358 360 silentremove("fort.10") 359 361 silentremove("fort.11") … … 389 391 step = grib_get(gid, 'stepRange') 390 392 cflextime = self.getFlexpartTime(type,step, time) 393 # print 'cyear '+cyear+'/'+cmonth+'/'+'/EI'+cyear[2:4]+cmonth+cday+cflextime 391 394 while 1: 392 395 if gid is None: break … … 420 423 # create the corresponding output file fort.15 (generated by CONVERT2) + fort.16 (paramId 167 and paramId 168) 421 424 mkdir_p(outputdir+'/'+cyear+'/'+cmonth+'/') 425 print "outputdir = " + outputdir+'/'+cyear+'/'+cmonth+'/'+'/EI'+cyear[2:4]+cmonth+cday+cflextime 422 426 fout = open(outputdir+'/'+cyear+'/'+cmonth+'/EI'+cyear[2:4]+cmonth+cday+cflextime,'wb') 423 427 shutil.copyfileobj(open('fort.15','rb'), fout) … … 427 431 grib_index_release(iid) 428 432 429 def clean(self):433 def __del__(self): 430 434 print "clean" 431 435 silentremove("fort.10") 436 silentremove("fort.11") 437 silentremove("fort.12") 438 silentremove("fort.13") 439 silentremove("fort.15") 440 silentremove("fort.16") 441 silentremove("fort.18") 442 silentremove("VERTICAL.EC") 443 silentremove("date_time_stepRange.idx") 444 -
preproc/python/GribTools.py
r5763793 r0e29ef4 118 118 # Create index from a list of files if it does not exist or read it 119 119 def index(self,index_keys=["mars"], index_file = "my.idx"): 120 print "index to be done" 120 121 self.iid = None 121 122 -
preproc/python/getEIdata.py
r5763793 r0e29ef4 92 92 for date in daterange( start, end ): 93 93 # if new year & month then we create a new directory to store output files 94 er_date = date 95 if date.strftime("%Y%m") != current_ym: 96 current_outputdir = outputdir + "/" + date.strftime("%Y") + '/' + date.strftime("%m") + '/' 97 mkdir_p(current_outputdir) 98 if current_ym != "": 94 if date.strftime("%Y%m") != current_ym and current_ym != "": 99 95 retrieve="yes" 100 96 … … 106 102 flexpart = EIFlexpart() 107 103 dates= ir_date.strftime("%Y%m%d") + "/to/" + er_date.strftime("%Y%m%d") 104 current_outputdir = outputdir + "/" + ir_date.strftime("%Y") + '/' + ir_date.strftime("%m") + '/' 105 mkdir_p(current_outputdir) 106 print "retrieve " + dates + " in dir " + current_outputdir 108 107 flexpart.retrieve(server, dates, options.times, options.area, options.levels, current_outputdir) 109 ir_date = er_date 108 ir_date = date 109 retrieve="no" 110 111 er_date = date 110 112 111 113 current_ym = date.strftime("%Y%m") -
preproc/python/prepareFLEXPART.py
r5763793 r0e29ef4 90 90 # data retrieved by year/month 91 91 if cyear != date.year or cmonth != date.month: 92 print ' year : ' + str(date.year) + ' month : ', date.month92 print 'Prepare year : ' + str(date.year) + ' month : ', date.month 93 93 cyear = date.year 94 94 cmonth = date.month … … 102 102 flexpart = EIFlexpart() 103 103 flexpart.create(inputfiles, outputdir) 104 104 105 105 106 if __name__ == "__main__":
Note: See TracChangeset
for help on using the changeset viewer.