Changeset 2813 in lmdz_wrf for trunk/tools/to_OBSstations.py
- Timestamp:
- Apr 17, 2020, 10:23:26 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/to_OBSstations.py
r2799 r2813 41 41 parser = OptionParser() 42 42 parser.add_option("-f", "--StFile", dest="Stfile", help="File with the stations values", metavar="FILENAME") 43 parser.add_option("-g", "--Debug", dest="debug", help="Activate debug (Not passed, assumed no)", metavar="VALUE") 43 44 parser.add_option("-d", "--DescFile", dest="descfile", help="File with the description of the content", metavar="FILENAME") 44 45 (opts, args) = parser.parse_args() … … 48 49 ## MAIN 49 50 ####### 51 if opts.debug is None: 52 debug = False 53 else: 54 debug = True 55 50 56 # Expected description values 51 57 descstvals = ['station_name', 'WMOid', 'longitude', 'lon_deg', 'lon_min', 'lon_sec', \ … … 78 84 of.close() 79 85 86 if debug: 87 print ' Values to search _______' 88 gen.printing_dictionary(vals) 89 80 90 lvals = list(vals.keys()) 81 91 if not gen.searchInlist(lvals, 'sepchar'): … … 97 107 '') 98 108 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] 99 119 100 120 if vals.has_key(descstvals[2]) and not vals.has_key(descstvals[3]):
Note: See TracChangeset
for help on using the changeset viewer.