Changeset 51f9853 in flex_extract.git for python/getMARSdata.py


Ignore:
Timestamp:
Oct 5, 2018, 3:19:05 PM (6 years ago)
Author:
anphi <anne.philipp@…>
Branches:
master, ctbto, dev
Children:
ceea034
Parents:
aa1af8c
Message:

added request parameter for writing mars requests into csv file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • python/getMARSdata.py

    re18f4b5 r51f9853  
    6060    print "start date %s "%(c.start_date)
    6161    print "end date %s "%(c.end_date)
     62   
     63    if c.request == '0' or c.request == '2':
     64        print("Retrieving EC data!")
     65    elif c.request == '1':
     66        print("Printing mars requests!")
    6267
    6368    if ecapi:
     
    9196
    9297    datechunk=datetime.timedelta(days=int(c.date_chunk))
    93     print 'removing content of '+c.inputdir
    94     tobecleaned=glob.glob(c.inputdir+'/*_acc_*.'+str(os.getppid())+'.*.grb')
    95     for f in tobecleaned:
    96         os.remove(f)
     98    if c.request == '0' or c.request == '2':
     99        print 'removing content of '+c.inputdir
     100        tobecleaned=glob.glob(c.inputdir+'/*_acc_*.'+str(os.getppid())+'.*.grb')
     101        for f in tobecleaned:
     102            os.remove(f)
    97103
    98104    times=None
     
    109115            print "retrieve " + dates + " in dir " + c.inputdir
    110116            try:
    111                 flexpart.retrieve(server, c.public, dates, times, c.inputdir)
     117                flexpart.retrieve(server, c.public, dates, c.request, times, c.inputdir)
    112118            except IOError:
    113119                myerror(c,'MARS request failed')
     
    125131
    126132            print "retrieve " + dates + " in dir " + c.inputdir
    127             flexpart.retrieve(server, c.public, dates, times, c.inputdir)
     133            flexpart.retrieve(server, c.public, dates, c.request, times, c.inputdir)
    128134            day+=datechunk
    129135
    130136
    131 
    132     tobecleaned=glob.glob(c.inputdir+'/*__*.'+str(os.getppid())+'.*.grb')
    133     for f in tobecleaned:
    134         os.remove(f)
     137    if c.request == '0' or c.request == '2':
     138        print 'removing content of '+c.inputdir
     139        tobecleaned=glob.glob(c.inputdir+'/*__*.'+str(os.getppid())+'.*.grb')
     140        for f in tobecleaned:
     141            os.remove(f)
     142           
    135143    day=start
    136144    times=None
     
    145153        print "retrieve " + dates + " in dir " + c.inputdir
    146154
    147         flexpart.retrieve(server, c.public, dates, times, c.inputdir)
     155        flexpart.retrieve(server, c.public, dates, c.request, times, c.inputdir)
    148156        day+=datechunk
    149157
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG