Former-commit-id:81bc07bff4
[formerly8072752c77
] [formerly4c6ff79e71
] [formerly8347bed50e
[formerly4c6ff79e71
[formerly dd6304e82206bb46b0c0442d15ab5d9312d9f19f]]] Former-commit-id:8347bed50e
Former-commit-id: f3152ba9f38327cd1d37f2849c62a4d8c8652434 [formerlyb35027f661
] Former-commit-id:ff7a21ac37
20 lines
486 B
Python
20 lines
486 B
Python
#!/awips2/python/bin/python
|
|
|
|
import re
|
|
import sys
|
|
|
|
# we expect the filename as a command-line argument.
|
|
hdf5file = sys.argv[1]
|
|
|
|
matches = re.search(r'modelsounding-([0-9]+-[0-9]+-[0-9]+)-([0-9]+).h5', hdf5file, re.M|re.I)
|
|
if matches:
|
|
# extract the date
|
|
# extract the hour
|
|
date = matches.group(1)
|
|
hour = matches.group(2)
|
|
|
|
reftimeDirName = date + "_" + hour + ":00:00.0"
|
|
print reftimeDirName
|
|
else:
|
|
print "ERROR: unrecognized file - " + hdf5file + "!"
|
|
sys.exit(-1)
|