Changeset 2813 in lmdz_wrf for trunk/tools/to_OBSstations.py


Ignore:
Timestamp:
Apr 17, 2020, 10:23:26 PM (5 years ago)
Author:
lfita
Message:

Fixing various issues

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/to_OBSstations.py

    r2799 r2813  
    4141parser = OptionParser()
    4242parser.add_option("-f", "--StFile", dest="Stfile", help="File with the stations values", metavar="FILENAME")
     43parser.add_option("-g", "--Debug", dest="debug", help="Activate debug (Not passed, assumed no)", metavar="VALUE")
    4344parser.add_option("-d", "--DescFile", dest="descfile", help="File with the description of the content", metavar="FILENAME")
    4445(opts, args) = parser.parse_args()
     
    4849## MAIN
    4950    #######
     51if opts.debug is None:
     52    debug = False
     53else:
     54    debug = True
     55
    5056# Expected description values
    5157descstvals = ['station_name', 'WMOid', 'longitude', 'lon_deg', 'lon_min', 'lon_sec', \
     
    7884of.close()
    7985
     86if debug:
     87    print ' Values to search _______'
     88    gen.printing_dictionary(vals)
     89
    8090lvals = list(vals.keys())
    8191if not gen.searchInlist(lvals, 'sepchar'):
     
    97107          '')
    98108        linev = linevals.split(vals['sepchar'])
     109
     110        if debug:
     111            print 'line values _______'
     112            Nvals = len(linev)
     113            for iv in range(Nvals):
     114                if gen.searchInlist(vals.values(),iv):
     115                    obsval = gen.dictionary_key(vals, iv)
     116                    print '    ', iv, ':', linev[iv], '<>', obsval
     117                else:
     118                    print '    ', iv, ':', linev[iv]
    99119
    100120        if vals.has_key(descstvals[2]) and not vals.has_key(descstvals[3]):
Note: See TracChangeset for help on using the changeset viewer.