Changeset e879023 in flex_extract.git


Ignore:
Timestamp:
Jan 14, 2019, 10:48:28 PM (5 years ago)
Author:
anphi <anne.philipp@…>
Branches:
master, ctbto, dev
Children:
9a91826
Parents:
20577dc
Message:

fixed bug in retrieving with basetime

Location:
python
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/FlexpartTools.py

    r2193808 re879023  
    827827        else:
    828828            for ty,st,ti in zip(c.type,c.step,c.time):
    829                 btlist=range(24)
     829                btlist=range(len(c.time))
    830830                if c.basetime=='12':
    831831                    btlist=[1,2,3,4,5,6,7,8,9,10,11,12]
     
    837837                   (ty.upper() != 'AN' and mod(int(c.step[i]),int(c.dtime))==0 and \
    838838                    mod(int(c.step[i]),int(c.dtime))==0) ) and \
    839                    (int(c.time[i]) in btlist or c.maxstep>24):
     839                   (i in btlist or c.maxstep>24):
    840840                    if ty not in self.types.keys():
    841841                        self.types[ty]={'times':'','steps':''}
     
    11551155                        mftimesave=''.join(mftime)
    11561156
     1157                        if pk=='OG_OROLSM__SL':
     1158                            mfdate=self.dates.split('/')[0]
     1159                            mftarget=self.inputdir+"/"+pk+'.'+mfdate+'.'+str(os.getppid())+'.'+str(os.getpid())+".grb"
     1160
    11571161                        if '/' in mftime:
    11581162                            times=mftime.split('/')
     
    11631167                                else:
    11641168                                    mftime=times[0]
     1169
     1170                        if int(mftimesave.split('/')[0])==0 and int(mfstep.split('/')[0])==0 and pk!='OG_OROLSM__SL':
     1171                            mfdate=datetime.datetime.strftime(elimit,'%Y%m%d')
     1172                            mftime='00'
     1173                            mfstep='000'
     1174                            mftarget=self.inputdir+"/"+ftype+pk+'.'+mfdate+'.'+str(os.getppid())+'.'+str(os.getpid())+".grb"
     1175
    11651176                        # increase number of mars requests
    11661177                        self.mreq_count += 1
     
    11791190                            MR.displayInfo()
    11801191                            MR.dataRetrieve()
    1181 
    1182                         if int(mftimesave.split('/')[0])==0 and int(mfstep.split('/')[0])==0 and pk!='OG_OROLSM__SL':
    1183                             mfdate=datetime.datetime.strftime(elimit,'%Y%m%d')
    1184                             mftime='00'
    1185                             mfstep='000'
    1186                             mftarget=self.inputdir+"/"+ftype+pk+'.'+mfdate+'.'+str(os.getppid())+'.'+str(os.getpid())+".grb"
    1187                             # increase number of mars requests
    1188                             self.mreq_count += 1
    1189                             MR= MARSretrieval(self.server, self.public, dataset=self.dataset, marsclass=self.marsclass, stream=self.stream,
    1190                                               type=mftype, levtype=pv[1], levelist=pv[2],resol=self.resol, gaussian=gaussian,
    1191                                           accuracy=self.accuracy,grid=pv[3],target=mftarget,area=area,
    1192                                           date=mfdate, time=mftime,number=self.number,step=mfstep, expver=self.expver, param=pv[0])
    1193 
    1194                             if request == 0:
    1195                                 MR.displayInfo()
    1196                                 MR.dataRetrieve()
    1197                             elif request == 1:
    1198                                 MR.print_infodata_csv(self.inputdir, self.mreq_count)
    1199                             elif request == 2:
    1200                                 MR.print_infodata_csv(self.inputdir, self.mreq_count)
    1201                                 MR.displayInfo()
    1202                                 MR.dataRetrieve()
    12031192
    12041193
  • python/getMARSdata.py

    r5862eb9 re879023  
    7373        del attrs['server']
    7474        del attrs['public']
    75         marsfile = os.path.join(c.inputdir, 'mars_request.csv')
     75        marsfile = os.path.join(c.inputdir, 'mars_requests.csv')
    7676        with open(marsfile, 'w') as f:
    7777            f.write('request_number' + ', ')
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG