-
Notifications
You must be signed in to change notification settings - Fork 1
/
VAISALA2GEMA.py
47 lines (39 loc) · 1.83 KB
/
VAISALA2GEMA.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# -*- coding: utf-8 -*-
"""
Created on Thu Jul 2 16:47:02 2020
@author: Weather Radar Team
"""
from datetime import datetime
import os, sys
vasisalaFolder='D:/project_webprogramming/wxradarexplore/radarDataConversion/20200620'
gemaFolder='D:/Rainbow5.40/rainbow/rawdata'
rb5bin='D:/Rainbow5.40/rainbow/bin'
sesnsorID='Ambon'
siteID='AMQ'
scanning='RAW_PPIVOL_A.vol'
for file in os.listdir(vasisalaFolder):
print(file)
time=datetime(int(file[5:9]),int(file[9:11]),int(file[11:13]),int(file[14:16]),int(file[16:18]))
infile='{}/{}'.format(vasisalaFolder,file)
outpath='{}/{}/{}/{}'.format(gemaFolder,siteID,scanning,time.strftime("%Y-%m-%d"))
try:os.makedirs(outpath)
except:pass
outfiledbz='{}/{}'.format(outpath,time.strftime("%Y%m%d%H%M0000dBZ.vol"))
outfilev='{}/{}'.format(outpath,time.strftime("%Y%m%d%H%M0000V.vol"))
outfilew='{}/{}'.format(outpath,time.strftime("%Y%m%d%H%M0000W.vol"))
if sys.platform=='linux':
command1='cd {};./RainH5ToRb5 --infile={} --type=volume'.format(rb5bin,infile)
elif sys.platform=='win32':
command1='{}/RainH5ToRb5 --infile={} --type=volume'.format(rb5bin,infile)
commanddbz='--rbdatatype=dBZ --outfile={} --sensorid={} --sensorname={}'.format(outfiledbz,siteID,sesnsorID)
commandv ='--rbdatatype=V --outfile={} --sensorid={} --sensorname={}'.format(outfilev,siteID,sesnsorID)
commandw ='--rbdatatype=W --outfile={} --sensorid={} --sensorname={}'.format(outfilew,siteID,sesnsorID)
fullcommanddbz='{} {}'.format(command1,commanddbz)
fullcommandv='{} {}'.format(command1,commandv)
fullcommandw='{} {}'.format(command1,commandw)
p = os.popen(fullcommanddbz)
print(p.read())
p = os.popen(fullcommandv)
print(p.read())
p = os.popen(fullcommandw)
print(p.read())