Changeset 403cbf1 in flex_extract.git


Ignore:
Timestamp:
Nov 16, 2018, 10:27:15 PM (6 months ago)
Author:
Anne Philipp <anne.philipp@…>
Branches:
dev
Children:
ac48dae
Parents:
2e62398
Message:

added header writing to marsrequest file and corrected bug in normalexit call in submit

Location:
source/python
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • source/python/mods/get_mars_data.py

    r96e1533 r403cbf1  
    7474from classes.EcFlexpart import EcFlexpart
    7575from classes.UioFiles import UioFiles
     76from classes.MarsRetrieval import MarsRetrieval
    7677
    7778try:
     
    131132        make_dir(c.inputdir)
    132133
    133     if c.request == 0 or c.request == 2:
     134    if c.request == 0:
    134135        print("Retrieving EC data!")
    135     elif c.request == 1:
    136         print("Printing mars requests!")
     136    else:
     137        if c.request == 1:
     138            print("Printing mars requests!")
     139        elif c.request == 2:
     140            print("Retrieving EC data and printing mars request!")
     141        # first, write header with the mars parameter to file
     142        # create a dummy MarsRetrieval to get parameter
     143        MR = MarsRetrieval(None, None)
     144        attrs = vars(MR).copy()
     145        del attrs['server']
     146        del attrs['public']
     147        marsfile = os.path.join(c.inputdir, _config.FILE_MARS_REQUESTS)
     148        with open(marsfile, 'w') as f:
     149            f.write('request_number' + ', ')
     150            f.write(', '.join(str(key) for key in sorted(attrs.iterkeys())))
     151            f.write('\n')
    137152
    138153    print("start date %s " % (c.start_date))
  • source/python/submit.py

    r96e1533 r403cbf1  
    101101        submit(args.job_template, c, args.queue)
    102102
    103     normal_exit(c.mailops, c.queue, exit_message)
     103    normal_exit(exit_message)
    104104
    105105    return
Note: See TracChangeset for help on using the changeset viewer.
hosted by ZAMG